MVJ21CS42 Module 4
MVJ21CS42 Module 4
MVJ21CS42 Module 4
MVJ21CS42
Module:4
Approved by AICTE |Affiliated to VTU | Recognized by UGC with 2(f) & 12(B) status |Accredited by NBA and NAAC 1
What is an Embedded System?
• An embedded system is an electronic/electro-mechanical
system designed to perform a specific function and is a
combination of both hardware and firmware (software).
• Every embedded system is unique and the hardware as
well as the firmware is highly specialised to the application
domain.
• E.g. Electronic Toys, Mobile Handsets, Washing Machines,
Air Conditioners, Automotive Control Units, Set Top Box,
DVD Player etc…
Embedded Systems vs. General
Computing Systems
• The computing revolution began with the general purpose
computing requirements. Later it was realised that the
general computing requirements are not sufficient for the
embedded computing requirements.
• The embedded computing requirements demand
‘something special’ in terms of response to stimuli,
meeting the computational deadlines, power efficiency,
limited memory capability, etc.
General Purpose Computing System Embedded System
A system which is a combination of a generic hardware A system which is a combination of special purpose
and a General Purpose Operating System for executing a hardware and embedded OS for executing a specific set of
variety of applications applications
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 began to appear in 1963.
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
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 Complexity and
Performance
• Small-Scale Embedded Systems
• Medium-Scale Embedded Systems
• Large-Scale Embedded Systems
Classification Based on Complexity and
Performance (continued)
• Small-Scale Embedded Systems
• Simple in application needs and the performance requirements
are not time critical.
• E.g.: An electronic toy
• Usually built around low performance and low cost 8-bit or 16-bit
microprocessors/microcontrollers.
• May or may not contain an operating system for its functioning.
Classification Based on Complexity and
Performance (continued)
• Medium-Scale Embedded Systems
• Slightly complex in hardware and firmware (software)
requirements.
• Usually built around medium performance, low cost 16-bit or 32-
bit microprocessors/microcontrollers or digital signal processors.
• Usually contain an embedded operating system (either general
purpose or real time operating system) for functioning.
Classification Based on Complexity and
Performance (continued)
• Large-Scale Embedded Systems
• Highly complex in hardware and firmware (software) requirements.
• They are employed in mission critical applications demanding high
performance.
• Usually built around high performance 32-bit or 64-bit RISC
processors/controllers or Reconfigurable System on Chip (RSoC) or multi-
core processors and programmable logic devices.
• May contain multiple processors/controllers and co-units/hardware
accelerators for offloading the processing requirements from the main
processor of the system.
• Decoding/encoding of media, cryptographic function implementation, etc.
are examples of processing requirements which can be implemented using a
co-processor/hardware accelerator.
• Usually contain a high-performance real-time operating system (RTOS) for
task scheduling, prioritization and management.
Classification Based on Deterministic
Behaviour
• Applicable for ‘Real Time’ systems.
• The application/task execution behaviour can be either
deterministic or non-deterministic.
• Based on the execution behaviour, real time embedded systems are
classified into Hard Real Time and Soft Real Time systems.
Classification Based on
•Triggering
Embedded systems which are ‘Reactive’ in nature (like process
control systems in industrial control applications) can be classified
based on the trigger.
• Reactive systems can be either event-triggered or time-triggered.
Major Application Areas of Embedded
Systems
1. Consumer electronics: Camcorders, cameras, etc.
2. Household appliances: Television, DVD players, washing machine,
refrigerators, microwave oven, etc.
3. Home automation and security systems: Air conditioners,
sprinklers, intruder detection alarms, closed circuit television
(CCTV) cameras, fire alarms, etc.
4. Automotive industry: Anti-lock braking systems (ABS), engine
control, ignition systems, automatic navigation systems, etc.
5. Telecom: Cellular telephones, telephone switches, handset
multimedia applications, etc.
Major Application Areas of Embedded
Systems (continued)
6. Computer peripherals: Printers, scanners, fax machines, etc.
7. Computer networking systems: Network routers, switches, hubs,
firewalls, etc.
8. Healthcare: Different kinds of scanners, EEG, ECG machines, etc.
9. Measurements & Instrumentation: Digital multimeters, digital
CROs, logic analyzers, PLC systems, etc.
10. Banking & Retail: Automated teller machines (ATM) and currency
counters, point of sales (POS), etc.
11. Card readers: Barcode, smart card readers, handheld devices, etc.
Purpose of Embedded
•Systems
Each embedded system is designed to serve the purpose of any one
or a combination of the following tasks:
1. Data Collection/Storage/Representation
2. Data Communication
3. Data (Signal) Processing
4. Monitoring
5. Control
6. Application Specific User Interface
Purpose of Embedded Systems
(continued)
• 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- line
medium or by a wireless medium. Fig: A wireless network router for
• The data collecting embedded terminal itself can data communication
• Network hubs, routers, switches,
incorporate data communication units like wireless etc. are typical examples of
modules (Bluetooth, ZigBee, Wi-Fi, EDGE, GPRS, etc.) dedicated data transmission
embedded systems.
or wire-line modules (RS- 232C, USB, TCP/IP, PS2, • They act as mediators in data
etc.). communication and provide
various features like data security,
monitoring etc.
Purpose of Embedded Systems
(continued)
• Data (Signal) Processing
• The data (voice, image, video, electrical signals
and other measurable quantities) collected by
embedded systems may be used for various
kinds of data processing.
• Embedded systems with signal processing
functionalities are employed in applications
• A digital hearing aid is a typical
demanding signal processing like speech example of an embedded system
employing data processing.
coding, synthesis, audio video codec, • Digital hearing aid improves the
hearing capacity of hearing
transmission applications, etc. impaired persons.
Purpose of Embedded Systems
(continued)
• Monitoring
• Almost embedded products coming under the medical
domain are used for monitoring.
• A very good example is the electrocardiogram (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
monitoring heartbeat
• Some other examples of embedded systems with 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)
• Application Specific User Interface
• These are embedded systems with
application-specific user interfaces like
buttons, switches, keypad, lights, bells,
display
units, etc.
• Mobile phone is an example for this.
• In mobile phone the user interface is provided • A mobile phone is an example for
embedded system with an
through the keypad, graphic LCD module, application-specific user
interfaces.
system speaker, vibration alert, etc.
A Typical Embedded
System
A Typical Embedded
System
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.
R ISC vs. 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.
• In embedded application, the Relay unit acts as dynamic path selector for signals and
power.
• The Relay unit contains a relay coil made up of insulated wire on a metal core and a metal
armature with one or more contacts.
• Relay works on electromagnetic principle.
• When a voltage is applied to the relay coil, current flows through the coil,
which in turn generates a magnetic field.
• The magnetic field attracts the armature core and moves the contact point.
• The movement of the contact point changes the power/signal flow path.
Relay
•(continued)
Relays are available in different configurations.
• Figure given below illustrates the widely used relay configurations
for embedded applications.
• The concept of I2C bus was developed by Philips Semiconductors in the early 1980s.
• The original intention of I2C was to provide an easy way of connection between a
microprocessor/microcontroller system and the peripheral chips in television sets.
• The I2C bus comprise of two bus lines:
• Serial Clock (SCL line) – responsible for generating synchronisation clock pulses
• Serial Data (SDA line) – responsible for transmitting the serial data across devices
Inter Integrated Circuit (I2C) Bus
(continued)
• 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 following bus interface diagram illustrates the connection of
master and slave devices on the I2C bus.
• In addition to the serial data transmission function, UART provides hardware handshaking
signal support for controlling the serial data flow.
• UART chips are available from different semiconductor manufacturers.
• National Semiconductor's 8250 UART chip is considered as the standard setting UART.
It was used in the original IBM PC.
• Nowadays most of the microprocessors/controllers are available with integrated UART
functionality and they provide built-in instruction support for serial data transmission and
reception.
1-Wire
•Interface
1-wire interface is an asynchronous half-duplex communication protocol
developed by Maxim Dallas Semiconductor.
• It is also known as Dallas 1-Wire protocol.
• It makes use of only a single signal line (wire) called DQ for
communication and follows the master-slave communication model.
• One of the key feature of 1-wire bus is that it allows power to be sent
along the signal wire as well.
• The slave devices incorporate internal capacitor (typically of the order of
800 pF) to power the device from the signal line.
• The 1-wire interface supports a single master and one or more slave
devices on the bus.
1-Wire Interface
•(continued)
The bus interface diagram shown in the figure illustrates the
connection of master and slave devices on the 1-wire bus.
• The device normally contains a device select line and the device becomes active only when
this line is asserted by the host processor.
• The direction of data transfer (Host to Device or Device to Host) can be controlled through the control
signal lines for 'Read' and 'Write'.
• Only the host processor has control over the 'Read' and 'Write' control signals.
Parallel Interface
•(continued)
The device is normally memory mapped to the host processor and
a range of address is assigned to it.
• An address decoder circuit is used for generating the chip select
signal for the device.
• When the address selected by the processor is within the range
assigned for the device, the decoder circuit activates the chip select
line and thereby the device becomes active.
• The processor then can read or write from or to the device by
asserting the corresponding control line (RD\ and WR\
respectively).
Parallel Interface
•(continued)
The bus interface diagram shown in the figure illustrates the
interfacing of devices through parallel interface.
• ZigBee is targeted for low power, low data rate and secure applications for Wireless Personal
Area Networking (WPAN).
• The ZigBee specifications support a robust mesh network containing multiple nodes.
• This networking strategy makes the network reliable by permitting messages to travel through
a number of different paths to get from one node to another.
• ZigBee operates worldwide at the unlicensed bands of Radio spectrum, mainly at 2.400 to
2.484 GHz, 902 to 928 MHz and 868.0 to 868.6 MHz.
• ZigBee supports an operating distance of up to 100 metres and a data rate of 20 to 250 Kbps.
ZigBee
(continued)
• In the ZigBee terminology, each ZigBee device falls under any one of the
following ZigBee device category:
• ZigBee Coordinator (ZC)/Network Coordinator
• The ZigBee coordinator acts as the root of the ZigBee network.
• The ZC is responsible for initiating the ZigBee network and it has the capability to
store information about the network.
• ZigBee Router (ZR)/Full function Device (FFD)
• Responsible for passing information from device to another device or to another
ZR.
• ZigBee End Device (ZED)/Reduced Function Device (RFD):
• End device containing ZigBee functionality for data communication.
• It can talk only with a ZR or ZC and doesn't have the capability to act as a
mediator
for transferring data from one device to another.
ZigBee
•(continued)
The diagram shown in figure gives an overview of ZC, ZED and ZR in
a ZigBee network.
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)
• Figure illustrates the implementation of an external watchdog timer based
microprocessor supervisor circuit for a small scale embedded system.