Embedded Systems Lesson 2 PDF
Document Details
Tags
Summary
This document is a lesson on embedded systems, covering hardware units like power supply, clock, memory types, and buses. It provides a fundamental overview of the topics.
Full Transcript
Embedded Systems Lesson 2 EMBEDDED HARDWARE UNITS Power supply unit: embedded system operates in one of the following power ranges - 5.0 volt ± 0.25 volt...
Embedded Systems Lesson 2 EMBEDDED HARDWARE UNITS Power supply unit: embedded system operates in one of the following power ranges - 5.0 volt ± 0.25 volt - 3.3 volt ± 0.3 volt - 2 volt ± 0.2 volt some embedded systems do not have their own power supply either connect thru external supply or use charge pumps charge pump is an circuit which accumulates charge from the bus signals or wireless radiation Clock: synchronizes the operations of the microcontroller INTEL 8051 operates at 12 MHz frequency quartz crystal is connected to the microcontroller externally all other components of the oscillator are inbuilt within the 8051 a highly stable oscillator is required for embedded systems Real-time clock: a clock started by the system and it does not stop and reset count value can be reloaded used in a system to save the current date and time used in a system to return the control of the system after definite interval of time Watchdog timer reset: reset means the processor starts the processing of instructions from the starting address processor stores the starting address in program counter, instructions are fetched from that address following the reset reset of program is known as power-up reset reset can be either be a system program that executes from beginning or a system boot-up program or a system initialization program two start-up addresses: - power-up reset vector - reset vector after reset or time-out from watchdog timer Memory: system has internal RAM and ROM for program code bytes and data storage external memory can be added to the system using suitable circuits internal RAM is organized into three different areas - Register banks - Random access memory (RAM) - Read only memory (ROM) caches are also available in higher version of embedded processors cache is small, fast memory that holds copies of some of the contents of the main memory provides higher speed access for the CPU; not all requests can be satisfied by the cache makes sense when the CPU is using only a small set of memory locations often called the working set cache controller mediates between the CPU and the memory system most basic characteristics of a memory is its capacity several versions of a memory of a given size with a different data width categories of random access memory (RAM): - static RAM or SRAM: faster but consumes more power - dynamic RAM or DRAM: higher memory density, values must be periodically refreshed, complex interface to minimize pins varieties of ROM: - electrically erasable programmable ROM(EEPROM) or flash ROM: programmed inside a typical system - programmable ROM (PROM), factory programmed Buses: consists of a common set of lines to connect multiple devices, hardware units and I/O ports allows CPU to communicate with memory and I/O defines a protocol by which the CPU, memory and devices communicate may be a serial or parallel provides an interface to memory bus communication protocol: - specifies how signals communicate - specify the ways of arbitration - basic building block is four cycled handshake, ensures one is ready to transmit and the other is ready to receive most basic uses of a bus is as address bus clock provides synchronization some buses use multiplexed address and data additional control lines, called control bus, are provided to tell whether the value on the address/data lines is an address or data Direct Memory Access (DMA) controller: a bus operation that allows read/write operation without CPU control controlled by a DMA controller performs read and write operations directly between devices and memory provides ‘bus request’ signal to CPU CPU performs the current task and provides ‘bus grant’ signal then data is transferred between memory and I/O device the DMA controller returns the bus to the control of CPU Input/Output (I/O): connect the system to the outside world latch and corresponding driver of ports is provided to the chip I/O ports ports are bidirectional input output ports I/O pins are used for both address and data I/O port also can be used as serial data communication Analog to Digital Converter (ADC): produce a digital word corresponding to the magnitude of some analog voltage or current types of ADC - Parallel converter A/D converter - Dual slope A/D converter - Successive approximation type A/D converter Digital to Analog Converter (DAC): digital signal is to be converted to analog signal for different applications like audio system, measurement of a physical quantity or industrial control systems types of digital to analog converters - Current output type: provides current output corresponding to input digital signal - Voltage output type: converts the current signal into voltage signal and provides voltage output corresponding to input digital signal - Multiplying type: product of the input signal and the reference signal Keyboard: an array of switches, device for getting user inputs includes circuit for interfacing to the processor and key-debouncing has software to receive input from a set of keys Liquid Crystal Diode (LCD) and Light Emitting Diode (LED): display the status or message for a line needs necessary circuit and software for the output to LCD or LED display Modem, pulse dialer and transceivers: used in communication system, requires necessary interfacing circuit and software Interrupt handler: microcontrollers allow interruption of execution of the program code is assigned to every interrupt for identification, can be initiated by devices or by software when initiated, execution of program stops and calls a procedure which services the interrupt at the end, execution of the program restarts from the instruction where it stopped if interrupted by instruction, software interrupt when executing an important program, interrupts are disabled may be interrupted by abnormal internal condition known as exception, may also be caused by external events applications involve responding to events quickly to control the events Polling: continuously monitors the status of a given device; when condition is met, it performs the service main disadvantage, it wastes much of the microcontroller’s time not possible to assign priority and ignore a device, checks all devices in a round-robin process Arduino IDE Arduino Sketch projects in Arduino are called sketches and is stored in a Sketchbook designed to be as simple and straightforward as possible coding language is very similar to C programming language Arduino uploading process: - preprocessing, turns the sketch into a C++ program - compiler to turn C++ code into machine instructions (object files) - object files are then linked against the standard Arduino libraries - results into a single hex file that can be uploaded Arduino tools perform all of this automatically Arduino IDE an integrated development environment that can be installed on Windows, macOS and Linux can be downloaded from the Arduino software page latest stable version of the IDE is 2.3.2 Exploring the IDE menu bar - functions like menu bars in other applications - click on one of the options, and a submenu appears with more options command bar - quick access to five of the most commonly used commands - verify, attempt to compile the sketch to verify that there is nothing wrong with the code - upload, attempt to build and upload the sketch to the attached Arduino - new, create a new sketch. - open, open a sketch - save, save the sketch coding area - where we write the code for the Arduino - two functions (setup and loop) are automatically created status area - let us know what is happening when the IDE is doing something like compiling, uploading or verifying a sketch Configuring the Arduino within the IDE to connect an Arduino to the IDE the first thing the IDE needs to know is what type of Arduino is being used we click on the Tools option in the menu bar and select the Board option when the Board option is selected the IDE displays a list of compatible boards once the board is selected we need to select the port, click on the Tools menu option from the menu bar and then select the Port option when Port option is selected, the IDE displays a list of the ports it is aware of