Module 3 Embedded System Components
Module 3 Embedded System Components
MODULE – 3
Embedded System
Components
INTRODUCTION
WHAT IS AN EMBEDDED SYSTEM?
Contains a General Purpose Operating System (GPOS) May or may not contain an operating system for
functioning
Applications are alterable (programmable) by the user (It The firmware of the embedded system is pre-programmed
is possible for the end user to re-install the operating and it is non-alterable by the end-user (There may be
system, and also add or remove user applications) exceptions for system supporting OS kernel image flashing
through special hardware settings)
Performance is the key deciding factor in the selection of Application-specific requirements (like performance,
the system. Always, ‘Faster is Better’ power requirements, memory usage, etc.) are the key
deciding factors
Less/not at all tailored towards reduced operating power Highly tailored to take advantage of the power saving
requirements, options for different levels of power modes supported by the hardware and the operating
management system
Response requirements are not time-critical For certain category of embedded systems like mission
critical systems, the response time requirement is highly
critical
Need not be deterministic in execution behaviour Execution behaviour is deterministic for certain types of
embedded systems like ‘Hard Real Time’ systems
HISTORY OF EMBEDDED SYSTEMS
• Embedded systems were in existence even before the IT revolution.
• Built around the old vacuum tube and transistor technologies.
• Advances in semiconductor and nanotechnology and IT revolution gave way to the
development of miniature embedded systems.
• The first recognised modern embedded system is the Apollo Guidance Computer
(AGC)
developed by the MIT Instrumentation Laboratory for the lunar expedition.
• It had 36K words of fixed memory and 2K words of erasable memory.
• The clock frequency of was 1.024 MHz and it was derived from a 2.048 MHz
crystal
clock.
• The first mass-produced embedded system was the Autonetics D-17 guidance
computer for the Minuteman-I missile in 1961.
• It was built using discrete transistor logic and a hard-disk for main memory.
• The first integrated circuit was produced in September 1958 and computers using
them
CLASSIFICATION OF EMBEDDED SYSTEMS
• Some of the criteria used in the classification of embedded
systems are:
1. Based on generation
2. Complexity and performance requirements
3. Based on deterministic behaviour
4. Based on triggering
CLASSIFICATION BASED ON GENERATION
• First Generation
• Second Generation
• Third Generation
• Fourth Generation
• Next Generation
CLASSIFICATION BASED ON GENERATION (CONTINUED)
• First Generation
• Early embedded systems were built around 8-bit microprocessors
like 8085 and Z80 and 4-bit microcontrollers.
• Simple in hardware circuits with firmware developed in assembly
code.
• E.g.: Digital telephone keypads, stepper motor control units, etc.
CLASSIFICATION BASED ON GENERATION (CONTINUED)
• Second Generation
• Embedded systems built around 16-bit microprocessors and 8-bit
or 16-bit microcontrollers.
• Instruction set were much more complex and powerful than the
first generation.
• Some of the second generation embedded systems contained
embedded operating systems for their operation.
• E.g.: Data acquisition systems, SCADA systems, etc.
CLASSIFICATION BASED ON GENERATION (CONTINUED)
• Third Generation
• Embedded systems built around 32-bit microprocessors and 16-bit
microcontrollers.
• Application and domain specific processors/controllers like Digital
Signal Processors (DSP) and Application Specific Integrated Circuits
(ASICs) came into picture.
• The instruction set of processors became more complex and powerful
and the concept of instruction pipelining also evolved.
• Dedicated embedded real time and general purpose operating systems
entered into the embedded market.
• Embedded systems spread its ground to areas like robotics, media,
industrial process control, networking, etc.
CLASSIFICATION BASED ON GENERATION (CONTINUED)
• Fourth Generation
• The advent of System on Chips (SoC), reconfigurable processors
and multicore processors are bringing high performance, tight
integration and miniaturisation into the embedded device
market.
• The SoC technique implements a total system on a chip by
implementing different functionalities with a processor core on
an integrated circuit.
• They make use of high performance real time embedded
operating systems for their functioning.
• E.g.: Smart phone devices, Mobile Internet Devices
(MIDs), etc.
CLASSIFICATION BASED ON GENERATION (CONTINUED)
• Next Generation
• The processor and embedded market is highly dynamic and
demanding.
• The next generation embedded systems are expected to meet
growing demands in the market.
CLASSIFICATION BASED ON COMPLEXITY AND PERFORMANCE
• Data Collection/Storage/Representation
• Embedded systems designed for the purpose of
data collection performs acquisition of data from
the external world.
• Data collection is usually done for storage,
analysis, manipulation and transmission.
• The term "data" refers all kinds of information,
viz. text, voice, image, video, electrical signals and • A digital camera is a typical
example of an embedded system
any other measurable quantities. with data
collection/storage/representation
• Data can be either analog (continuous) or digital of data.
(discrete). • Images are captured and the
captured image may be stored
• The collected data may be stored or transmitted within the memory of the camera.
or it may be processed or it may be deleted • The captured image can also be
presented to the user through a
instantly after giving a meaningful representation. graphic LCD unit.
PURPOSE OF EMBEDDED SYSTEMS (CONTINUED)
• Data Communication
• Embedded data communication systems are
deployed in applications ranging from complex
satellite communication systems to simple
home networking systems.
• The transmission is achieved either by a wire-
Fig: A wireless network router for
line medium or by a wireless medium. data communication
• The data collecting embedded terminal itself • Network hubs, routers, switches,
etc. are typical examples of
can incorporate data communication units like dedicated data transmission
embedded systems.
wireless modules (Bluetooth, ZigBee, Wi-Fi, • They act as mediators in data
communication and provide
EDGE, GPRS, etc.) or wire-line modules (RS- various features like data security,
monitoring etc.
232C, USB, TCP/IP, PS2, etc.).
PURPOSE OF EMBEDDED SYSTEMS (CONTINUED)
• Monitoring
• Almost embedded products coming under the medical
domain are used for monitoring.
• A very good example is the electro cardiogram (ECG)
machine for monitoring the heartbeat of a patient.
• The machine is intended to do the monitoring of the heartbeat.
• It cannot impose control over the heartbeat.
• The sensors used in ECG are the different electrodes connected
to the patient's body.
Fig: A patient monitoring system for
• Some other examples of embedded systems with monitoring heartbeat
monitoring function are measuring instruments like
digital CRO, digital multimeters, logic analyzers, etc.
used in Control & Instrumentation applications.
PURPOSE OF EMBEDDED SYSTEMS (CONTINUED)
• Control
• Embedded systems with control functionalities
impose control over some variables according to
the changes in input variables.
• A system with control functionality contains both
sensors and actuators.
• Sensors are connected to the input port for
capturing the changes in environmental variable • An Air Conditioner System used to
control the room temperature to
or measuring variable. a specified limit is a typical
example for embedded system for
• The actuators connected to the output port are control purpose.
controlled according to the changes in input • An air conditioner contains a
room temperature-sensing
variable to put an impact on the controlling element (sensor) which may be a
variable to bring the controlled variable to the thermistor and a handheld unit
for setting up (feeding) the
specified range. desired temperature.
PURPOSE OF EMBEDDED SYSTEMS (CONTINUED)
It is a dependent unit. It requires the combination of other chips It is a self-contained unit and it doesn't require external interrupt
like timers, program and data memory chips, interrupt controllers, controller, timer, UART, etc. for its functioning
etc. for functioning
Most of the time, general purpose in design and operation Mostly application-oriented or domain-specific
Doesn't contain a built in I/O port. The I/O port functionality needs Most of the processors contain multiple built-in I/O ports which
to be implemented with the help of external programmable can be operated as a single 8 or 16 or 32 bit port or as individual
peripheral interface chips like 8255 port pins
Targeted for high end market where performance is important Targeted for embedded market where performance is not so
critical
Limited power saving options compared to microcontrollers Includes lot of power saving features
DIGITAL SIGNAL PROCESSORS
• Digital Signal Processors (DSPs) are powerful special purpose 8/16/32 bit
microprocessors designed specifically to meet the computational demands and power
constraints of today's embedded audio, video, and communications applications.
• Digital signal processors are 2 to 3 times faster than the general purpose
microprocessors in signal processing applications.
• This is because of the architectural difference between the two.
• DSPs implement algorithms in hardware which speeds up the execution whereas
general purpose processors implement the algorithm in firmware and the speed of
execution depends primarily on the clock for the processors.
• Audio video signal processing, telecommunication and multimedia applications
are
typical examples where DSP is employed.
• Digital signal processing employs a large amount of real-time calculations.
• Sum of products (SOP) calculation, convolution, fast fourier transform (FFT), discrete
fourier transform (DFT), etc, are some of the operations performed by digital signal
processors.
DIGITAL SIGNAL PROCESSORS (CONTINUED)
• A typical digital signal processor incorporates the following key units:
• Program Memory: Memory for storing the program required by DSP to process
the data
• Data Memory: Working memory for storing temporary variables and
data/signal to be processed.
• Computational Engine: Performs the signal processing in accordance with the
stored program memory.
• It incorporates many specialised arithmetic units and each of them operates
simultaneously to increase the execution speed.
• It also incorporates multiple hardware shifters for shifting operands and
thereby
saves execution time.
• I/O Unit: Acts as an interface between the outside world and DSP.
• It is responsible for capturing signals to be processed and delivering the processed
signals.
RISCVS. CISC PROCESSORS/CONTROLLERS
• RISC stands for Reduced Instruction Set Computing.
• All RISC processors/controllers possess lesser number of instructions,
typically in the range of 30 to 40.
• E.g.: Atmel AVR microcontroller – its instruction set contains only 32
instructions.
• CISC stands for Complex Instruction Set Computing.
• The instruction set is complex and instructions are high in number.
• E.g.: 8051 microcontroller – its instruction set contains 255
instructions.
RISC CISC
Instruction pipelining and increased execution speed Generally no instruction pipelining feature
Orthogonal instruction set (Allows each instruction to operate on Non-orthogonal instruction set (All instructions are not allowed to
any register and use any addressing mode) operate on any register and use any addressing mode. It is
instruction-specific)
Operations are performed on registers only, the only memory Operations are performed on registers or memory depending on the
operations are load and store instruction
A large number of registers are available Limited number of general purpose registers
Programmer needs to write more code to execute a task since the Instructions are like macros in C language. A programmer can
instructions are simpler ones achieve the desired functionality with a single instruction which in
turn provides the effect of using more simpler single instructions in
RISC
Less silicon usage and pin count More silicon usage since more additional decoder logic is required
to implement the complex instruction decoding
• The first instruction load R1, x loads the register R1 with the content of memory location x.
• The second instruction load R2, y loads the register R2 with the content of memory location y.
• The instruction add R3, R1, R2 adds the content of registers R1 and R2 and stores the result in
register R3.
• The next instruction store R3,z stores the content of register R3 in memory location z.
LOAD STORE OPERATION AND INSTRUCTION PIPELINING
(CONTINUED)
• The conventional instruction execution by the processor follows the
fetch-decode-execute sequence.
• The fetch part fetches the instruction from program memory or code
memory.
• The decode part decodes the instruction to generate the
necessary control signals.
• The execute stage reads the operands, perform ALU operations and
stores the result.
• In conventional program execution, the fetch and decode
operations are performed in sequence. For simplicity let's consider
decode and execution together.
LOAD STORE OPERATION AND INSTRUCTION PIPELINING
(CONTINUED)
• During the decode operation, the memory address bus is available and if
it is possible to effectively utilise it for an instruction fetch, the
processing speed can be increased.
• Instruction pipelining refers to the overlapped execution of instructions –
i.e., while the current instruction is being decoded and executed, the
next instruction will be fetched.
• If the current instruction in progress is a program control flow transfer
instruction like jump or call instruction, the instruction fetched is flushed
and a new instruction fetch is performed to fetch the instruction.
• Whenever the current instruction is executing the program counter will
be loaded with the address of the next instruction.
• In case of jump or branch instruction, the new location is known only
after completion of the jump or branch instruction.
LOAD STORE OPERATION AND INSTRUCTION PIPELINING
(CONTINUED)
• Depending on the stages involved in an instruction (fetch, read register and
decode, execute instruction, access an operand in data memory, write back the
result to register, etc.), there can be multiple levels of instruction pipelining.
• Figure illustrates the concept of instruction pipelining for single stage
pipelining.
• I2C bus is a shared bus system to which many number of I2C devices can
be connected.
• Devices connected to the I2C bus can act as either 'Master' or 'Slave’.
• The 'Master' device is responsible for controlling the communication by
initiating/terminating data transfer, sending data and generating necessary
synchronisation clock pulses.
• 'Slave' devices wait for the commands from the master and respond upon
receiving the commands.
• 'Master' and 'Slave' devices can act as either transmitter or receiver.
• Regardless whether a master is acting as transmitter or receiver, the
synchronisation clock signal is generated by the 'Master' device only.
• I2C supports multi masters on the same bus.
INTER INTEGRATED CIRCUIT (I2C) BUS (CONTINUED)
• The I2C bus interface is built around an input buffer and an open drain or
collector transistor.
• When the bus is in the idle state, the open drain/collector transistor will be in
the floating state and the output lines (SDA and SCL) switch to the 'High
Impedance' state.
• For proper operation of the bus, both the bus lines should be pulled to the
supply voltage (+5 V for TTL family and +3.3V for CMOS family devices) using
pull-up resistors.
• The typical value of resistors used in pull-up is 2.2K.
• With pull-up resistors, the output lines of the bus in the idle state will be 'HIGH'
• The address of a I2C device is assigned by hardwiring the address lines of the
device to the desired logic level.
• Done at the time of designing the embedded hardware.
INTER INTEGRATED CIRCUIT (I2C) BUS (CONTINUED)
4. The master device sends the Read or Write bit (Bit value = 1 Read operation; Bit
value = 0 Write operation) according to the requirement
5. The master device waits for the acknowledgement bit from the slave device whose
address is sent on the bus along with the Read/ Write operation command.
◦ Slave devices connected to the bus compares the address received with the address assigned
to them
6. The slave device with the address requested by the master device responds by
sending an acknowledge bit (Bit value 1) over the SDA line
7. Upon receiving the acknowledge bit, the Master device sends the 8 bit data to
the
slave device over SDA line, if the requested operation is 'Write to device’.
◦ If the requested operation is 'Read from device', the slave device sends data to the
master
over the SDA line
8. The master device waits for the acknowledgement bit from the device upon byte
transfer complete for a write operation and sends an acknowledge bit to the Slave
device for a read operation
9. The master device terminates the transfer by pulling the SDA line 'HIGH' when the
clock line SCL is at logic 'HIGH' (Indicating the 'STOP' condition)
INTER INTEGRATED CIRCUIT (I2C) BUS (CONTINUED)
• The GPRS communication divides the channel into 8 timeslots and transmits data over
the available channel.
• GPRS supports Internet Protocol (IP), Point to Point Protocol (PPP) and X.25
protocols for communication.
• GPRS is mainly used by mobile enabled embedded devices for data communication.
• The device should support the necessary GPRS hardware like GPRS modem and
GPRS
radio.
• To accomplish GPRS based communication, the carrier network also should have
support for GPRS communication.
Fig: Oscillator circuitry using quartz crystal and quartz crystal oscillator
REAL-TIME CLOCK (RTC)
• Real-Time Clock (RTC) is a system component responsible for keeping track of
time.
• RTC holds information like current time (In hours, minutes and seconds) in 12
hour/24 hour format, date, month, year, day of the week, etc. and supplies
timing reference to the system.
• RTC is intended to function even in the absence of power.
• RTCs are available in the form of Integrated Circuits from different
semiconductor manufacturers like Maxim/Dallas, ST Microelectronics etc.
• The RTC chip contains a microchip for holding the time and date related
information and backup battery cell for functioning in the absence of power, in
a single IC package.
• The RTC chip is interfaced to the processor or controller of the embedded
system.
REAL-TIME CLOCK (RTC) (CONTINUED)
• For Operating System based embedded devices, a timing reference is
essential for synchronising the operations of the OS kernel.
• The RTC can interrupt the OS kernel by asserting the interrupt line of the
processor/controller to which the RTC interrupt line is connected.
• The OS kernel identifies the interrupt in terms of the Interrupt Request
(IRQ) number generated by an interrupt controller.
• One IRQ can be assigned to the RTC interrupt and the kernel can perform
necessary operations like system date time updation, managing software
timers, etc. when an RTC timer tick interrupt occurs.
• The RTC can be configured to interrupt the processor at predefined
intervals or to interrupt the processor when the RTC register reaches a
specified value (used as alarm interrupt).
WATCHDOG TIMER
• A watchdog timer, or simply a watchdog, is a hardware timer for
monitoring the firmware execution and resetting the system
processor/microcontroller when the program execution hangs up.
• Depending on the internal implementation, the watchdog timer
increments or decrements a free running counter with each clock
pulse and generates a reset signal to reset the processor if the
count reaches zero for a down counting watchdog, or the highest
count value for an up counting watchdog.
WATCHDOG TIMER (CONTINUED)
• If the watchdog counter is in the enabled state, the firmware can
write a zero (for up counting watchdog implementation) to it before
starting the execution of a piece of code (which is susceptible to
execution hang up) and the watchdog will start counting.
• If the firmware execution doesn't complete due to malfunctioning,
within the time required by the watchdog to reach the maximum
count, the counter will generate a reset pulse and this will reset the
processor.
• If the firmware execution completes before the expiration of the
watchdog timer you can reset the count by writing a 0 (for an up
counting watchdog timer) to the watchdog timer register.
WATCHDOG TIMER (CONTINUED)
• Most of the processors implement watchdog as a built-in component and provides
status register to control the watchdog timer (like enabling and disabling watchdog
functioning) and watchdog timer register for writing the count value.
• If the processor/controller doesn't contain a built in watchdog timer, the same can
be
implemented using an external watchdog timer IC circuit.
• The external watchdog timer uses hardware logic for enabling/disabling, resetting the
watchdog count, etc. instead of the firmware based 'writing' to the status and
watchdog timer register.
• The Microprocessor supervisor IC DS1232 integrates a hardware watchdog timer in it.
• In modern systems running on embedded operating systems, the watchdog can be
implemented in such a way that when a watchdog timeout occurs, an interrupt is
generated instead of resetting the processor.
• The interrupt handler for this handles the situation in an appropriate fashion.
WATCHDOG TIMER (CONTINUED)
• Figure illustrates the implementation of an external watchdog timer based
microprocessor supervisor circuit for a small scale embedded system.