embeded systems(unit 1)

73
ADVANCE EMBEDDED ADVANCE EMBEDDED SYSTEM DESIGN SYSTEM DESIGN SHIBU K V SHIBU K V

description

for mtech vlsi n embedded (VTU)

Transcript of embeded systems(unit 1)

Page 1: embeded systems(unit 1)

ADVANCE ADVANCE EMBEDDED EMBEDDED

SYSTEM DESIGNSYSTEM DESIGNSHIBU K VSHIBU K V

Page 2: embeded systems(unit 1)

What is an embedded What is an embedded systemsystem

An embedded system is an An embedded system is an electronic/electro-mechanical system electronic/electro-mechanical system designed to perform a specific designed to perform a specific function and is a combination of function and is a combination of both hardware and firmware both hardware and firmware (software)(software)

Page 3: embeded systems(unit 1)

EMBEDDED SYSTEMEMBEDDED SYSTEM

To perform a specific functionTo perform a specific functionCombination of both h/w and s/wCombination of both h/w and s/wMay or may not contain an O.SMay or may not contain an O.SThe firmware of the embedded system The firmware of the embedded system is pre-programmed and it is non is pre-programmed and it is non alterable by the end useralterable by the end user

Page 4: embeded systems(unit 1)

CLASSIFICATION OF ESCLASSIFICATION OF ES

1. Based on generation1. Based on generation 2. Complexity & performance 2. Complexity & performance

requirementsrequirements 3. Based on deterministic behavior3. Based on deterministic behavior 4. Based on triggering4. Based on triggering

Page 5: embeded systems(unit 1)

1. CLASSIFICATION BASED ON 1. CLASSIFICATION BASED ON GENERATIONGENERATION

First generation : 8 bit µp like 8085- First generation : 8 bit µp like 8085- simple h/w – f/w in assembly codesimple h/w – f/w in assembly code

Second generation : 16 bit µp and 8/16 bit Second generation : 16 bit µp and 8/16 bit µc – instruction set much more complexµc – instruction set much more complex

Third generation : 32 bit µp and 16 bit µc – Third generation : 32 bit µp and 16 bit µc – DSP and ASIC came to picture – pipelining DSP and ASIC came to picture – pipelining evolved evolved

Fourth generation : advent of SOC multi Fourth generation : advent of SOC multi core processors- making use of high core processors- making use of high performance RTESperformance RTES

What is next? What is next?

Page 6: embeded systems(unit 1)

2. CLASSIFICATION BASED 2. CLASSIFICATION BASED ON COMPLEXITY AND ON COMPLEXITY AND

PERFORMANCEPERFORMANCE Small scale embedded system:Small scale embedded system:SimpleSimpleNot time criticalNot time criticalLow performanceLow performanceLow costLow costMay or may not contain o.sMay or may not contain o.s medium scale embedded system:medium scale embedded system:Slight complex in h/w and s/wSlight complex in h/w and s/wMedium performanceMedium performanceLow costLow costUsually contain an o.sUsually contain an o.s Large scale embedded system Large scale embedded system ::Highly complex h/w and s/wHighly complex h/w and s/wDemanding high performanceDemanding high performanceMay contain multi-core processors and co processorsMay contain multi-core processors and co processorsUsually contain RTOS for task scheduling and prioritization Usually contain RTOS for task scheduling and prioritization

managementmanagement

Page 7: embeded systems(unit 1)

MAJOR APPLICATION MAJOR APPLICATION AREASAREAS

Consumer electronicsConsumer electronics House hold appliancesHouse hold appliances Security systemsSecurity systems Automotive industryAutomotive industry TelecomTelecom Computer networking systemsComputer networking systems HealthcareHealthcare Measurement and instrumentationMeasurement and instrumentation Banking & retailBanking & retail Card readersCard readers

Page 8: embeded systems(unit 1)

PURPOSE OF EMBEDDED PURPOSE OF EMBEDDED SYSTEMSSYSTEMS

Each embedded system is designed to Each embedded system is designed to serve the purpose of any one or a serve the purpose of any one or a combination of the following tasks:combination of the following tasks:

Data collection/storage/representationData collection/storage/representation Data communicationData communication Data processingData processing Monitoring Monitoring ControlControl Application specific user interfaceApplication specific user interface

Page 9: embeded systems(unit 1)

ELEMENTS OF AN ELEMENTS OF AN EMBEDDED SYSTEMEMBEDDED SYSTEM

MEMORY

System coreI/O PORTS

(SENSORS)

O/P PORTS

(ACTUATORS)

Other supporting IC s

and subsyste

ms

communication interface

Page 10: embeded systems(unit 1)

CORE OF THE CORE OF THE EMBEDDED SYSTEMEMBEDDED SYSTEM

The core of the embedded system The core of the embedded system falls in to any one of the following falls in to any one of the following categoriescategories1. general purpose and domain 1. general purpose and domain specific processors ( µp, µC, DSP )specific processors ( µp, µC, DSP )

2. ASIC(Application specific IC)2. ASIC(Application specific IC)3. programmable logic devices (PLD)3. programmable logic devices (PLD)4. commercial off-the-shelf 4. commercial off-the-shelf components (COTS)components (COTS)

Page 11: embeded systems(unit 1)

GPP vs. ASIPGPP vs. ASIP General purpose processor : General purpose processor : Designed for general computational tasksDesigned for general computational tasksE.g.. Processor in the laptopE.g.. Processor in the laptopHigh volume productionHigh volume productionUnit cost for a chip is lowUnit cost for a chip is low ASIP instruction set and architecture ASIP instruction set and architecture

optimized to specific applicationoptimized to specific application ASIP arises when the GPP are unable to ASIP arises when the GPP are unable to

meet the application needsmeet the application needs

Page 12: embeded systems(unit 1)

µP Vs µCµP Vs µC µPRepresenting a CPU performing ALU operations according to a pre defined set of instructions

It is a dependent unit requires other chips like timers , memory chips etc

Doesn't contain built in I/O port

Limited power saving options

Mostly general purpose in in design and operation

µC

Highly integrated chip that contains CPU, RAM, on chip ROM , timer etc

It is a self contained unit

Most of the processors contain multiple built in I/O ports

