Module 1- ESD Notes
Module 1- ESD Notes
Module-1
2
Embedded System Design Module-1
Large-scale:
➢ Highly complex hardware & firmware.
➢ Built around 32 or 64 bit RISC µp/µc or PLDs or Multicore-Processors.
➢ Response is time-critic
3.Based on deterministic behaviour
This classification is applicable for “Real Time” systems.
➢ The task execution behaviour for an embedded system may
be deterministic or non- deterministic.
➢ Based on execution behaviour Real Time embedded
systems are divided into Hard and Soft.
4.Based on triggering
Embedded systems which are “Reactive” in nature can be classify
based on triggering. Reactive systems can be:
➢ Event triggered
➢ Time triggered
6
Embedded System Design Module-1
The control is achieved by processing the information coming from the sensors and
user interfaces and controlling some actuators that regulate the physical variable.
Keyboards, push button, switches, etc. are Examples of common user interface input
devices and LEDs, LCDs, Piezoelectric buzzers, etc examples for common user
interface output devices for a typical embedded system. The requirement of type of
user interface changes from application to application based on domain.
Some embedded systems do not require any manual intervention for their operation.
They automatically sense the input parameters from real world through sensors
which are connected at input port. The sensor information is passed to the processor
after signal conditioning and digitization. The core of the system performs some
predefined operations on input data with the help of embedded firmware in the
system and sends some actuating signals to the actuator connect connected to the
7
Embedded System Design Module-1
8
Embedded System Design Module-1
9
Embedded System Design Module-1
Microcontroller:
➢ A highly integrated silicon chip containing a CPU, scratch pad RAM, Special
and General- purpose Register Arrays, On Chip ROM/FLASH memory for
program storage, Timer and Interrupt control units and dedicated I/O ports
➢ Microcontrollers can be considered as a super set of Microprocessors
➢ Microcontroller can be general purpose (like Intel 8051, designed for generic
applications and domains) or application specific (Like Automotive AVR
from Atmel Corporation. Designed specifically for automotive applications)
➢ Since a microcontroller contains all the necessary functional blocks for
independent working, they found greater place in the embedded domain in
place of microprocessors
➢ Microcontrollers are cheap, cost effective and are readily available in the
market
➢ Texas Instruments TMS 1000 is considered as the world’s first microcontroller
Microprocessor Vs Microcontroller
10
Embedded System Design Module-1
applications.
➢ This is because of the architectural difference between DSP and general-
p u r p o s e microprocessors.
➢ DSPs implement algorithms in hardware which speeds up the execution
whereas general purpose processor implement the algorithm in software and
the speed of execution depends primarily on the clock for the processors.
➢ DSP includes following key units:
i. Program memory: It is a memory for storing the program required by DSP
to process the data.
ii. Data memory: It is a working memory for storing temporary variables and
data/signal to be processed.
iii. Computational engine: It performs the signal processing in accordance
with the stored program memory computational engine incorporated many
specialized arithmetic units and each of them operates simultaneously to
increase the execution speed. It also includes multiple hardware shifting
operands and saves execution time.
iv. I/O unit: It acts as an interface between the outside world and DSP. It is
responsible for capturing signals to be processed and delivering the
processed signals.
Examples: Audio video signal processing, telecommunication and multimedia
applications. SOP(Sum of Products) calculation, convolution, FFT(Fast Fourier
Transform), DFT(Discrete Fourier Transform), etc are some of the operation
performed by DSP.
RISC Vs CISC Processors/Controllers
11
Embedded System Design Module-1
Program
Memory
12
Embedded System Design Module-1
13
Embedded System Design Module-1
14
Embedded System Design Module-1
15
Embedded System Design Module-1
CPLDs:
➢ CPLDs, by contrast, offer much smaller amounts of logic - up to about
10,000 gates
16
Embedded System Design Module-1
➢ CPLDs offer very predictable timing characteristics and are therefore ideal for
critical control applications
➢ CPLDs such as the Xilinx Cool Runner series also require extremely low
amounts of power and are very inexpensive, making them ideal for cost-
sensitive, battery- operated, portable applications such as mobile phones and
digital handheld assistants
Commercial off the Shelf Component (COTS)
➢ A Commercial off-the-shelf (COTS) product is one which is used ‘as-is’.
➢ COTS products are designed in such a way to provide easy integration and
interoperability with existing system components
➢ Typical examples for the COTS hardware unit are Remote Controlled Toy Car
control unit including the RF Circuitry part, High performance, high
frequency microwave electronics (2 to 200 GHz), High bandwidth analog-to-
digital converters, Devices and components for operation at very high
temperatures, Electro-optic IR imaging arrays, UV/IR Detectors etc.
➢ A COTS component in turn contains a GPP / ASIP / ASIC / ASSP / PLD
➢ Advantages: Readily available in the market, cheap and cuts down
development time
1.9 Memory
Memory is an important part of an embedded system. The memory used in embedded
system can be either
1. Program Storage Memory (ROM)
2. Data memory (RAM)
Certain Embedded processors/controllers contain built in program memory and
data memory and this memory is known as on-chip memory
Program Storage Memory
➢ Stores the program instructions (CODE)
➢ Retains its contents even after the power to it is turned off. It is
generally known as Nonvolatile storage memory
➢ Depending on the fabrication, erasing and programming techniques they are
classified into
17
Embedded System Design Module-1
19
Embedded System Design Module-1
20
Embedded System Design Module-1
+
-
21
Embedded System Design Module-1
22
Embedded System Design Module-1
23
Embedded System Design Module-1
Figure 1.15: LED Interfacing
There are two ways to interface an LED to a microprocessor/microcontroller:
➢ The Anode of LED is connected to the port pin and cathode to Ground : In
this approach the port pin sources the current to the LED when it is at logic
high(ie. 1).
➢ The Cathode of LED is connected to the port pin and Anode to Vcc : In this
approach the port pin sources the current to the LED when it is at logic high
(ie. 1). Here the port pin sinks the current and the LED is turned ON when the
port pin is at Logic low (ie. 0)
24
Embedded System Design Module-1
➢ Based on the configuration of the 7 – segment LED unit, the LED segment
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.
➢ The current flow through each of the LED segments should be limited to the
maximum value supported by the LED display unit
Figure 1.17: Common anode and cathode configuration of a 7-segment LED Display
Optocoupler
➢ Optocoupler is a solid-state device to isolate two parts of a circuit.
➢ Optocoupler combines an LED and a photo-transistor in a single housing
(package)
➢ In electronic circuits, optocoupler is used for suppressing interference in data
communication, circuit isolation, High voltage separation, simultaneous
separation and intensification signal etc.
Vcc
26
Embedded System Design Module-1
Figure 1.20: stator winding details for 2-phase unipolar stepper motor
Port A
Pins M
Driver IC C
Microcontrolle
r ULN2803 B D
Vcc
GND Vcc
Relay
➢ An electro mechanical device which acts as dynamic path selectors 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.
The Relay is normally controlled using a relay driver circuit connected to the port pin of
the processor/controller
Vcc
Load
Pin
30
Embedded System Design Module-1
Figure 1.24: Matrix keyboard Interfacing
Programmable Peripheral Interface (PPI)
➢ PPI devices are used for extending the I/O capabilities of processors
/controllers 8255A is a popular PPI device for 8 bit processors/controllers
➢ 8255A supports 24 I/O pins and these I/O pins can be grouped as either
(i) Three 8-bit parallel ports (Port A, Port B and Port C) or
(ii) Two 8 bit parallel ports (Port A and Port B) with Port C in any one
of the following configurations
▪ As 8 individual I/O pins
▪ Two 4bit Ports namely Port CUPPER (CU) and Port CLOWER (CL)
➢ The Configuration of ports is done through the Control Register of 8255A
31
Embedded System Design Module-1
Processor/ 82C55
Controller Data Bus D0….D7 A
Data Bus D0….D7
Port Pins 34 to 27
Latch
(Eg: A0 Pin 9 PA0….PA7
74LS373) A1 Pin 8 Port A
ALE
A2….A7 PB0….PB7
Port B
Higher
Order Address Address
Address CS\ Pin 6
Bus decoder PC0….PC7
(A8….A15) Port C
RD RD\ Pin 5
\ WR\ Pin 36
WR RESET Pin 35
\
Figure1.25: Interfacing of 8255 with Microprocessor
32
Embedded System Design Module-1
The following bus interface diagram illustrates the connection of master and slave
devices on the I2C bus
33
Embedded System Design Module-1
34
Embedded System Design Module-1
only one master device is active at any given point of time, is satisfied.
➢ SPI requires four signal lines for communication.
▪ Master Out Slave In (MOSI): Signal line carrying the data from
master to slave device. It is also known as Slave Input/Slave Data
In (SI/SDI)
▪ Master In Slave Out (MISO): Signal line carrying the data from
slave to master device. It is also known as Slave Output (SO/SDO)
▪ Serial Clock (SCLK) :Signal line carrying the clock signals
▪ Slave Select (SS/) : Signal line for slave device select.
It is an active low signal
➢ The bus interface diagram shown in the figure illustrates the connection
of master and slave devices on the SPI bus.
of 8.
➢ During transmission from the master to slave, the data in the master’s shift
register is shifted out to the MOSI pin and it enters the shift register of the
slave device through the MOSI pin of the slave device. At the same time
the shifted out data bit from the slave device’s shift register enters the shift
register of the master device through MISO pin
36
Embedded System Design Module-1
first received bit as the LSB and last received data bit as MSB.
➢ For proper communication, the 'Transmit line' of the sending device
should be connected to the 'Receive line' of the receiving device.
➢ In addition to the serial data transmission function, UART provides
hardware handshaking signal support for controlling the serial data flow.
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.
➢ The bus interface diagram shown in the figure illustrates the connection of
master and slave devices on the 1-wire bus.
37
Embedded System Design Module-1
38
Embedded System Design Module-1
Parallel Interface
39
Embedded System Design Module-1
➢ 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).
➢ The bus interface diagram shown in the figure illustrates the interfacing of
devices through parallel interface.
40
Embedded System Design Module-1
41
Embedded System Design Module-1
➢ The pin details for the two connectors are explained in the following table:
42
Embedded System Design Module-1
➢ Universal Serial Bus (USB) is a wired high speed serial bus for data
communication. The first version of USB (USB 1.0) was released in 1995.
➢ The USB communication system follows a star topology with a USB host at
the centre and one or more USB peripheral devices/USB hosts connected to it.
➢ A USB host can support connections up to 127, including slave peripheral
devices and other USB hosts.
Figure illustrates the star topology for USB device connection.
43
Embedded System Design Module-1
44
Embedded System Design Module-1
➢ The table given below illustrates the pin details for 4, 6 and 9 pin
connectors.
46
Embedded System Design Module-1
➢ There are two differential data transfer lines A and B per connector.
➢ In a 1394 cable, normally the differential lines of A are connected to B
(TPA+ to TPB+ and TPA– to TPB– ) and vice versa.
➢ 1394 is a popular communication interface for connecting embedded
devices like Digital Camera, Camcorder, Scanners to desktop computers
for data transfer and storage.
➢ IEEE 1394 doesn't require a host for communicating between devices. For
example, you can directly connect a scanner with a printer for printing.
Infrared (IrDA)
➢ Infrared (IrDA) is a serial, half duplex, line of sight based wireless
technology for data communication between devices.
➢ It is in use from the olden days of communication and you may be very
familiar with it. E.g.: The remote control of TV, VCD player, etc. works
on Infrared.
➢ Infrared communication technique uses infrared waves of the
electromagnetic spectrum for transmitting the data.
➢ It supports point-point and point-to-multipoint communication,
provided all devices involved in the communication are within the line of
sight.
➢ The typical communication range for IrDA lies in the range 10 cm to 1 m.
The range can be increased by increasing the transmitting power of the IR
device.
➢ IR supports data rates ranging from 9600bits/second to 16Mbps.
➢ Depending on the speed of data transmission IR is classified into:
• Serial IR (SIR) – supports data rates ranging from 9600bps to
115.2kbps.
• Medium IR (MIR) – supports data rates of 0.576Mbps and
1.152Mbps.
• Fast IR (FIR) – supports data rates up to 4Mbps.
• Very Fast IR (VFIR) – supports high data rates up to 16Mbps.
• Ultra Fast IR (UFIR) – targeted to support a data rate up to
100Mbps.
➢ IrDA communication involves a transmitter unit for transmitting the data
over IR and a receiver for receiving the data.
47
Embedded System Design Module-1
➢ Infrared Light Emitting Diode (LED) is the IR source for transmitter and at
the receiving end a photodiode acts as the receiver.
➢ Both transmitter and receiver unit will be present in each device supporting
IrDA communication for bidirectional data transfer. Such IR units are
known as 'Transceiver’.
➢ Certain devices like a TV remote control always require unidirectional
communication and so they contain either the transmitter or receiver unit.
The remote control unit contains the transmitter unit and TV contains the
receiver unit.
➢ Infrared Data Association (IrDA) is the regulatory body responsible for
defining and licensing the specifications for IR data communication.
➢ IR communication has two essential parts: a physical link part and a
protocol part.
➢ The physical link is responsible for the physical transmission of data
between devices supporting IR communication. Protocol part is
responsible for defining the rules of communication.
➢ The physical link works on the wireless principle making use of Infrared
for communication.
➢ IrDA is a popular interface for file exchange and data transfer in low cost
devices.
➢ IrDA was the prominent communication channel in mobile phones before
Bluetooth's existence.
Bluetooth (BT)
➢ Bluetooth is a low cost, low power, short range wireless technology for
data and voice communication.
➢ Bluetooth was first proposed by Ericsson in 1994.
➢ Bluetooth operates at 2.4GHz of the Radio Frequency spectrum and
uses the Frequency Hopping Spread Spectrum (FHSS) technique for
communication.
➢ It supports a data rate of up to 1Mbps and a range of approximately 30
feet for data communication.
➢ Bluetooth communication has two essential parts – a physical link part and a
protocol part.
➢ The physical link is responsible for the physical transmission of data
48
Embedded System Design Module-1
Wi-Fi
➢ Wi-Fi or Wireless Fidelity is the popular wireless communication
technique for networked communication of devices.
➢ Wi-Fi follows the IEEE 802.11 standard.
➢ Wi-Fi is intended for network communication and it supports Internet
49
Embedded System Design Module-1
➢ For communicating with devices over a Wi-Fi network, the device when
its Wi-Fi radio is turned ON, searches the available Wi-Fi network in its
vicinity and lists out the Service Set Identifier (SSID) of the available
networks.
➢ If the network is security enabled, a password may be required to connect
to a particular SSID.
➢ Wi-Fi employs different security mechanisms like Wired Equivalency
Privacy (WEP), Wireless Protected Access (WPA), etc. for securing the
50
Embedded System Design Module-1
data communication.
➢ Wi-Fi supports data rates ranging from 1 Mbps to 1.73 Gbps depending on
the standards (802.11a/b/g/n) and access/modulation method.
➢ Depending on the type of antenna and usage location (indoor/outdoor),Wi-
Fi offers a range of 100 to 300 feet.
ZigBee
➢ ZigBee is targeted for low power, low cost, 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 meters and a data rate
of 20 to 250Kbps
➢ ZigBee is primarily targeting application areas like Home & Industrial
Automation, Energy Management, Home control/security, Medical/Patient
tracking, Logistics & Asset tracking and sensor networks & active RFID
➢ 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.
51
Embedded System Design Module-1
Access (HSDPA), Long Term Evolution (LTE), etc. which offers higher
bandwidths for communication.
53
Embedded System Design Module-1
54
Embedded System Design Module-1
55
Embedded System Design Module-1
56
Embedded System Design Module-1
Oscillator Unit
➢ A microprocessor/microcontroller is a digital device made up of digital
combinational and sequential circuits.
➢ The instruction execution of a microprocessor/controller occurs in sync
with a clock signal.
➢ The oscillator unit of the embedded system is responsible for generating
the precise clock for the processor. Analogous to the heart in living beings
which produces heart beats.
➢ Certain processors/controllers integrate a built-in oscillator unit and simply
require an external ceramic resonator/quartz crystal for producing the
necessary clock signals.
➢ Quartz crystals and ceramic resonators are equivalent in operation;
however, they possess physical difference.
➢ A quartz crystal is normally mounted in a hermetically sealed metal case
with two leads protruding out of the case.
➢ Certain devices may not contain a built-in oscillator unit and require the
clock pulses to be generated and supplied externally. Quartz crystal
Oscillators are available in the form of chips and they can be used for
generating the clock pulses in such cases.
➢ The speed of operation of a processor is primarily dependent on the clock
frequency. However, we cannot increase the clock frequency blindly for
increasing the speed of execution. The logical circuits lying inside the
processor always have an upper threshold value for the maximum clock at
which the system can run, beyond which the system becomes unstable and
non functional.
57
Embedded System Design Module-1
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.
➢ 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.
➢ 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,
59
Embedded System Design Module-1
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.
➢ Figure illustrates the implementation of an external watchdog timer
based microprocessor supervisor circuit for a small scale embedded
system.
1. The master device sends the address (7 bit or 10 bit wide) of the
'slave' device to which it wants to communicate, over the SDA line.
▪ Clock pulses are generated at the SCL line for
synchronizing the bit reception by the slave
device.
▪ The MSB of the data is always transmitted first.
▪ The data in the bus is valid during the 'HIGH' period of the
clock signal
2. The master device sends the Read or Write bit (Bit value = 1 Read
operation; Bit value = 0 Write operation) according to the
requirement
3. 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
4. The slave device with the address requested by the master device
60
Embedded System Design Module-1
61
Embedded System Design Module-1
Question Bank
1. Explain the various purposes of Embedded system in detail
2. Explain the role of different types of memories used in embedded system
3. Explain little endian and big-endian architecture
4. With a neat interface diagram, illustrate the connection of master and slave
devices on I2C bus
5. With a neat diagram, explain the interfacing of stepper motor through the driver
circuit to microcontroller
6. Explain the classification of embedded systems based on generation and based on
the complexity and performance requirement
7. Differentiate between RISC and CISC processor/controller
8. Differentiate between microprocessor and microcontroller
9. Explain the concept of 7-segment LED display
10. List major applications areas of embedded system. Mention at least two examples
for embedded devices in each area
11. What is relay? Explain transistor-based relay driving circuit with diagram
12. Explain brown out protection circuit
13. List four onboard communication interfaces. Explain any one in detail
14. Explain matrix keyboard interfacing
15. With a neat block diagram, explain the elements of embedded system
16. Write a note on
i)reset circuit ii)watch dog timer iii) real time clock
17. what is embedded system? Differentiate between general purpose computing
system and embedded system
18. explain the following
i)I2C Bus ii)SPI Bus iii)I-wire interface
19. What is Programmable Logic Device (PLD)? What are the different types of
PLDs? Explain the role of PLDs in Embedded System design.
20. With a circuit diagram, explain how input and output circuits of a processor can
be isolated
21. Explain SPI Bus interfacing and sequence of operation for communicating with a
SPI device
22. With a neat diagram, explain SRAM cell implementation and its working. Give
comparison between SRAM and DRAM cells
23. Explain the following
i)Zigbee ii)Wi-fi iii)Bluetooth iv)IrDA
62