Core of The Embedded System
Core of The Embedded System
Core of The Embedded System
system
Core of embedded system
• Embedded systems are domain and application
specific and are built around a central core.
• The core of the embedded system fall into any one of
the following categories:
– General purpose and domain specific processors
• Micro-processors
• Micro-controllers
• Digital signal processors
– Application specific integrated circuits (ASIC)
– Programmable logic devices (PLD)
– Commercial off the shelf components (COTS)
General purpose and Domain specific Processors
Almost 80% of the embedded systems are microcontroller/ microprocessor
based.
Microprocessor – CPU capable of performing arithmetic as well as logic
operations with the combination of other hardware like memory, timers,
interrupt controller etc. for proper functioning.
•1971 - Intel 4004
– 4 bit processor
– 16 - 4bit General Purpose Registers
– Clock speed 740kHz
– 46 instructions
– 1K Data Memory, 4K Program Memory, 12 bit Program Counter
– Designed for old days calculators.
General purpose and Domain specific Processors
• 1972 - 4040
– 14 more instructions added to 4004
– 8K Program Memory
– Interrupt capabilities added to it.
• April 1972 - 8008
– Similar to 4004
– 14 bit PC
– Serves as a terminal controller
• 1974 - 8080
– First 8 bit microprocessor
– 16 bit address bus and 16 bit Program Counter
– 7 - 8 bit registers
– Commonly used in industrial control & other embedded appln’s.
• Motorola 6800 –
- Different architecture & instruction set compared to 8080.
General purpose and Domain specific Processors
• 1976 - 8085
– Upgraded version of 8080
- 2 newly added instructions
– 3 interrupt pins
– Serial i/o
– Clock generator and Bus controller circuits (built in)
– Power supply part modified to a single +5 supply
• 1976
- Zilog entered the microprocessor market (Z80)
– It is an improved version of 8080 (maintaining original arch.)
- Designed by Frederico Faggin (Ex-Intel Designer)
– 80 more instructions
– 8 bit data bus, 16 bit address bus and executes all instructions of
8080.
– Brought out the concept of register banking by doubling the
register set.
General purpose and Domain specific Processors
• Then 16, 32, 64 bit processors came in the place of 8 bit
microprocessor.
• The initial 2MHz clock is now GHz range.
• Intel, AMD, Free scale, IBM, TI, Cyrix, Hitachi etc.. are key players in
processor market.
• Different instruction set and system architecture are available for
microprocessor design.
– Harvard and Von-Neumann
Processors based on Harvard architecture contains separate buses for
program and data memories whereas Von-Neumann shares single
system bus.
– CISC and RISC- two common instruction set architectures for
processor design.
General purpose (GPP)
vs.
Application specific instruction set processors (ASIP)
Microcontrollers
• Highly integrated chip that contains
– CPU
– SFR, GPR
– RAM, ROM / FLASH
– Timers
– Interrupt control unit
– Dedicated i/o ports
• Superset of microprocessors and do independent
working.
• Cheap, cost effective, readily available in market
Microcontrollers
1974
- TI's TMS 1000
– known as the 1st micro-controller
– TI followed the Intel's 4004/4040 design and added
some RAM, ROM & i/o support on a single chip.
1977
- Intel - MCS48 family
–8038HL, 8039HL, 8040AHL, 8048H, 8049H,8050AH
8048
- Intel's 1st micro-controller
- Used in the IBM-PC keyboards
- Inspiration is Fairchild F8 and goal of developing a low
cost and small size processor
- Harvard architecture
Microcontrollers
• 1980’s - MCS51
– Intel's 8 bit micro-controller domain
– Almost 75% of the micro-controllers used in
embedded domain uses 8051 family based
controllers during 1980s to 1990s.
– 8051 processor core are used in more than
100 devices by more than 20 independent
manufacturers, under the license from Intel.
• PIC family micro-controller
– From microchip technologies
– High performance RISC processor complementing
the CISC features of 8051
Microcontrollers
• Infineon, Freescale, Atmel, Maxim, Microchip etc..
are the key suppliers of 16 bit micro-controllers.
• Added more and more functionality like:
– SPI
– I2C
– USB
– ADC
– Networking capabilities etc..
• ARM - high processing speed micro-controller
families.
• The instruction set architecture of micro-controller
can be RISC or CISC
Microprocessors
Vs
Microcontrollers
Digital Signal Processors
• Powerful special purpose 8/16/32 bit micro-processor.
• Designed specifically to meet the computational demands & power
constraints of today's embedded audio, video & communications
applications.
• DSP are 2 to 3 times faster than the general purpose microprocessor in
signal processing applications.
• This is because of the architectural difference b/w the two.
• DSP implements algorithms in h/w which speeds up the execution.
• General purpose processors implements algorithms in firmware & speed
of execution depends primarily on the clock for the processors.
• A typical DSP incorporates the following units:
– Program Memory, Data Memory, I/O units, Computational Engine.
• Ex: Audio / Video Signal Processing, Telecommunication and
Multimedia
• Ex: Blackfin Processors from Analog Devices – 32 bit RISC
RISC VS CISC
Harvard vs Von-Neumann Architectures
Big Endian vs Little Endian
• Endiannes specifies the order in which the data is stored
in the memory in a multi-byte system.
• If word length is 2 byte then data can be stored in 2 ways
• Little Endian:
The lower order byte of the data is stored in memory at the
lower address & the higher order byte at the highest
address.
• Big Endian:
The higher order byte of the data is stored in memory at
the lower address & the lower order byte at the higher
address.
Load and store operation
• Memory
• Type of memory interface
• Memory shadowing
• Memory selection for embedded system
Memory
• On-chip memory
• External memory(off-chip)
• RAM:
– SRAM
– DRAM
– NVRAM
SRAM
• Stores data in the form of voltage
• They are made up of flip-flops
• Fastest form of RAM. Typical access time is 10ns
• Each bit is realized using 6 transistors
(6MOSFETs), 4 for latch part and 2 for access
control
• Fast in operation due to resistive networking and
switching capabilities
• Does not require refreshing
• Limitation:
– Low capacity
– High cost
SRAM
Operation B B/ Word
Line
Write 1 0 1
Read 1 1 1
DRAM
• Stores data in the form of charge.
•Made up of a MOSFET and a capacitor
• Advantage:
– High density
– Low cost
• Disadvantage:
–Since the information is stored as charge, it get
leaked of with time & to prevent this they need to
refreshed periodically.
– DRAM controllers are used for refreshing.
– Refresh operation is done periodically in ms
interval
• MOSFET act as gate for incoming & outgoing data
and capacitor acts as bit storage unit.
SRAM vs DRAM
NVRAM
• It is a RAM with battery backup.
• It contains static RAM based memory & a minute
battery for providing supply to the memory in the
absence of external power supply.
• Memory & battery are packed together in a single
package.
• Used for non-volatile storage of results
•Life span is around 10 years
Ex: DS1744 from Maxim/Dallas
Type of memory interface
Connection of memory to the processor can be of various
types
– Parallel interface
– Serial interface
• I2C
• SPI
• Serial interface – commonly used in EEPROM
• Memory density of a serial memory is usually expressed in
terms of “kilobits” (AT24C512 with capacity of 512 kilobits)
• For parallel interface memory is expressed in terms of
“kilobytes”.
Memory shadowing
• Execution of a program from ROM is very slow
compared to RAM
• RAM access is three times as fast as ROM
– ROM access time is (120 – 200 ns)
– RAM access time is (40 – 70 ns)
• Shadowing of memory is a technique to solve the
execution speed problem in processor based system
• Eg: Manufacturers included a RAM behind the logical
layer of BIOS (Basic Input Output configuration) at its
same address as a shadow, to BIOS
• During boot up copy the BIOS to the shadowed RAM and
write protect the RAM then disable the BIOS reading
Memory selection for embedded system
• Embedded system require PM (holds control algorithm or embedded OS &
applications) and DM (configuration data, look up table etc).
• Memory requirement is solely dependent on the type of the embedded system and the
application for which it is designed.
• Factors need to be considered when selecting the type & size of memory for embedded
system:
– Application
• (on-chip memory may be sufficient for designing the total system)
– system requirement and based on the type of processor
• For 8051 and PIC:
• For RTOS:
• 2 parameters for representing an memory
– Size of the memory
• Memory chip comes with standard size 4Kb, 8Kb, 16Kb etc.
• Address range supported by processor
– Word size of the memory
• no. of bits that can be read/write together 4, 8, 12, 16 etc.
• Word size should be matched for memory and processor.
Memory selection for embedded system
• FLASH
– FLASH is the popular choice for ROM in embedded system
– FLASH comes with 2 major versions
• NAND FLASH
• NOR FLASH
• NAND FLASH
– High density, Low cost
– Non-volatile
– Can be used for storing programs & data
– Dose not support XIP (execute in place) – allows the execution of code memory
from ROM itself without the need for copying it to RAM.
• NOR FLASH
– Less density, Expensive
– It supports XIP technology.
– Can be used for storing boot-loader or for even complete program code.
Memory selection for embedded system
• EEPROM
– It comes with parallel or serial interface.
– If the controller/processor supports serial
interface & the amount of data write and read to
and from the device is less, it is better to have a
serial EEPROM chip.
• Serial EEPROM is usually expressed in “bits” and
“kilo-bits” (512 bits, 1 Kbits, 2 Kbits etc.)
Sensors And Actuators
• Sensors
– A sensor is a transducer device that converts energy from one form to
another for any measurement or control purpose.
― Changes in system environment or variables are captured by the sensors
connected to the input port of embedded system.
• Actuators
– Actuator is a transducer device (mechanical or electrical) which converts
signal to corresponding physical action (motion).
― ES designed for controlling purpose produce changes in controlling
variable to bring the controlled variable to desired value, which is achieved
through actuators connected to the output port of the system.
• I/O Subsystem
– The i/o subsystem of the embedded system facilitates the interaction of
the embedded system with the external world through sensors and
actuators. But they may be connected through signal conditioning and
translating systems.
EXAMPLES
• LED
• 7 segment display
• Optocoupler
• Stepper motor
• Relay
• Piezo-buzzer
• Push button switch
• Keyboard
• PPI
LED
• Output device used for visual indication in any embedded system.
• Indicates the status. Eg: device ON, Battery low, Charging of battery.
• P-n junction diode (having anode connected to +ve terminal of
supply voltage & cathode to –ve terminal of supply voltage).
Two ways of interfacing LEDs to the port pin of processor.
Method1: Anode of LED directly connected to the port pin and port
drives LED.
Port pin sources current to LED when the port pin is at logic 1.
Method2: Cathode of LED is connected to port pin of processor and
anode to the supply voltage through current limiting resistor.
• LED is turned ON when the port pin is at logic 0.
• Brightness of the LED depends on the maximum current the port
can source if connected directly. Hence in this method, current is
directly supplied by power supply and port pin acts as sink for
current.
LED
Method 1 Method 2
7-Segment Display
• Writing a bit 1:
– Master pulls the bus for 1-15 micro seconds & then
releases the bus for the rest of the time.
• Writing a bit 0:
– Master pulling the bus for 1-2 time slots (60-120
microseconds).
• Read a bit:
– Master pull the bus LOW for 1-15 micro seconds.
– If slave want to send 1 in response to the read request :
• It releases the bus reset of the time slot.
– If slave want to sent 0:
• It pulls the bus LOW for rest of the time slot.
Parallel interface
• Normally used for communicating with peripheral devices which are
memory mapped to the host of the system.
• Host processor contains parallel bus and is directly connected to the
device that supports parallel bus.
• Controlled by control signals.
– Read / write
– Device select
Devices are memory mapped to processor and address range is assigned
to it.
• Address decoder can be used for generating the chip select signal for
device.
– When the address selected by the processor is within the range assigned
for the device, the decoder circuit activates the chip select.
• Processor then can read or write from the device by asserting the
corresponding control line
• Normally host processor initiated, devices can initiate through
interrupts.
• Data bus width(4bit, 8bit, 16bit, 32bit, 64bit etc.) determines width of
interface.
• Eg: ADC
Parallel interface
Serial vs Parallel Data Transfer
External communication interface
RS232 – Recommended Standard Number 232, Recommendation C
from Electronic Industry Association
- standard by which two serial devices communicate
• Full duplex, Wired, Asynchronous serial communication interface developed by
EIA using standard TTL / CMOS logic
• Logic 0 (space): represented with voltage between +3 & +25v.
• Logic 1 (mark) : represented with voltage between -3 & -25v.
• Supports different types of handshaking and control signals.
• RS232 supports 2 different type of connectors:
– DB9 , DB25 (obsolete)
• Standard baud-rates: (20Kbps as per industry standards)
– 300bps, 1200bps, 2400bps, 4800bps, 9600bps,11.52kbps, 19.2kbps etc.
• Maximum operating distance is:
– 50 feet at highest supported baud-rate.
• point to point communication interface (Not suitable for multi-drop Commn.)
. Devices involved are called Data Terminal Equipment (DTE) or Data
Communication Equipment (DCE)
Level converter
• In embedded s/m requires level translator to convert UART to RS232.
• MAX232
External communication interface
External communication interface
• TxD: This pin carries data from the computer to the serial device (DTE)
• RxD: This pin carries data from the serial device (DCE) to the computer
• DTR: DTR is used by the computer to signal that it is ready to communicate
with the serial device like modem. In other words, DTR indicates to the
modem that the DTE (computer) is ON.
• DSR: Similar to DTR, Data set ready (DSR) is an indication from the
modem that it is ON.
• DCD: Data Carrier Detect (DCD) indicates that carrier for the transmit data
is ON.
• RTS: This pin is used to request clearance to send data to a modem
• CTS: This pin is used by the serial device to acknowledge the computer's
RTS Signal.
External communication interface
Bluetooth standards:
• GAP (Generic Access Profile)
– Defines the requirements for detecting a Bluetooth
device & establishing a connection with it.
• SPP (Serial Port Profile)
– For serial data communication.
• FTP (File Transfer Protocol)
– For file transfer b/w devices.
• HID (Human Interface Device)
– For supporting human interface devices like keyboard,
mouse etc.
Wi-Fi
Wireless Fidelity
• Wi-Fi follows the IEEE 802.11 standard.
• Intended for n/w comm. & supports IP.
• Each device is identified by IP address, unique in the
network and communicates based on intermediate
agent called WI-FI Router/WAP (Wireless Access
Point) that restricts the access to network.
• Wi-Fi operates at 2.4GHz or 5GHz of radio frequency
and coexist with other ISM band devices.
• When the Wi-Fi radio of the device is ON,
– searches the available Wi-Fi n/w s & lists out the
service set identifier (SSID).
– If the n/w is security enabled, a password may be
required to connect to the SSID.
Wi-Fi
WI-FI NETWORK
Wi-Fi
• Wi-Fi employs different security mechanisms:
– WEP (Wired Equivalency Privacy)
– WPA (Wireless Protected Access)
• Supporting data rate:
– 1Mbps – 150Mbps depending up on the
Standards (802.11 a/b/g/n)
& access / modulation method
• Depending upon the antenna & usage location
(indoor/outdoor) Wi-Fi offers range of 100 –
300 ft.
ZigBee
• Low power, low cost, wireless n/w communication protocol.
• Based on IEEE 802.15.4 standard.
• Targeted for low data rate applications for wireless personal
area networking (WPAN)
• Supports robust mesh networking to allow messages to travel
through multiple paths to get through the nodes.
• Operates at unlicensed bands of radio spectrum
– 2.4 – 2.484GHz
– 902 – 928MHz
– 868 – 868.6MHz
• Distance : 100m
• Data rate : 20 – 250kbps.
• ZigBee device falls under any one of the following:
– ZigBee coordinator (ZC) / N/w coordinator
– ZigBee Router (ZR) / Full Function Device (FFD)
– ZigBee end device (ZED) / Reduced Function Device (RFD)
ZigBee
ZigBee
• ZigBee coordinator – Root of the network and is
responsible for initiating the network and stores
information about network.
• ZigBee Router – Responsible for passing information
from device to device.
• ZigBee end device – Contains ZigBee functionality for
data communication. It can talk only with ZR or ZC and
cannot transfer data from one device to other.
Applications:
Home and industrial automation
Energy management
Home security
Patient tracking
Logistics and asset tracking …….
GPRS
• Communication technology for transferring data over a mobile
communication N/w like GSM.
• Data is sent as packets.
• Transmitting devices splits the data into several related
packets and the receiving end reconstructs by combining the
data packets.
• Transfer rate : maximum 171.2kbps.
• GPRS communication divides the channel into 8 time slots &
transmits data over available channels.
• GPRS supports : IP, Point to Point, X.25 protocols.
• Mainly used by mobile enabled embedded devices.
• Device should support the necessary:
– GPRS modem & GPRS radio.
• New generation data communication tech- are
– EDGE
– HSDPA(high speed down-link packet access)
These offers higher bandwidth for communication.