Includes lot of power saving features

Mostly application oriented or domain -specific

Page 13: embeded systems(unit 1)

RISC VS CISCRISC VS CISC RISCLesser no. of instruction

Instruction pipeline

Orthogonal instruction set(operates on any register and any addressing mode)Operations are performed on registers only except load and store

Large no. of registers are available

Programmer needs to write more code to execute a task

Fixed length instructionLess silicon usage

With Harvard Architecture

CISCGreater no. of instructions

Generally no instruction pipelining

Non-orthogonal instruction set

Operations are performed on registers or memory

Limited no. of registers are available

Programmer can achieve the same with a single instruction

Variable length instructionsMore silicon usage since additional decoder logic is used for complex instructionCan be Harvard or Von Neumann architecture

Page 14: embeded systems(unit 1)

Harvard Vs Von Neumann Harvard Vs Von Neumann ArchitectureArchitecture

Harvard Architecture

Separate buses for instruction and data

Easier to pipeline

Comparatively high cost

No memory alignment problem

Since data memory and program memory are stored physically in different locations no chances for corruption of program memory

Von- Neumann Architecture

Single shared bus for instruction and data

Low performance compared to Harvard

Cheaper

Allows self modifying codes( modifies while execution)

Since data memory and program memory are stored physically in same chip chances for corruption of program memory

Page 15: embeded systems(unit 1)

Big endian Vs Little Big endian Vs Little endianendian

Specifies the order in which the data Specifies the order in which the data is stored in the memory in multi byte is stored in the memory in multi byte systemsystem

If word length is 2 byte then data If word length is 2 byte then data can be stored in 2 wayscan be stored in 2 ways Higher order of data byte at higher Higher order of data byte at higher

memory and lower order just below thatmemory and lower order just below that Lower order of data byte at higher Lower order of data byte at higher

memory and higher order just below thatmemory and higher order just below that

Page 16: embeded systems(unit 1)

Byte 0Byte 0

Byte 1Byte 1

Byte 2Byte 2

Byte 3Byte 3

Base address + 0Base address +1Base address+2Base address+3

Little endian – lower order byte of data at lowest address

Base address + 0Base address +1Base address+2Base address+3

Byte 3Byte 3

Byte 2Byte 2

Byte 1Byte 1

Byte 0Byte 0

Big endian

Big endian – higher order byte of data at lowest address

Page 17: embeded systems(unit 1)

Load and store operationLoad and store operation Load – content of memory location loaded to Load – content of memory location loaded to

a registera register Stored- stores the content of data from the Stored- stores the content of data from the

specified register to specified memoryspecified register to specified memory E.g.. Add contents of memory locations x,y E.g.. Add contents of memory locations x,y

and store the result in location zand store the result in location z

load R1,xload R1,x load R2,yload R2,y add R3,R1,R2add R3,R1,R2 store R3,zstore R3,z

Page 18: embeded systems(unit 1)

Instruction pipeliningInstruction pipelining

conventional instruction execution –conventional instruction execution –fetch-decode-executefetch-decode-execute

Instruction pipelining refers to the Instruction pipelining refers to the overlapped execution of instructionsoverlapped execution of instructions

Processing speed can be increasedProcessing speed can be increased

Page 19: embeded systems(unit 1)

ASICASIC

A micro chip designed to perform a unique A micro chip designed to perform a unique applicationapplication

It integrates several functions to a single It integrates several functions to a single chip and there by reduces the costchip and there by reduces the cost

Consumes a very small area and there by Consumes a very small area and there by helps in the design of smaller systemshelps in the design of smaller systems

Can be pre-fabricated or custom fabricatedCan be pre-fabricated or custom fabricated Profitable only for large volume productionsProfitable only for large volume productions

Page 20: embeded systems(unit 1)

Programmable logic Programmable logic devicesdevices

Logic devices can be classified into two (fixed Logic devices can be classified into two (fixed and programmable)and programmable)

Circuits in fixed logic device are permanent- (for Circuits in fixed logic device are permanent- (for one function or set of functions) –they can not be one function or set of functions) –they can not be changedchanged

PLDPLD offer customers a wide range of logic offer customers a wide range of logic capacity, features, speed etc.capacity, features, speed etc.

final design is completed much faster than that final design is completed much faster than that of fixed logic deviceof fixed logic device

During design phase customers can change the During design phase customers can change the circuitry as often as they wantcircuitry as often as they want

PLDs are based on re-writable memory PLDs are based on re-writable memory Once design is final customers can go into many Once design is final customers can go into many

PLDs as they needPLDs as they need

Page 21: embeded systems(unit 1)

CPLD AND FPGACPLD AND FPGA Two major types of PLDs are field Two major types of PLDs are field

programmable gate arrays and complex programmable gate arrays and complex programmable logic devicesprogrammable logic devices

FPGAFPGA – highest logic density, most features, – highest logic density, most features, highest performancehighest performance

Offers built in h/w processors, clk management Offers built in h/w processors, clk management systems, device to device signalingsystems, device to device signaling

Used in wide range of applications telecom, Used in wide range of applications telecom, DSP etcDSP etc

CPLD - CPLD - Small amount of logic densitySmall amount of logic density Offer very predictable timing characteristics and Offer very predictable timing characteristics and

so ideal for critical control applicationsso ideal for critical control applications Usually requires low amount of power Usually requires low amount of power Very inexpensiveVery inexpensive Ideal for cost-sensitive, battery operatedIdeal for cost-sensitive, battery operated Ideal of portable applications such as mobile Ideal of portable applications such as mobile

phonesphones

Page 22: embeded systems(unit 1)

Advantages of PLDAdvantages of PLD Offer customers much more flexibility Offer customers much more flexibility

during design cycleduring design cycle Do not require long lead time for Do not require long lead time for

production partproduction part Allows customers to orders just number Allows customers to orders just number

of parts they need, when they need of parts they need, when they need themthem

Can be reprogrammed. To add new Can be reprogrammed. To add new feature simply upload a new feature simply upload a new programming file to the PLD via internetprogramming file to the PLD via internet

Page 23: embeded systems(unit 1)

Commercial off-the-shelf Commercial off-the-shelf components-COTScomponents-COTS

