Embedded System Hardware Design Overview
Embedded System Hardware Design Overview
UNIT – II
Embedded System Core: General Purpose and Domain Specific Processors, Application Specific
Integrated Circuits (ASICs), Programmable Logic Devices (PLDs), Commercial off-the-shelf Components
(COTS)
Memory: Overview on Various Types of memory sub systems used in Embedded systems and their selection
Sensors and Actuators: interfacing of LEDs, 7-segment LED Displays, Piezo Buzzer, Stepper Motor,
Relays, Optocouplers, Matrix keyboard, Push button switches, Programmable Peripheral Interface Device
(e.g. 8255 PPI), etc. with the I/O subsystem of the embedded system
v Elements of an embedded system 4
v Elements of an embedded system 5
v Core of the Embedded System 6
The core of the embedded system falls into any one of the following categories:
Ø 1.1 Microprocessors
Microprocessor
Ø 1.2 Microcontrollers
ATMEGA328P
microcontroller
Ø 1.3 Digital Signal Processors
Depending on the input, some processing for microcontroller needs to be done and output is
defined. However, the relationship between input and output for microprocessor is not defined.
Since the applications of microcontroller are very specific, they need small resources like RAM,
ROM, I/O ports etc. and hence can be embedded on a single chip. Microprocessors need high
amount of resources like RAM, ROM, I/O ports etc.
The clock speed of Microprocessor is quite high as compared to the microcontroller. Whereas the
microcontrollers operate from a few MHz from (30 to 50 MHz), today's microprocessor operate
above 1 GHz as they perform complex tasks.
v Microprocessor Vs Microcontroller 9
Microprocessor Microcontroller
Microprocessor Microcontroller
Due to external components, the entire power Since external components are low, total power
consumption is high. Hence it is not suitable to consumption is less and can be used with devices
used with devices running on stored power like running on stored power like batteries.
batteries.
Most of the microprocessors do not have power Most of the microcontrollers have power saving
saving features. modes like idle mode and power saving mode. This
helps to reduce power consumption even further.
Since memory and I/O components are all external, Since components are internal, most of the
each instruction will need external operation, hence operations are internal instruction, hence speed is
it is relatively slower. fast.
Microprocessor have less number of registers, Micro controller have more number of registers,
hence more operations are memory based. hence the programs are easier to write.
Microprocessors based on Von Neumann Microcontrollers are based on Harvard
architecture where program and data are stored in architecture where program memory and Data
same memory module. memory are separate.
Mainly used in Personal Computers Used mainly in washing machines, MP3 players
v Digital Signal Processors (DSPs) 12
DSPs are 2 to 3 times faster than the general purpose microprocessors in signal
processing applications.
Application areas:
§ Audio video signal processing
§ Telecommunication
§ Multimedia applications
RISC CISC
RISC stands for Reduced Instruction Set CISC stands for Complex Instruction Set
Computing Computing
Lesser number of instructions Greater number of instructions
Instruction pipelining and increased execution Generally no instruction pipelining feature
speed
Orthogonal instruction set (Allows each instruction to operate Non-orthogonal instruction set (All instructions are not
on any register and use any addressing mode) allowed to operate on any register and use any addressing
mode. It is instruction-specific)
Operations are performed on registers only, the only Operations are performed on registers or memory
memory operations are load and store depending on the instruction
A large number of registers are available Limited number of general purpose registers
Programmer needs to write more code to execute a Instructions are like macros in C language. A
task since the instructions are simpler ones. programmer can achieve the desired functionality with
a single instruction which in turn provides the effect of
using more simpler single instructions in RISC
RISC Vs CISC processors/controllers (cont.) 15
RISC CISC
Single, fixed length instructions Variable length instructions
Less silicon usage and pin count More silicon usage since more additional decoder
logic is required to implement the complex
instruction decoding
Since data memory and program memory are Since data memory and program memory are
stored physically in different locations, no stored physically in the same chip, chances for
chances for accidental corruption of program accidental corruption of program memory
memory
Big-Endian vs. Little-Endian Processors/Controllers 17
Endianness specifies the order in which a sequence of bytes are stored in computer memory.
There are two ways of ordering the data while storing it into the memory.
§ Little-endian
§ Big-endian
Little-endian is an order in which the “ little end “,/ the lower-order byte of the data (least
significant value in the sequence) is stored in memory at the lowest address. (The little end
comes first.)
Big-endian is an order in which the “ Big end ”,/ the higher-order byte of the data (most
significant value in the sequence) is stored in memory at the lowest address. (The big end
comes first.)
Big-Endian vs. Little-Endian Processors/Controllers 18
v Load Store Operation 19
The memory access related operations are performed by the special instructions load and store.
If the operand is specified as memory location, the content of it is loaded to a register using the load
instruction. The instruction store stores data from a specified register to a specified memory location.
Load
Memory
Store
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.
It integrates several functions into a single chip and there by reduces the
system development cost.
Most of the ASICs are proprietary (which having some trade name) products,
it is referred as Application Specific Standard Products (ASSP). Example: ASIC interface
with ECG sensor to monitor
health
ASIC consumes a very small area in the total system. Thereby helps in
the design of smaller systems with high capabilities and functionalities.
The developers of such chip may not be interested in revealing the internal
details of it.
3. Programmable Logic Devices (PLDs) 21
Fixed logic device are permanent, they perform one function or set of functions once
manufactured, they cannot be changed.
Programmable Logic Devices (PLDs) offer customers a wide range of logic capacity, features,
speed, and voltage characteristics and these devices can be re-configured to perform any
number of functions at any time.
3. Programmable Logic Devices (cont.) 22
Ø PLDs offer customers much more flexibility during the design cycle.
Ø PLDs do not require long lead times for prototypes or production parts.
Ø Because PLDs are already on a distributor’s shelf and ready for shipment.
Advantages of COTS
§ Ready to use
§ Easy to integrate
§ Reduces development time
Disadvantages of COTS
§ No operational or manufacturing standard (all proprietary)
§ Vendor or manufacturer may discontinue production of a particular COTS product
v Elements of an embedded system 26
MEMORY 27
Limitations:
MROM is permanent in bit storage, hence not possible to alter bit information.
Cannot modify device firmware against firmware updates.
Programmable Read Only Memory (PROM) 30
Limitations:
Cannot be reprogrammed
Not useful for development purposes as the code is subjected to
continuous change (not economical to load code each time using OTP)
Erasable Programmable Read Only Memory (EPROM) 31
Limitation:
Tedious and time-consuming process
Electrically Erasable PROM (EEPROM) 32
Limitation:
Capacity is limited (few kilobytes)
Flash Memory 33
SRAM DRAM
Made of 6 MOSFETs Made of a MOSFET and a Capacitor
Fast in operation. Typical access time is Slow in operation. Typical access time is
10ns 60ns.
More expensive Less expensive
Non-volatile RAM (NVRAM) 38
It contains static RAM based memory and a minute battery for providing supply to the memory in the
absence of external power supply.
NVRAM is used for the nonvolatile storage of results of operations or for setting up of flags, etc.
Memory requirement is dependent on the type of ES and application for which it is designed
Electronic Toy Design
Identify the system requirement (complexity is less, the data memory requirement is minimal)
Microcontroller with few bytes of internal RAM, few bytes or kilobytes of FLASH memory, few bytes of
EEPROM (if required)
1) Memory size:
Memory density expressed in terms of the number of memory bytes per chip
Memory chips come in standard sizes like 512bytes, 1024bytes (1 kilobyte), 2048bytes (2 kilobytes),
4Kb, 8Kb, 16Kb, 32Kb, 64Kb, 128Kb, 256Kb, 512Kb, 1024Kb (1 megabytes), etc.
Consider the address range supported by your processor
For a processor/controller with a 16-bit address bus, the maximum number of memory locations that
can be addressed is 2^(16) = 65536 bytes = 64Kb.
2) Word size:
The word size refers to the number of memory bits that can be read/write together at a time.
4, 8, 12, 16, 24, 32, etc. are the word sizes supported by memory chips.
Ensure that the word size supported by the memory chip matches with the data bus width of the
processor/controller.
41
42
Sensors and Actuators: interfacing of LEDs, 7-segment LED Displays, Piezo Buzzer,
Stepper Motor, Relays, Optocouplers, Matrix keyboard, Push button switches,
Programmable Peripheral Interface Device (e.g. 8255 PPI), etc. with the I/O subsystem of
the embedded system
v Sensors and Actuators 43
Sensors :
§ A sensor is a transducer device that converts energy from one form to another
for any measurement or control purpose.
§ Example : we can identify that the sensor which counts steps for pedometer
functionality is an Accelerometer sensor and the sensor used in some of the
smartwatch devices to measure the light intensity is an Ambient Light Sensor (ALS)
v Sensors and Actuators 44
Actuators:
§ Actuator is a form of transducer device (mechanical or electrical) which converts
signals to corresponding physical action (motion).
§ Actuator acts as an output device.
§ Example: smartwatches use Ambient Light Sensor to detect the surrounding light
intensity and uses an electrical/electronic actuator circuit to adjust the screen
brightness for better readability.
v The I/O Subsystem 45
The I/O subsystem of the embedded system facilitates the interaction of the embedded
system with the external world.
The interaction happens through the sensors and actuators connected to the input and
output ports respectively of the embedded system.
The sensors may not be directly interfaced to the input ports, instead they may be
interfaced through signal conditioning and translating systems like ADC, optocouplers,
etc.
v The I/O Subsystem (cont.) 46
Current Sink:
The cathode of the LED is connected to the port pin
The LED is turned on when the port pin is at logic Low (Logic ‘0’)
v 7-Segment LED Display 49
The 7-segment LED display is an output device for displaying alpha numeric characters.
It contains 8 light-emitting diode (LED) segments arranged in a special form.
Out of the 8 LED segments, 7 are used for displaying alpha numeric characters and 1 is used
for representing ‘decimal point’ in decimal number display.
The LED segments are named A to G and the decimal point LED segment is named as DP.
v 7-Segment LED Display 50
The 7-segment LED displays are available in two different configurations, namely; Common
Anode and Common Cathode.
In the common anode configuration, the anodes of the 8 segments are connected commonly whereas
in the common cathode configuration, the 8 LED segments share a common cathode line.
The LED segment’s anode or cathode is connected to the port of the processor/controller in the order
‘A’ segment to the least significant port pin and DP segment to the most significant port pin.
7-segment LED display is a popular choice for low cost embedded applications like, Public telephone
call monitoring devices, point of sale terminals, etc.
[Link]
v Stepper Motor 52
(1) Unipolar:
§ A unipolar stepper motor contains two windings per phase.
§ The direction of rotation (clockwise or anticlockwise) of a 2-Phase unipolar stepper motor
stepper motor is controlled by changing the direction of
current flow.
§ Current in one direction flows through one coil and in the
opposite direction flows through the other coil.
§ It is easy to shift the direction of rotation by just switching the
terminals to which the coils are connected.
v Stepper Motor (Cont.) 54
(2) Bipolar:
§ A bipolar stepper motor contains single winding per phase.
§ For reversing the motor rotation the current flow through the windings is reversed
dynamically.
§ It requires complex circuitry for current flow reversal.
v Stepper Motor (Cont.) 55
The stator winding details for a two phase unipolar stepper motor is shown in Fig. below.
The stepping of stepper motor can be implemented in different ways by changing the sequence
of activation of the stator windings. The different stepping modes supported by stepper motor are
explained below.
Full Step In the full step mode both the phases are energized simultaneously. The coils A, B,
C and D are energized in the following order:
v Stepper Motor (Cont.) 57
Wave Step:
In the wave step mode only one phase is energized at a time and each coils of the phase
is energized alternatively. The coils A, B, C, and D are energized in the following order.
v Stepper Motor (Cont.) 58
Half Step
It uses the combination of wave and full step. It has the highest torque and
stability. The coil energizing sequence for half step is given below.
v Stepper Motor (Cont.) 59
The rotation of the stepper motor can be reversed by reversing the order in which the coil is
energized.
Two-phase unipolar stepper motors are the popular choice for embedded applications.
The current requirement for stepper motor is little high and hence the port pins of a
microcontroller/processor may not be able to drive them directly.
Also the supply voltage required to operate stepper motor varies normally in the range 5V to
24 V.
Depending on the current and voltage requirements, special driving circuits are required
to interface the stepper motor with microcontroller/processors.
v Stepper Motor (Cont.) 60
Ø The following circuit diagram illustrates the interfacing of a stepper motor through a driver
circuit connected to the port pins of a microcontroller/processor.
Optocoupler
In electronic circuits, an optocoupler is used for suppressing interference in data communication, circuit
isolation, high voltage separation, simultaneous separation and signal intensification, etc.
Optocouplers can be used in either input circuits or in output circuits. Figure below illustrates the usage
of optocoupler in input circuit and output circuit of an embedded system with a microcontroller as the
system core.
Fig.: Relay
Ø The Single Pole Single Throw configuration has only one pathconfigurations
for information flow. The path is
either open or closed in normal condition.
Ø For normally Open Single Pole Single Throw relay, the circuit is normally open and it becomes
closed when the relay is energized.
Ø For normally closed Single Pole Single Throw configuration, the circuit is normally closed and it
becomes open when the relay is energized.
Ø For Single Pole Double Throw Relay, there are two paths for information flow and they are
selected by energising or de-energising the relay.
v Relay (Cont.) 64
Ø The Relay is normally controlled using a relay driver circuit connected to the port pin of
the processor/controller.
Ø A transistor is used for building the relay driver circuit.
Piezo buzzer is a piezoelectric device for generating audio indications in embedded application.
A piezoelectric buzzer contains a piezoelectric diaphragm which produces audible sound in
response to the voltage applied to it.
Piezoelectric buzzers are available in two types. ‘Self-driving’ and ‘External driving’.
The ‘Self-driving’ circuit contains all the necessary components to generate sound at a predefined
tone. It will generate a tone on applying the voltage.
External driving piezo buzzers supports the generation of different tones. The tone can be varied
by applying a variable pulse train to the piezoelectric buzzer.
v Push Button Switch 66
It is an input device. Push button switch comes in two configurations, namely ‘Push to Make’ and
‘Push to Break’.
In the ‘Push to Make’ configuration, the switch is normally in the open state and it makes a circuit
contact when it is pushed or pressed.
In the ‘Push to Break’ configuration, the switch is normally in the closed state and it breaks the circuit
contact when it is pushed or pressed.
In embedded application push button is generally used as reset and start Switch.
v Keyboard 67