Provides easy integration and interoperability Provides easy integration and interoperability with existing system components.with existing system components.

May be developed around a general May be developed around a general purpose/domain specific purpose/domain specific processor/application specific processorprocessor/application specific processor

E.g.- remote controlled toy car control units E.g.- remote controlled toy car control units like RF circuitry part, ADC , UV detectors like RF circuitry part, ADC , UV detectors etc.etc.

Readily available in the marketReadily available in the market CheapCheap Developer can cut down development timeDeveloper can cut down development time since no operational and manufacturing since no operational and manufacturing

standards end user should stick to a standards end user should stick to a particular vendor for a particular COTs particular vendor for a particular COTs

Manufacturer of the COTS component may Manufacturer of the COTS component may withdraw the product at any timewithdraw the product at any time

Page 24: embeded systems(unit 1)

MemoryMemory

On-chip and off-chip memoryOn-chip and off-chip memory Program storage memory-Program storage memory-

nonvolatilenonvolatileFLAS

H ROM

EEPROM

PROM

MROM

EPROM

NVRAM

Page 25: embeded systems(unit 1)

MASKED ROMMASKED ROM

One time programmableOne time programmable Pre programmed by the manufacturerPre programmed by the manufacturer Make use of hardwired technology for Make use of hardwired technology for

storing datastoring data Least expensiveLeast expensive MROM is permanent in bit storage, it isMROM is permanent in bit storage, it is

not possible to alter the bit informationnot possible to alter the bit information

Page 26: embeded systems(unit 1)

PROM (OTP)PROM (OTP)

Not pre- programmed by the Not pre- programmed by the manufacturermanufacturer

End user is responsible for programmingEnd user is responsible for programming Programmed by PROM programmer Programmed by PROM programmer

which selectively burns the fuseswhich selectively burns the fuses Fuses which are burned represents 0 Fuses which are burned represents 0

and not burned represents 1and not burned represents 1 Can not be reprogrammedCan not be reprogrammed Not useful for developmentNot useful for development

Page 27: embeded systems(unit 1)

EPROMEPROM

Gives flexibility to reprogram the same Gives flexibility to reprogram the same chipchip

Stores information by changing the Stores information by changing the floating gate of an FETfloating gate of an FET

Quartz crystal window is used to erase Quartz crystal window is used to erase informationinformation

It needs to be taken out and put in UV It needs to be taken out and put in UV eraser for 20 to 30 min which is time eraser for 20 to 30 min which is time consumingconsuming

Tedious & time consumingTedious & time consuming

Page 28: embeded systems(unit 1)

EEPROMEEPROM

Information can be altered by using Information can be altered by using electrical signalselectrical signals

Can be reprogrammed in circuitCan be reprogrammed in circuit Can be erased in few millisecondsCan be erased in few milliseconds Capacity is limited compared with Capacity is limited compared with

standard ROMstandard ROM

Page 29: embeded systems(unit 1)

FLASHFLASH

Latest and most popular Latest and most popular Combines re programmability of Combines re programmability of

EEPROM and high capacity of EEPROM and high capacity of standard ROMstandard ROM

Stores information in array of Stores information in array of MOSFETMOSFET

Erasing can be done at sector /page Erasing can be done at sector /page levellevel

Page 30: embeded systems(unit 1)

RAMRAM•It is data memoryIt is data memory•Read from it & write to itRead from it & write to it•RAM is volatile – power turned RAM is volatile – power turned off, content destroyedoff, content destroyed•Direct access memory Direct access memory

Page 31: embeded systems(unit 1)

RAMRAM SRAM, DRAM AND NVRAMSRAM, DRAM AND NVRAM SRAMSRAM- stores data in the form of - stores data in the form of

voltagevoltage Made up of flip flopMade up of flip flop Fast .Typical access time is 10ns Fast .Typical access time is 10ns Low capacityLow capacity High costHigh cost Minimum of 6 transistors are used to Minimum of 6 transistors are used to

build a memory cellbuild a memory cell Does not require refreshingDoes not require refreshing

Page 32: embeded systems(unit 1)

DRAMDRAM Made up of MOSFET and a capacitorMade up of MOSFET and a capacitor Requires refreshingRequires refreshing High capacityHigh capacity Less expensiveLess expensive Slow . Typical access time is 60nsSlow . Typical access time is 60ns

NVRAMNVRAM Its RAM with battery backupIts RAM with battery backup Contains SRAM and a minute batteryContains SRAM and a minute battery Life span is around 10 yearsLife span is around 10 years

Page 33: embeded systems(unit 1)

Memory shadowingMemory shadowing Execution of ROM is very slow compared Execution of ROM is very slow compared

to RAMto RAM RAM access is three times as fast as ROMRAM access is three times as fast as ROM This is to solve the execution speed This is to solve the execution speed

problem in processor based systemproblem in processor based system ROM BIOS is read and the system is ROM BIOS is read and the system is

configured according to it during system configured according to it during system boot up( its time consuming)boot up( its time consuming)

During boot up copy the BIOS to the During boot up copy the BIOS to the shadowed RAM and write protect the shadowed RAM and write protect the RAM then disable the BIOS readingRAM then disable the BIOS reading

Page 34: embeded systems(unit 1)

SENSORS AND SENSORS AND ACTUATORSACTUATORS

Sensors : that converts energy from Sensors : that converts energy from one form to another for any one form to another for any measurement or control purposemeasurement or control purpose

E.g. Smart running shoeE.g. Smart running shoe

Actuators:Actuators:

Which converts signals to Which converts signals to corresponding physical action.corresponding physical action.

Acts as o/p deviceActs as o/p device

Page 35: embeded systems(unit 1)

i/o subsystemsi/o subsystems Facilitates the interaction o the embedded system Facilitates the interaction o the embedded system

with the external worldwith the external world

LED:LED: o/p deviceo/p device Pn junction diodePn junction diode Anode to +ve terminal and cathode to –ve Anode to +ve terminal and cathode to –ve

terminalterminal A resistor in series to limit the current A resistor in series to limit the current

7 segment LED display7 segment LED display o/p device to display alphanumeric characterso/p device to display alphanumeric characters 8 LEDs8 LEDs a- g segmentsa- g segments Two configurations- common anode and common Two configurations- common anode and common

cathodecathode Used for low cost applicationUsed for low cost application

Page 36: embeded systems(unit 1)

OptocouplerOptocoupler To isolate two parts or a circuit (for To isolate two parts or a circuit (for

suppressing interference in data suppressing interference in data communication, high voltage communication, high voltage separation etc)separation etc)

Combines a LED and a photo-transistor Combines a LED and a photo-transistor in a single packagein a single package

Can be used in i/p and o/p circuitsCan be used in i/p and o/p circuitsStepper motorStepper motor

Electro- mechanical device which Electro- mechanical device which generates discrete displacement in generates discrete displacement in response to dc electrical signalsresponse to dc electrical signals

Dc motor gives continuous rotationDc motor gives continuous rotation Consumer electronic products, robotics Consumer electronic products, robotics

control, paper feed mechanism of a control, paper feed mechanism of a printerprinter

Page 37: embeded systems(unit 1)

Two phase stepper motor is classified Two phase stepper motor is classified into two.into two.

Uni polar and bi polarUni polar and bi polar UnipolaUnipolar: contains two winding per r: contains two winding per

phasephase Direction of rotation is controlled by Direction of rotation is controlled by

changing direction of currentchanging direction of current Current in one direction flows through Current in one direction flows through

one coil and in opposite direction one coil and in opposite direction through the other coilthrough the other coil

Page 38: embeded systems(unit 1)

Bipolar:Bipolar: Contains single winding per phase Contains single winding per phase

for reversing the motor rotation the for reversing the motor rotation the current flow through the winding is current flow through the winding is reversed.reversed.

The stepping of stepper motor can The stepping of stepper motor can be implemented by changing be implemented by changing sequence of activation of the stator sequence of activation of the stator windingswindings

Page 39: embeded systems(unit 1)

Different stepping modesDifferent stepping modes Full step: both phases are energized Full step: both phases are energized

simultaneouslysimultaneously

Wave step: only one phase energized at a Wave step: only one phase energized at a timetime

Step Step Coil aCoil a Coil bCoil b Coil cCoil c Coil dCoil d

11 HH HH LL LL

22 LL HH HH LL

3l3l LL LL HH HH

44 HH LL LL HH

stepstep Coil aCoil a Coil bCoil b Coil cCoil c Coil dCoil d

11 HH LL LL LL

22 LL HH LL LL

33 LL LL HH LL

44 LL LL LL HH

Page 40: embeded systems(unit 1)

HALF STEP: Combination of wave HALF STEP: Combination of wave and full stepand full step

Highest torque and stabilityHighest torque and stabilitystepstep Coil aCoil a Coil bCoil b Coil cCoil c Coil dCoil d

11 HH LL LL LL

22 HH HH LL LL

33 LL HH LL LL

44 LL HH HH LL

55 LL LL HH LL

66 LL LL HH HH

77 LL LL LL HH

88 HH LL LL HH

Page 41: embeded systems(unit 1)

RELAYRELAY Electro-mechanical deviceElectro-mechanical device Contains a relay coil made up of insulated Contains a relay coil made up of insulated

wire on a metal core and a metal armature wire on a metal core and a metal armature with one or more contactswith one or more contacts

When voltage is applied to relay coil , current When voltage is applied to relay coil , current flows and generates magnetic field which flows and generates magnetic field which attracts armature core and moves the contact attracts armature core and moves the contact pointpoint

Widely used configurations are single pole Widely used configurations are single pole single throw normally open, single pole single single throw normally open, single pole single throw normally closed, single pole double throw normally closed, single pole double throwthrow

Page 42: embeded systems(unit 1)

Piezo buzzerPiezo buzzer: is a piezoelectric device for : is a piezoelectric device for generating audio indications in embedded generating audio indications in embedded applicationapplication

Contains piezo electric diaphragm which Contains piezo electric diaphragm which produces sound in response to the voltageproduces sound in response to the voltage

Self driving and external driving (predefined Self driving and external driving (predefined tone and different tone)tone and different tone)

Push button switchPush button switch:It is an input device. :It is an input device. Push to make and push to break (normally closed Push to make and push to break (normally closed

and normally opened)and normally opened) In the pushed state it breaks/makes circuit In the pushed state it breaks/makes circuit

connectionconnection Used for generating a momentary pulseUsed for generating a momentary pulse Used as reset and start in embedded applicationUsed as reset and start in embedded application Depending on the way in which push button Depending on the way in which push button

interfaced to the controller it can generate either interfaced to the controller it can generate either a HIGH or LOW pulsea HIGH or LOW pulse

Page 43: embeded systems(unit 1)

Key boardKey board: input device of user interfacing: input device of user interfacing Can use push button switches , but it is a Can use push button switches , but it is a

wastage of port pinswastage of port pins So matrix key board which reduces the So matrix key board which reduces the

number of interface connectionsnumber of interface connections For detecting a key press uses scanning For detecting a key press uses scanning

technique.technique. To prevent de-bounce issue a technique To prevent de-bounce issue a technique

should be appliedshould be applied s/w technique and h/w techniques/w technique and h/w technique s/w easy to implement and the key is read s/w easy to implement and the key is read

after de-bounc e delayafter de-bounc e delay PPIPPI: To extend i/o capabilities of processors: To extend i/o capabilities of processors 8255 is popular8255 is popular Supports 24 i/o pins which ca be grouped in Supports 24 i/o pins which ca be grouped in

to 8 bit parallel ports (port A, port B, port C)to 8 bit parallel ports (port A, port B, port C)

Page 44: embeded systems(unit 1)

Communication interfaceCommunication interface For communicating with various subsystems of For communicating with various subsystems of

the embedded system and with external worldthe embedded system and with external worldOn boards communication interfacesOn boards communication interfaces

for interconnecting the various ICs and other for interconnecting the various ICs and other peripherals within embedded systemperipherals within embedded system

I2C bus I2C bus (inter integrated circuit bus)(inter integrated circuit bus) Synchronous bidirectional half duplex two wire Synchronous bidirectional half duplex two wire

serial interface busserial interface bus Comprise of two bus lines, serial clock and Comprise of two bus lines, serial clock and

serial data (SCL and SDA)serial data (SCL and SDA) Many number of I2C devices can be connectedMany number of I2C devices can be connected Devices connected to I2C can act as master or Devices connected to I2C can act as master or

slave deviceslave device I2C bus three different data rates I2C bus three different data rates

(100kbps,400kbps,3.4mbps)(100kbps,400kbps,3.4mbps)

Page 45: embeded systems(unit 1)

Serial peripheral interface SPI bus:Serial peripheral interface SPI bus: Synchronous, bidirectional, full duplex four wire Synchronous, bidirectional, full duplex four wire

serial interface busserial interface bus It’s a single master multi-slave systemIt’s a single master multi-slave system Requires four signal lines for communication Requires four signal lines for communication

(master out slave in, master in slave out, serial (master out slave in, master in slave out, serial clock, slave select)clock, slave select)

Master device is responsible for generating the Master device is responsible for generating the clock signalclock signal

Master selects the required slave deviceMaster selects the required slave device SPI works on the principle of shift register. SPI works on the principle of shift register.

Master and slave devices contain a special shift Master and slave devices contain a special shift register for the data to transmit or receive.register for the data to transmit or receive.

Size of SR is device dependent. Normally it is a Size of SR is device dependent. Normally it is a multiple of 8multiple of 8

Compared to I2C ,SPI is most suitable for Compared to I2C ,SPI is most suitable for transfer of data in streamstransfer of data in streams

Limitation is , it doesn’t support an Limitation is , it doesn’t support an acknowledgement mechanismacknowledgement mechanism

Page 46: embeded systems(unit 1)

UARTUART (universal asynchronous Receiver (universal asynchronous Receiver TransmitterTransmitter))

Asynchronous form of data transmissionAsynchronous form of data transmission Serial data transmission doesn’t require a Serial data transmission doesn’t require a

clock signal to synchronize the end of clock signal to synchronize the end of transmissiontransmission

It relies upon the pre defined agreement It relies upon the pre defined agreement between the devicesbetween the devices

For proper communication the transmit line For proper communication the transmit line of the sending device should be connected to of the sending device should be connected to the receiving devicethe receiving device

It also provides h/w handshaking signal It also provides h/w handshaking signal support for controlling the serial data flowsupport for controlling the serial data flow

Nowadays most the microprocessors are Nowadays most the microprocessors are available with integrate UART functionalityavailable with integrate UART functionality

Page 47: embeded systems(unit 1)

1-wire interface1-wire interface

asynchronous half duplex communication protocolasynchronous half duplex communication protocol It makes use of only a single signal line called It makes use of only a single signal line called

DQ for communication and follows master-slave DQ for communication and follows master-slave communication modelcommunication model

It allows power to be sent along the signal wire It allows power to be sent along the signal wire as well.(I2C uses internal capacitor to power the as well.(I2C uses internal capacitor to power the device)device)

Supports a single master and one or more slave Supports a single master and one or more slave devicesdevices

Every 1-wire device contains a globally unique Every 1-wire device contains a globally unique 64 bit id no stored within it for addressing64 bit id no stored within it for addressing

Communication over the 1-wire bus is divided Communication over the 1-wire bus is divided into timeslots of 60micro secinto timeslots of 60micro sec

Page 48: embeded systems(unit 1)

Parallel interface:Parallel interface:

Used for communicating with peripheral Used for communicating with peripheral device which are memory mapped to the device which are memory mapped to the host of the systemhost of the system

Device which supports parallel bus can Device which supports parallel bus can directly connect to this busdirectly connect to this bus

Controlled by the control signal interface Controlled by the control signal interface between the device and the between the device and the host(rd/wr,select)host(rd/wr,select)

Always initiated by host processor, if Always initiated by host processor, if device wants to initiate then it should use device wants to initiate then it should use interruptsinterrupts

Direction of data is controlled by rd/wrDirection of data is controlled by rd/wr Decoder circuit activates the chip select Decoder circuit activates the chip select

line to activate the deviceline to activate the device

Page 49: embeded systems(unit 1)

External communication External communication interfaceinterface

Channels/buses use by the embedded system to Channels/buses use by the embedded system to communicate with the external worldcommunicate with the external world

RS 232/ RS 422/RS485RS 232/ RS 422/RS485::

full duplex, wired, asynchronous serial communication full duplex, wired, asynchronous serial communication interfaceinterface

Developed by EIA( electronics industries association ) Developed by EIA( electronics industries association ) during 1960during 1960

Logic 0 is represented with voltage between +3 and + 25,Logic 0 is represented with voltage between +3 and + 25, logic 1 using voltage between -3 and -25logic 1 using voltage between -3 and -25 Logic 0 is known as space and logic 1 as markLogic 0 is known as space and logic 1 as mark Supports baud rates up to 20 kbpsSupports baud rates up to 20 kbps still popular in industrial applicationsstill popular in industrial applications Supports two different types of connectors- DB-9 and DB-Supports two different types of connectors- DB-9 and DB-

2525 Supports only point to point communicationSupports only point to point communication Not suitable for multi- drop communicationNot suitable for multi- drop communication More susceptible to noise and reduced operating distanceMore susceptible to noise and reduced operating distance

Page 50: embeded systems(unit 1)

Universal serial buUniversal serial bus:s:WiredWired high speed serial bus for data high speed serial bus for data communicationcommunication

Follows star topology with a USB host at the centre and one Follows star topology with a USB host at the centre and one or more USB peripheral devices connected to it.or more USB peripheral devices connected to it.

Transmits data in packet formatTransmits data in packet format Improves the noise immunityImproves the noise immunity Has the ability to supply power to the connecting devicesHas the ability to supply power to the connecting devices Mini and micro USB connectors are available for small form Mini and micro USB connectors are available for small form

factor devices like portable media playerfactor devices like portable media player Supports four different types of data transfers Supports four different types of data transfers

1 1 controcontrol: s/w to query, configure and issue commands to l: s/w to query, configure and issue commands to the USB devicethe USB device

2 2 BulkBulk: for sending block of data to a device,: for sending block of data to a device,

3 3 Isochronous dataIsochronous data: for real time data communication (data : for real time data communication (data transmitted as streams in real time. Does not support error transmitted as streams in real time. Does not support error checking and retransmission. Audio devices and medical checking and retransmission. Audio devices and medical equipment)equipment)

4 4 Interrupt transferInterrupt transfer: for transferring small amount of data.: for transferring small amount of data.

Page 51: embeded systems(unit 1)

IEEE 1394( FirewireIEEE 1394( Firewire): ): wired, isochronous high speed serial wired, isochronous high speed serial

communication buscommunication bus Supports peer to peer connection and point to Supports peer to peer connection and point to

multipoint communication multipoint communication Allowing 63 devices to be connected on the bus Allowing 63 devices to be connected on the bus

in a tree topologyin a tree topology Can support a cable length of up to 15ftCan support a cable length of up to 15ft Supports data rate of 400 to 3200 Mbits/secSupports data rate of 400 to 3200 Mbits/sec Supports 3 types of connectors (4pin, 6pin, Supports 3 types of connectors (4pin, 6pin,

9pin)9pin) Used of devices like digital camera, camcorder Used of devices like digital camera, camcorder

for data transfer and storagefor data transfer and storage Unlike USB doesn’t require a host for Unlike USB doesn’t require a host for

communicating between devices (directly communicating between devices (directly connect a scanner with a printer)connect a scanner with a printer)

Data rate is far higher than USBData rate is far higher than USB h/w implementation costlier than USBh/w implementation costlier than USB

Page 52: embeded systems(unit 1)

Infrared( IrDAInfrared( IrDA): ): serial, half duplex, line of sight based wireless serial, half duplex, line of sight based wireless

technology for data( remote control of TV)technology for data( remote control of TV) Supports point to point and point to multipoint Supports point to point and point to multipoint

communicationcommunication Communication range 10cm to 1mCommunication range 10cm to 1m IR supports data rates ranging from 9600 bits/s IR supports data rates ranging from 9600 bits/s

to 16 Mbpsto 16 Mbps Infrared light emitting diode is the IR source Infrared light emitting diode is the IR source

and photodiode acts as receiverand photodiode acts as receiver Has two parts , physical link part and a Has two parts , physical link part and a

protocol partprotocol part Popular for file exchange and data transfer in Popular for file exchange and data transfer in

low cost deviceslow cost devices Even now most of the mobile phones supports Even now most of the mobile phones supports

IrDAIrDA

Page 53: embeded systems(unit 1)

Blue tooth(BTBlue tooth(BT): ):

low cost, low power, short range wireless low cost, low power, short range wireless technology for data and voicetechnology for data and voice

Supports a data rate of up to 1MbpsSupports a data rate of up to 1Mbps Range approximately 30ftRange approximately 30ft Like IrDA it has two partsLike IrDA it has two parts Each BT device has a 48 bit unique Each BT device has a 48 bit unique

identification numberidentification number Supports point to point and point to multipoint Supports point to point and point to multipoint

communicationcommunication A device can act as master or slaveA device can act as master or slave Popular in mobile phonesPopular in mobile phones

Page 54: embeded systems(unit 1)

Wi-FiWi-Fi: : wireless fidelity is popular for wireless wireless fidelity is popular for wireless

communication for networked communication for networked communicationcommunication

Supports IP protocolSupports IP protocol Each device is addressed by IP addressEach device is addressed by IP address An intermediate agent called wi-fi An intermediate agent called wi-fi

routerrouter Supports data rate 1Mbps- 150 MbpsSupports data rate 1Mbps- 150 Mbps Offers range of 100- 300ftOffers range of 100- 300ft

Page 55: embeded systems(unit 1)

ZigBeeZigBee:: low power, low cost, wireless n/w protocollow power, low cost, wireless n/w protocol Supports distance upto 100mSupports distance upto 100m Supports Data rate of 250KbpsSupports Data rate of 250Kbps 3 device category ( coordinator, router, end 3 device category ( coordinator, router, end

device)device) Coordinator- acts as the root of the n/w. Coordinator- acts as the root of the n/w.

responsible of initiating the n/w and can responsible of initiating the n/w and can store information about the n/wstore information about the n/w

Router-for passing information from one Router-for passing information from one device to otherdevice to other

End device-for data communicationEnd device-for data communication Eg: smoke detector, heating control , Eg: smoke detector, heating control ,

lighting controllighting control

Page 56: embeded systems(unit 1)

General packet radio service(GPRSGeneral packet radio service(GPRS):): for transferring data over a mobile for transferring data over a mobile

communication n/w like GSMcommunication n/w like GSM Data is sent as packetsData is sent as packets At receiving end re constructed by At receiving end re constructed by

combining packetscombining packets The radio channel is shared between The radio channel is shared between

several users instead of dedicating to a cell several users instead of dedicating to a cell phone userphone user

Supports IP protocol and PP protocolSupports IP protocol and PP protocol Mainly for mobile enabled embedded Mainly for mobile enabled embedded

devicesdevices

Page 57: embeded systems(unit 1)

Embedded firmwareEmbedded firmware Refers to the control algorithm and or the Refers to the control algorithm and or the

configuration settings that an embedded system configuration settings that an embedded system developer dumps into the memory of the developer dumps into the memory of the embedded systemembedded system

Various methods-Various methods- Write program in high level languages like Write program in high level languages like

embedded Cembedded C Write the program in assembly language using Write the program in assembly language using

the instructions supported by your application’s the instructions supported by your application’s target processortarget processor

These should be converted to machine code These should be converted to machine code before loading to the memory which is called ‘ before loading to the memory which is called ‘ HEX file creation’HEX file creation’

For a beginner it is better to use HLL.(writing For a beginner it is better to use HLL.(writing code is easy, highly portable, not developer code is easy, highly portable, not developer dependent )dependent )

Assembly language is tedious , time consuming Assembly language is tedious , time consuming and highly dependent on developerand highly dependent on developer

Page 58: embeded systems(unit 1)

Other system componentsOther system components Circuits/IC s necessary for the proper Circuits/IC s necessary for the proper

functioning of the embedded systemfunctioning of the embedded system

Reset circuitReset circuit: : to ensure that the device is to ensure that the device is not operating at a voltage level when the not operating at a voltage level when the device is not guaranteed to operate when device is not guaranteed to operate when power ONpower ON

Reset signal starts the execution from Reset signal starts the execution from the reset vector from the address 0x0000the reset vector from the address 0x0000

Either active H or active LEither active H or active L Some micro processors/controllers Some micro processors/controllers

contains built in reset circuitrycontains built in reset circuitry

Page 59: embeded systems(unit 1)

Brown-out protection circuit Brown-out protection circuit : : protection circuit prevents the protection circuit prevents the

processor/controller from unexpected processor/controller from unexpected program execution behavior when the program execution behavior when the supply voltage falls below a specified supply voltage falls below a specified voltagevoltage

May lead to data corruptionMay lead to data corruption Essential for battery powered devicesEssential for battery powered devices This holds the processor in reset state This holds the processor in reset state

until it rises above the threshold voltageuntil it rises above the threshold voltage

Page 60: embeded systems(unit 1)

Oscillator unitOscillator unit: : is responsible for is responsible for generating the clock for the processorgenerating the clock for the processor

Certain processors integrate built in Certain processors integrate built in oscillator and simply require an oscillator and simply require an external quartz crystal for producing external quartz crystal for producing the clockthe clock

Speed of the processor depends on Speed of the processor depends on clock frequencyclock frequency

Power consumption increases with Power consumption increases with increase in clock frequencyincrease in clock frequency

Accuracy of the program execution Accuracy of the program execution depends on accuracy of clock signaldepends on accuracy of clock signal

Page 61: embeded systems(unit 1)

Real time clockReal time clock: : for keeping track of timefor keeping track of time Holds information like current time, date, Holds information like current time, date,

month, year and day of the week etc.month, year and day of the week etc. Should function even in the absence of Should function even in the absence of

power. So contains a battery back up power. So contains a battery back up Available in the form of IC sAvailable in the form of IC s Essential for synchronizing the operations of Essential for synchronizing the operations of

the OS kernelthe OS kernel Can interrupt the OS by asserting the Can interrupt the OS by asserting the

interrupt lineinterrupt line OS kernel identifies the interrupt ( IRQ no)OS kernel identifies the interrupt ( IRQ no) The kernel can perform necessary operations The kernel can perform necessary operations

like system date time updation , managing like system date time updation , managing s/w timers etcs/w timers etc

Page 62: embeded systems(unit 1)

Watchdog timerWatchdog timer: : To monitor the firmware execution and reset the To monitor the firmware execution and reset the

system processor when the program execution system processor when the program execution hangs up.hangs up.

( alt+ctl+del)( alt+ctl+del)It’s a h/w timerIt’s a h/w timerIt inc/dec a counter with each clock pulse and It inc/dec a counter with each clock pulse and

generates a reset signal when reaches 0generates a reset signal when reaches 0Most processors implement as built in or using Most processors implement as built in or using

an external ICan external ICWhen watchdog timeout occurs an interrupt is When watchdog timeout occurs an interrupt is

generated instead of resetting in modern generated instead of resetting in modern systems and interrupt handler handles the systems and interrupt handler handles the situation in an appropriate fashionsituation in an appropriate fashion

Page 63: embeded systems(unit 1)

PCB and passive PCB and passive componentscomponents

Backbone is PCBBackbone is PCB After finalizing the components and After finalizing the components and

the connection a schematic design is the connection a schematic design is created and PCB is fabricatedcreated and PCB is fabricated

Apart from subsystems You can have Apart from subsystems You can have resistor, capacitor, diodes etc on resistor, capacitor, diodes etc on your boardyour board

Page 64: embeded systems(unit 1)

Characteristics of an Characteristics of an embedded systemembedded system

Unlike general purpose computing system, embedded Unlike general purpose computing system, embedded system posses certain specific characteristics and these system posses certain specific characteristics and these are unique.are unique.

Application and domain specificApplication and domain specific: embedded systems are : embedded systems are developed to do the intended functions onlydeveloped to do the intended functions only

They can not be used for any purposeThey can not be used for any purpose You can not replace an embedded control unit developed You can not replace an embedded control unit developed

for a particular domain say telecom with another control for a particular domain say telecom with another control unit designed to sey another domain like consumer unit designed to sey another domain like consumer electronicselectronics

Reactive and real timeReactive and real time: emb.sys. are in constant : emb.sys. are in constant interaction to the real world interaction to the real world

Any changes happening in the real world (event)are Any changes happening in the real world (event)are captured by the sensors or i/p devicescaptured by the sensors or i/p devices

The event may be periodic or unpredicted one(should not The event may be periodic or unpredicted one(should not miss)miss)

So emb.sys. are generally reactiveSo emb.sys. are generally reactive Timing behavior or the system should be deterministicTiming behavior or the system should be deterministic Should not miss deadlinesShould not miss deadlines

Page 65: embeded systems(unit 1)

Operates in harsh environmentOperates in harsh environment: the environment in : the environment in which the emb.sys. deployed may be a dusty one or which the emb.sys. deployed may be a dusty one or high temperature zonehigh temperature zone

System placed in such areas should be capable to System placed in such areas should be capable to with stand all operating conditionswith stand all operating conditions

Distributed: emb.sys. may be a part of larger systemDistributed: emb.sys. may be a part of larger system Automatic vending m/c contains card reader, vending Automatic vending m/c contains card reader, vending

unit etc.unit etc. They are independent but work together to achieve a They are independent but work together to achieve a

common goalcommon goalSmall size and weightSmall size and weight: : size, weight, shape etc will be size, weight, shape etc will be

one of the deciding factors to choose a productone of the deciding factors to choose a product Most applications demands small sized and low Most applications demands small sized and low

weight productsweight productsPower concernsPower concerns: designed in such a way as to : designed in such a way as to

minimize the heat dissipationminimize the heat dissipation May require cooling fan which occupies additional May require cooling fan which occupies additional

spacespace Even it’s a critical constraint battery operated Even it’s a critical constraint battery operated

systems, more the power consumption the less the systems, more the power consumption the less the battery lifebattery life

Page 66: embeded systems(unit 1)

Quality attributes of ESQuality attributes of ES

QA are the non-functional QA are the non-functional requirements that need to be requirements that need to be documented properly in any system documented properly in any system design.design.

If the quality attributes are more If the quality attributes are more concrete and measurable it will give a concrete and measurable it will give a positive impact on the end productpositive impact on the end product

Operational QAOperational QA Non-operational QANon-operational QA

Page 67: embeded systems(unit 1)

Operational quality attributesOperational quality attributes Attributes related to e.s when it is in the operational mode or Attributes related to e.s when it is in the operational mode or

online modeonline mode

ResponseResponse: : quickness of the systemquickness of the system How fast the system is tracking the changes in input variablesHow fast the system is tracking the changes in input variables In flight control application any response delay in the system In flight control application any response delay in the system

will create potential damages to the safety of the flight will create potential damages to the safety of the flight Response time for a toy is not time criticalResponse time for a toy is not time critical

ThroughpuThroughput: t: efficiency of the systemefficiency of the system Rate of production or operation of a defined processRate of production or operation of a defined process Rates can be expressed in terms of units of products , batched Rates can be expressed in terms of units of products , batched

produced, or any other meaningful measurements.produced, or any other meaningful measurements. Generally measured in terms of benchmark (reference point)Generally measured in terms of benchmark (reference point)

Reliability: Reliability: how much % you can rely upon the proper functioning how much % you can rely upon the proper functioning of sys. Mean time between failure MTBF (frq of failure in of sys. Mean time between failure MTBF (frq of failure in hr/wk/mon) & mean time to repair MTTR ( how long the system hr/wk/mon) & mean time to repair MTTR ( how long the system is allowed to be out of order following a failure ) are the terms is allowed to be out of order following a failure ) are the terms used in defining the system reliabilityused in defining the system reliability

Page 68: embeded systems(unit 1)

Maintainability: Maintainability: deals with the support and deals with the support and maintenance to the end user in the case of maintenance to the end user in the case of technical issues and failures or on the basis of technical issues and failures or on the basis of a routine checkupa routine checkup

As reliability increases maintainability reduced As reliability increases maintainability reduced Two types (preventive or corrective Two types (preventive or corrective

maintenance)maintenance) User should replace the cartridge after n User should replace the cartridge after n

number of printouts (scheduled / periodic number of printouts (scheduled / periodic /preventive)/preventive)

If paper feeding part of the printer fails If paper feeding part of the printer fails required immediate repairs (maintenance to required immediate repairs (maintenance to unexpected failure/ corrective)unexpected failure/ corrective)

Ideal value for availability is expressed Ideal value for availability is expressed

A = MTBF / (MTBF + MTTR)A = MTBF / (MTBF + MTTR)

Page 69: embeded systems(unit 1)

SecuritSecurity : y : confidentiality( from confidentiality( from unauthorized disclosure), integrity unauthorized disclosure), integrity ( from unauthorized modification) , ( from unauthorized modification) , availability ( from unauthorized availability ( from unauthorized users)users)

SafetySafety: : deals with the possible deals with the possible damages that can happen to the damages that can happen to the operators or publicoperators or public

Eg. Due to breakdown or emission Eg. Due to breakdown or emission of radioactiveof radioactive

Page 70: embeded systems(unit 1)

Non operational quality Non operational quality attributesattributes

Attributes that needs to addressed for the product Attributes that needs to addressed for the product not on the basis of operational aspects not on the basis of operational aspects

Testability: & debug abilityTestability: & debug ability: : how easily one can how easily one can test her design and by which mean she can test it.test her design and by which mean she can test it.

h/w testing( peripherals and total h/w function) and h/w testing( peripherals and total h/w function) and firmware testing firmware testing

Debugging the product as such for figuring out the Debugging the product as such for figuring out the probable sources that create unexpected behavior probable sources that create unexpected behavior in the systemin the system

h/w level debugging ( issues created by h/w h/w level debugging ( issues created by h/w problems) and firmware debugging ( errors that problems) and firmware debugging ( errors that appear as a result of flaws in the firmware)appear as a result of flaws in the firmware)

EvolvabilityEvolvability: : related to biology. related to biology. Ease with which the embedded product can be Ease with which the embedded product can be

modified to take advantage of new f/w or h/w modified to take advantage of new f/w or h/w technologies technologies

Page 71: embeded systems(unit 1)

Portability :Portability : measure of system measure of system independenceindependence

If the product is capable of functioning If the product is capable of functioning as such in various environments as such in various environments processors/controllers/osprocessors/controllers/os

Product can be ported to a new Product can be ported to a new platformplatform

Should be flexible and portableShould be flexible and portable Assembly language portability is poorAssembly language portability is poor

Page 72: embeded systems(unit 1)

Time to prototype and Time to prototype and marketmarket

Time to marketTime to market: : time elapsed between time elapsed between the conceptualization of a product and the conceptualization of a product and time at which the product is ready for time at which the product is ready for sellingselling

It’s a critical factor because embedded It’s a critical factor because embedded technology is one where rapid technology is one where rapid technology change is happeningtechnology change is happening

Time to prototypeTime to prototype: : its an informal kind its an informal kind of rapid product development in which of rapid product development in which the important features of the product the important features of the product under consideration are developedunder consideration are developed

If prototype is developed faster, the If prototype is developed faster, the actual development time can be brought actual development time can be brought down significantly.down significantly.

Page 73: embeded systems(unit 1)

Per unit cost and revenue Per unit cost and revenue : : cost will be closely cost will be closely monitored by both end usersmonitored by both end users

Proper market study should be carried out Proper market study should be carried out before deciding per unit costbefore deciding per unit cost

During design and development only investment During design and development only investment no returnsno returns

Once the product is ready to sell and its Once the product is ready to sell and its introduced to the market – product introduction introduced to the market – product introduction stagestage

In growth phase product grabs high market In growth phase product grabs high market shareshare

During maturity phase the growth and sales During maturity phase the growth and sales will be steady and revenue reaches at its peakwill be steady and revenue reaches at its peak

Product retirement/decline phase starts with Product retirement/decline phase starts with the drop in sales volume, market share and the drop in sales volume, market share and revenuerevenue

At some point of decline stage the manufacturer At some point of decline stage the manufacturer announces discontinuing of the productannounces discontinuing of the product

Unit cost is very high during the introductory Unit cost is very high during the introductory stage stage