Embedded Systems Unit i

Embed Size (px)

Citation preview

  • 8/13/2019 Embedded Systems Unit i

    1/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Embedded System OverviewEmbedded systems spread out in all aspects of our daily lives, For example, alarm clocks, coffee makers

    digital watches, cell phones and automobiles.

    AnEmbedded system consists of hardware and software designed to solve a specific application.

    An Embedded system is an application that contains at least one programmable computer (MP or MCor DSP) to control multiple functionalities.

    Any embedded system that delivers output without any delay i.e. real time referred to as Real

    Time Embedded System or Embedded Real Time System (RTES/RTOS).Features of Embedded Systems Embedded systems do a very specific task; they cannot be programmed to do different things. Embedded systems have limited resources, particularly memory. It does not have secondary storagedevices such as CD-ROM, floppy disk.

    Embedded systems have to work against deadlines. If any deadline missed causes a catastrophe i.e. loss olife or damage to the device.

    Embedded systems need to be highly reliable. Embedded systems have to operate in extreme environmental conditions such as very high temperatureand humidity.

    Embedded system uses different operating systems and processors, so choosing the right platform are thamost complex task. Embedded systems are constrained for power, as many embedded systems operate through a battery, sothe power consumption has to be very low.

    Classification of Embedded SystemsEmbedded systems can be classified based on performance and functionalitiesas following:

    Standalone embedded systems

    Real time embedded systemsNetworked Information appliances

    Mobile devices

    Standalone Embedded Systems

    As the name implies, standalone systems work in standalone mode. They take inputs, process them andproduce the desired output.

    The input can be electrical signals from transducers or commands from human beings such as the pressinof a button.

    The output can be electrical signals to drive another system i.e. an LED, LCD for displaying informationto the users.

    Embedded systems used in process control, automobile, consumer electronic items etc fall in to thiscategory. Examples are digital camera, microwave oven, CD player, air conditioner, TV etc.

    Real-time Systems

    Embedded systems in which some specific work has to be done in a specific time period are calledReal-time systems. Meeting the deadlines is the important requirement of real-time systems.

    For example, consider a system that has to open a valve in 30ms when the humidity crosses a particularthreshold. If the valve is not opened with in 30ms a catastrophe (damage) may occur.

    Systems with strict deadlines cause severe damage to the device referred to as Hard real-time systems. In some embedded systems, deadlines are imposed though we miss the deadlines they should not sevre

    affect on the device referred to as Soft real-time systems.

    Consider an example a DVD player. Suppose if we give a command to the DVD player from a remotecontrol and if there is a delay in few milli seconds in executing the command, this wont lead to a serious

    damage to the device.

    Networked Information Appliances Embedded systems that are provided with network interfaces and accessed by networks such as LAN or

    Internet are calledNetworked Information Appliances.

  • 8/13/2019 Embedded Systems Unit i

    2/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Each embedded system can send real-time data to central location from where the entire process controlsystem can be monitored.

    A web camera can be connected to the internet. Web camera can send pictures in real-time to anycomputer connected to the internet. Example: Door locking system through web cam.

    Mobile Devices Mobile devices such as mobile phones, Personal Digital Assistants (PDAs), smart phones etc are special

    category of embedded systems.

    PDAs can do general purpose tasks; they need to be designed just like conventional embedded systems.

    The limitation of the mobile devices is that memory constraints, small size, lack of good user interfacessuch as full-fledged keyboard, display etc.

    Embedded systems can be classified based on integrationas following:

    Small scale embedded systemsMedium scale embedded systems

    Sophisticated embedded systems

    Small scale embedded systems These systems are designed with single 8/16 bit microcontrollers with little hardware and software

    complexities.

    When developing embedded software these can use editor, assembler, cross-assembler, IDE tools specifito microprocessor or microcontroller.

    Medium scale embedded systems These systems are designed with a single or few 16/32 bit microcontrollers, DSP or RISCs. For complex software design C, C++, Java, RTOS, simulator, debugger and IDE tools are used. Sophisticated embedded systems Sophisticated embedded systems have more hardware and software complexities and it needs several

    ASIPs, scalable and configurable processors and PLAs.

    Characteristics of embedded systems Resource constraints Embedded systems are constant for their speed, power, and CPU, speed an

    function capacity.

    Time constraint Real-time system has response time deadline to meet. Environmental constraints Extreme operating conditions such as high or low temperature, high humidity

    under water, under collision etc. Cost constraint Minimizing the cost is the primary design consideration, so the selected hardware should

    be good enough to cover the necessary functions.

    Time-to-market Design and development cycle is very limited in order to beat the competition to themarket.

    Reliability Embedded systems are often embedded in machines that are expected to run continuously forlong period without fault and tolerate the errors by them if an error occurs.

    Complex Algorithms The operation performed by the microprocessor may be very sophisticated. Forexample, the microcontroller has to control an automobile engine must perform complicated filtering

    functions to optimize the performance of the car, while minimizing pollution and fuel utilization.

    User Interface Microprocessors are used to control complex user interfaces that may include multiplemenus and many options. Examples are moving maps in global positioning system (GPS navigation).

    Multi-rate The real-time activities have to be controlled simultaneously that run at slow rates and othersthat run at high rate.

    For example, audio and video portions in multimedia streams run at different rates but they must remainclosely synchronized. Failure to meet a deadline spoils the perception of entire presentation.

    Distributed Many numbers of distributed embedded systems form a single large embedded control unit.Examples are Automatic vending machines, ATMs etc.

    In ATM different embedded units are :Card reader unit - Reading and validation of ATM cardTransaction unit - Performing transactions

    Currency counter - Dispatching currency

  • 8/13/2019 Embedded Systems Unit i

    3/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Printer - Printing transaction details

    Challenges of an embedded systemHow much hardware we need

    The choice hardware is important for designing an embedded system. The system fails to meet deadline

    if we use little hardware and it becomes too expensive if we use muchhardware, so choose the hardware basedon the exact functionality requirements.

    How do you meet deadlines?

    To meet the deadline, speed up the hardware, so that the program runs faster. However, the system will b

    more expensive.We can meet the deadline by increasing the CPU clock rate.

    How do you minimize power consumption?In battery operated device power consumption plays a major role. One way to make a digital system

    which consumes less power is to make it run slowly but slowing down the system can lead to miss the deadlines

    How do you design for upgradability?

    The product should be able to add features by changing the software.

    Purpose of an embedded systemEach embedded system is designed to serve the purpose of any one or a combination of the following tasks.

    Data collection/storage/representationData communication

    Data processingMonitoring

    ControlApplication Specific User Interface

    Data collection/storage/representation

    Data collection is usually done for storage, analysis, manipulation and transmission. Data can be either analog or digital. The collected data may be used directly in the system or may be transmitted to some other systems or ma

    be processed by the system or it may be deleted instantly after giving a meaningful representation.

    Embedded systems designed for pure measurement applications without storage, used in control andinstrumentation domain. Examples are analog and digital CROs without storage memory.

    Some embedded systems store the collected data for processing and analysis. Examples are measuringinstruments with storage memory such as ECG for medical applications.

    A digital camera is typical example of an embedded system with data collection, storage andrepresentation of data.

    Data communication Data collected by an embedded terminal may require transferring of data to the same or some other

    system located remotely.

    This transmission is achieved either by a wire or wireless medium. Examples are network hubs, routers, switches etc.Data Processing Embedded systems with signal processing functionalities are employed in applications demanding signal

    processing like speech coding, synthesis, and audio video codec transmission applications. Example:Digital hearing aid.

    Monitoring Almost all embedded products coming under medical domain are with monitoring purpose only. Example: ECG (Electro cardio gram) machine for monitoring the heart beat of a patient.Control Embedded systems with control functionalities impose control over some variable according to the

    change in input variables.

    A system with control functionalities contains both sensors and actuators. Sensors are connected to the input port for capturing the changes in environmental variable or measuring

    variable.

  • 8/13/2019 Embedded Systems Unit i

    4/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    The actuators connected to the output port. According to the changes in input variable put an impact oncontrolling variable to bring the controlled variable to the specified range. Example is air-conditioningsystem.

    Application Specific User Interface Embedded system with application specific user interfaces like buttons, switches, keypads, display units

    etc. Example is mobile phone.

    Application areas of embedded systems Consumer electronics: Camcorders, cameras etc.

    Household appliances:Television, DVD players, washing machine, fridge, microwave oven etc. Home automation and security systems: AC, sprinklers, intruder detection alarms, closed circuit televisio

    cameras, fire alarms etc.

    Automotive industry: Anti-lock breaking system (ABS), engine control, ignition systems, automaticnavigation system etc.

    Telecommunication: Cellular telephones, telephone switches, handset multimedia applications etc. Computer Peripherals: Printers, scanners, fax machines etc. Computer networking systems:Network routers, switches, hubs, firewalls etc. Healthcare: Different kinds of scanners, EEG, ECG machines etc. Measurement & Instrumentation: Digital multimeters, digital CROs, logic analyzers etc. Banking &retail: ATMs, currency counters, point of sales (POS)

    Card readers: Barcode reader, smart card reader, handheld devices etc.Quality attributes of an embedded system (Design metrics) The quality attribute is a measurable feature of a system implementation. Embedded system designs dependent on mainly power, performance, size and NRE cost. For example, in order to improve performance more components are used then power consumption, size

    of the board increases, so while design we have to compensate all these features.Quality attributes for embedded system development can be classified in to two types:

    Operati onal Qual ity attributes

    Non operational Quali ty attri butes

    Operational quality attributesThese attributes represent the relevant quality attributes to the embedded system when it is in the

    operational mode. The quality attributes under this category are:1. Response2. Throughput3. Reliability4. Maintainability5. Security6. Safety

    Response

    Response is a measure of quickness of the system i.e. how fast the system is tracking the changes in inpu

    variables.

    For example, flight control applications (Response time should be high)

    Electronic toy (Response time is not necessary)ThroughputThroughput deals with the efficiency of the system. Itis defined as processes that can be performed ove

    a period of time.

    Card readerHow many transactions the reader can perform in a minutes.

    Reliability Reliability is a measure of how much percent we can rely up on proper functioning of the system or

    system failures.

    Mean Time Between Failures (MTBF)gives the frequency of failures in hours/weeks/months. Mean Time To Repair (MTTR)specifies how long the system is allowed to be out of order following a

    failure.

    Maintainability

  • 8/13/2019 Embedded Systems Unit i

    5/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Maintainability deals with support and maintenance to the end user or clients in case of technical issuesand product failures or on the basis of system check up.

    A more reliable system means a system with less corrective, maintainability requirements i.e. if thereliability of the system increases the chances of failure and non-functioning also reduces, thereby the

    need for maintainability is also reduced.

    Security

    Confidentiality, Integrity and Availability are the three measures of information security. Confidentiality Deals with the protection of data and application from unauthorized disclosure. Integrity deals with the protection of data and application from unauthorized modification. Availability deals with the protection of data and application from unauthorized user.

    Safety Safety deals with the possible damage that can happen to the operators, public and environment due to th

    breakdown of the embedded systems. The breakdown of an embedded system may occur due to hardwar

    or firmware failure.

    Non-operational Quality attributes These attributes are used to measure the system is not in non-function of the system. The quality attribut

    under this category are :

    1. Testability and debug ability2. Evolvability3. Portability4. Time-to-prototype and market5. Per unit cost and total cost6. Non-recurring Engineering cost (NRE cost)

    Testabil ity and debug abil ity Testability deals with how easily one can test the design functionality. The testability is applicable for

    both embedded hardware and firmware.

    Debug ability finds the probable sources that create unexpected behavior in the system. Hardware debugging is used for figuring out the issues created by specific component whereas firmware

    debugging is employed to figure out the probable errors in the firmware.

    Evolvability Evolvability refers to which the embedded product can be modified to take advantage of new firmware o

    hardware technologies.

    Portability Portability is a measure of system independence. An embedded product is said to be portable, if the

    product is capable of functioning in various environments, target processors/controllers and embedded

    operating system.

    Time-to-prototype and market Time-to-market is a time elapsed between the concept of a product and the time at which the product is

    ready for selling, so the product should be designed in a less time period.

    Prototyping can provide the replica of the actual design, by using this we can test the important features othe product to be designed.

    If the prototype is developed faster than the actual development time can be reduced significantly.NRE Cost

    The one time monetary cost for designing the system. Once the system is designed any number of unitscan be manufactured without incurring any additional cost.

    Per Unit Cost and total Cost

    Unit cost refers to the monetary cost of manufacturing each copy of the system excluding NRE cost.Product life cycle:

    Every embedded product has a product life cycle which starts with the design and development phase. During the design and development phase there is only investment and no returns. In the product introduction stage, product is ready to sell. During this period, the sales and revenue will b

    low. If there is less competition in the market then sales and revenue increases with time.

    In the growth phase, the product grabs high market.

  • 8/13/2019 Embedded Systems Unit i

    6/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    During the maturity phase, the sales will be steady and revenue reaches at its peak. In the product retirement phase, there will be drop in sales, market share and revenue, sometimes the

    production of the product will be stopped due to loss.

    Core of the embedded systemA typical embedded system contains a single chip controller which acts as the master brain of the

    system.

    Embedded systems are domain and application specific which are built around a central core. The core of the embedded system are categorized in to four types:

    General purpose and domain specific processorsApplication specific Integrated Circuits (ASICS)

    Programmable Logic Devices (PLDs)

    Commercial Off-the-shelf Components (COTS)

    Typical Embedded SystemGeneral purpose and domain specific processors

    Depending on the domain and application the processor may be a microprocessor or microcontroller or v A general purpose processor is designed to solve problems in large variety of applications such as

    communications, automotive and industrial embedded systems.

    Microprocessors

    The CPU is a unit that centrally fetches and processes a set of general purpose instructions. The CPUinstruction set includes the instructions for data transfer operations, ALU operations so on.

    Microcontrollers

    A microcontroller is an integrated chip that has processor, memory and several other hardware units. Microcontrollers are particularly suitable for use in embedded system for real-time applications with on-

    chip program memory and devices.

    Functional units on microcontroller such as processor, internal RAM, timers, internal flash or ROM, I/Oports etc.

    Note: Microprocessor is used when large embedded software has to be located on external memory chipswhereas microcontrollers is used when a small or part of embedded software has to be located in the internal

    memory.

    Appli cation Specif ic I nstruction Set Processor (ASSP)

    ASIPs are processors with architecture and instruction set optimized to specific domain or applicationrequirements like network processing, telecom, media applications etc.

    Digital Signal Processors (DSPs)

    These processors have been designed based on modified Harvard architecture to handle real-time signalsThe features of these processors are suitable for implementing signal processing.

    DSPs are two to three times faster than general purpose processors, since DSPs implement algorithms inhardware which speed up the execution, whereas processors implement algorithm in firmware.

  • 8/13/2019 Embedded Systems Unit i

    7/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Advantages

    Time to market is low NRE cost is low Flexibility is high Unit cost will be low

    Drawbacks Large size More power consumption Large register fileAppli cation Specif ic Integrated Cir cuits (ASICS)

    A single purpose processor is a digital circuit designed to execute exactly one program. For example, digital camera. In digital camera, except microcontroller all the components are single

    purpose processors (JPEG CODEC)

    Advantages

    Small size Less power consumption No program memory

    Limitations

    No flexibility Unit cost is high NRE cost is high Time to market is highProgrammable Logic Devices (PLDs)

    The PLDs provide specific functions including device to device interfacing, data communication, signalprocessing, data, display timing and control operations.

    In PLD technology, all layers already exists, so by providing the connectivity between the layersdepending on application requirement we can develop the product quickly.

    Advantages

    Low NRE cost Flexibility is available compared with ASICS

    Limitations Unit cost is high Power consumption is highCommercial Off-the-shelf Components (COTS) COTS products are designed in such a way to provide easy integration and interoperability with existing

    system components.

    For exampleRemote controlled toyRF circuitry, UV/IR detectors, ADC, High performance circuits etcAdvantages

    Readily available in the market Time to market Cheaper Development time is greatly reduced

    Drawbacks

    User has to stic-on single vendor. If vendor discontinues production, component availability is difficult.MEMORY

    The memory is divided into two categories: program memory and data memory. The program memory storthe firmware permanently whereas data memory contents are erased when power is switched off. Both progra

    and data memory can be internal or external to the processor. Memory chips are classified as Random Acce

    Memory (RAM) and Read Only Memory (ROM).

    Read Only Memory (ROM)

  • 8/13/2019 Embedded Systems Unit i

    8/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    This is a nonvolatile memory. It can only be read from but not written to, by a processor in an embeddesystem.

    Uses

    Store software program for general-purpose processor

    Store constant data needed by systemImplement combinational circuit

    Mask-programmed ROM (MROM)The connections programmed at fabrication. They are a set of masks. It can be written only once (in th

    factory). But it stores data for ever. Thus it has the highest storage permanence. The bits never change unledamaged. The limitation with MROM based firmware storage is inability to modifythe device firmware again

    firmware upgrades.

    Programmable ROM (PROM)/ (OTP)The Connections programmed after manufacture by user. The user provides file of desired contents of ROM

    The file input to machine called ROM programmer. Each programmable connection is a fuse. The ROM

    programmer blows fuses where connections should not exist.

    Very low write ability: typically written only once and requires ROM programmer device Very high storage permanence: bits dont change unless reconnected to programmer and more fuses blown

    Commonly used in final products: cheaper, harder to inadvertently modify.Erasable Programmable Read Only Memory (EPROM)OTPs are not useful for development phase. During the development phase, the firmware designer can mak

    several changes to firmware and using an OTP each time to load the code is not economical. EPROM gives th

    flexibility to re-program the same chip. Bit information is stored by applying high voltage to charge the fusin

    gate and the stored information can be erased by applying UV rays for a fixed duration then entire data on thmemory can be erased. In order to erase it is exposed to UV rays for 20-30 minutes, so it is a time consumin

    process.

    Better write ability: can be erased and reprogrammed thousands of times Reduced storage permanence: program lasts about 10 years but is susceptible to radiation and electric noise

    Typically used during design development.

    Electrically Erasable Programmable Read Only Memory (EEPROM)It is erased typically by using higher than normal voltage. It can program and erase individual words unlike thEPROMs where exposure to the UV light erases everything.

    Better write ability: can be in-system programmable with built-in circuit to provide higher than normal voltag

    Built-in memory controller commonly used to hide details from memory userwrites very slow due to erasing and programming

    can be erased and programmed tens of thousands of times

    The only limitation is their capacity is limited when compared with the standard ROM (few kilobytes only)

    Flash MemoryIt is an extension of EEPROM. It has the same floating gate principle and same write ability and storag

    permanence. It can be erased at a faster rate i.e. large blocks of memory erased at once, rather than one word at

    time. The blocks are typically several thousand bytes large

  • 8/13/2019 Embedded Systems Unit i

    9/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Writes to single words may be slower

    Entire block must be read, word updated, then entire block written back Used with embedded systems storing large data items in nonvolatile memory

    e.g., digital cameras, TV set-top boxes, cell phones

    Random-access memory (RAM)

    Typically volatile memory

    bits are not held without power supply Read and written to easily by embedded system during execution

    Internal structure more complex than ROM

    a word consists of several memory cells, each storing 1 biteach input and output data line connects to each cell in its column

    RAM generally falls in to three categories: Static RAM (SRAM), Dynamic RAM (DRAM) and Nonvolatile RAM (NVRAM)

    Static RAM (SRAM)

    Memory cell uses flip-flop to store bit Requires 6 transistors (4 for building flip flop and 2 for control) Holds data as long as power supplied. It is fast in operation due to its resistive networking and switching capabilities. The major limitations of SRAM are low capacity and high cost.Dynamic RAM (DRAM)

    DRAM stores data in the form of charge. Memory cell uses MOS transistor and capacitor to store bit. More compact than SRAM The advantages of DRAM are high packing density and low cost compared to SRAM Refresh required due to capacitor leak. Special circuits called DRAM controllers are used for th

    refreshing operation. Slower to access than SRAM.

    Nonvolatile RAM(NVRAM)

    Holds data after external power removed. Battery-backed RAM SRAM with own permanently connected battery. Writes as fast as reads. No limit on number of writes unlike nonvolatile ROM-based memory. SRAM with EEPROM or flash stores complete RAM contents on EEPROM or flash before power.Sensors and ActuatorsEmbedded systems need to convert real-life information into equivalent electric signals. This can be achieve

    through sensors and actuators.Transducer

    A device that converts a primary form of energy into a corresponding signal with a different energy form.

  • 8/13/2019 Embedded Systems Unit i

    10/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Primary Energy Forms: mechanical, thermal, electromagnetic, optical, chemical, etc.

    Transducers take form of a sensoror an actuatorSensorsA sensor is a transducer device that converts energy from one form to another for any measurement o

    control purpose.A sensor is a device that outputs a signal which is related to the measurement of (i.e. is a function of) a physic

    quantity such as temperature, speed, force, pressure, displacement, acceleration, torque, flow, light or sound.

    Actuator is a form of transducer device (mechanical or electrical) which converts signals tcorresponding physical action.Sensors classified as Analog and Digital sensors. Analog sensors are widely available and their outpu

    are analog voltages. For example, the output of an analog temperature sensor may be a voltage proportional to th

    measured temperature. Analog sensors can only be connected to a computer by using an A/D converter.

    Digital sensors are not very common and they have logic level outputs which can directly be connected

    a computer input port.The choice of a sensor for a particular application depends on many factors such as the cos

    repeatability, required accuracy, resolution, range and linearity of the sensor.

    Range The range of a sensor specifies the upper and lower limits of the measured variable for which

    measurement can be made. For example, if the range of a temperature sensor is specified as 1060C then th

    sensor should only be used to measure temperatures within that range.ResolutionThe resolution of a sensor is specified as the largest change in measured value that will not result in

    change in the sensors output, i.e. the measured value can changeby the amount quoted by the resolution beforthis change can be detected by the sensor. In general, the smaller this amount the better the sensor is, and sensor

    with a wide range have less resolution. For example, a temperature sensor with a resolution of 0.001K is bett

    than a sensor with a resolution of 0.1K.

    RepeatabilityThe repeatability of a sensor is the variation of output values that can be expected when the senso

    measures the same physical quantity several times. For example, if the voltage across a resistor is measured at th

    same time several times we may get slightly different results.

    LinearityAn ideal sensor is expected to have a linear transfer function, i.e. the sensor output is expected to bexactly proportional to the measured value. However, in practice all sensors exhibit some amount of nonlineari

    depending upon the manufacturing tolerances and the measurement conditions.Dynamic responseThe dynamic response of a sensor specifies the limits of the sensor characteristics when thsensor is subject to a sinusoidal frequency change. For example, the dynamic response of a microphone may b

    expressed in terms of the 3-dB bandwidth of its frequency response.

    Temperature sensors Temperature sensors convert the temperature into an equivalent electrical voltage. Thoutput of the sensor is a signal whose voltage level is proportional to the temperature.

    Temperature sensors can be analog or digital. Analog temperature sensors are: thermocouples, resistantemperature detectors (RTDs) and thermistors. Digital sensors are in the form of integrated circuitMeasurement of temperatures in air-conditioners, boilers, coffins etc.

    Thermocouples are best suited to very low and very high temperature measurements. The typic

    measuring range is from 270C to +2600C.Thermocouples do not require external power for operation.RTDsare used in medium-range temperature measurements, ranging from 200

    C to +600

    C. They cabe used in most chemical environments but they are not as robust as thermocouples. The typical accuracy

    RTDs is 0.2C. They require external power for operation.

    Thermistorsare used in low- to medium-temperature applications, ranging from 50C to about +200C

    Thermistors are also low-cost devices, they require external power for operation, and they have an accuracy o0.2C.

    Integrated circuit temperature sensorsare used in low-temperature applications, ranging from 40

    to +125C. These devices can be either analog or digital, and their coupling with the environment is not vegood. The accuracy of integrated circuit sensors is around 1C.

    Position sensors

  • 8/13/2019 Embedded Systems Unit i

    11/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Position sensors are used to measure the position of moving objects. These sensors are basically of two type

    sensors to measure linear movement, and sensors to measure angular movement. Potentiometers are available linear and rotary forms.Among other types of position sensors are capacitive sensors, inductive sensors, linevariable differential transformers (LVDTs) and optical encoders.

    Velocity and acceleration sensorsVelocity is the differentiation of position, and in general position sensors can be used to measure velocity. Th

    required differentiation can be done either in hardware (e.g. using operational amplifiers) or by the computer. Fo

    more accurate measurements velocity sensors should be used. There are two types of velocity sensors: line

    sensors, and rotary sensors. Tachometeris an example for rotary velocity sensors.Acceleration is the differentiation of velocity, or the double differentiation of position. Thus, in genera

    position sensors can be used to measure acceleration. The differentiation can be done either by using operationamplifiers or by a computer program. For accurate measurement of the acceleration, semiconducto

    accelerometers can be used. For example, the ADXL202 is an accelerometer chip manufactured by Analo

    Devices Inc.

    Force sensorsForce sensors can be constructed using position sensors. Alternatively, a strain gauge can be used to measur

    force accurately. A Wheatstone bridge is commonly used to detect the small changes in the resistance of th

    strain gauge. Strain gauges can be used to measure force, load, weight pressure, torque or displacement.Force can also be measured using the principle of piezoelectricity. A piezoelectric sensor produc

    voltage when a force is applied to its surface. The disadvantage of this method is that the voltage decays after thapplication of the force and thus piezoelectric sensors are only useful for measuring dynamic force.

    Pressure sensorsPressure sensors convert the pressure level to voltage level. The movement is converted into an electrical sign

    which is proportional to the applied pressure. Strain gauges, capacitance change, inductance change, piezoelectreffect, optical pressure sensors and similar techniques are used to measure the pressure. Pressure sensors are use

    in blood pressure equipment and to measure altitude of aircraft, ocean depth etc.

    Liquid sensorsThere are many different types of liquid sensors. These sensors are used to:

    detect the presence of liquid;

    measure the level of liquid;

    measure the flow rate of liquid,for example through a pipe.The presence of a liquid can be detected by using optical, ultrasonic, change of resistance, change o

    capacitance or similar techniques. For example, optical technique is based on using an LED and a photo

    transistor.

    Microphone and Speakers: Microphone converts the acoustic energy in to a voltage signal. When we speak i

    to a microphone, the output of the microphone is an electrical signal with continuously varying amplitude. Th

    speakers convert the electrical signal back in to acoustic waves.

    Video camera and monitor: The real-life image or scenery is converted in to electrical signal using a vide

    camera. The video camera output is a continuously varying electrical signal. The electrical signal is converte

    back to the image on a monitor.

    Communication Interfaces Communication interface is essential for communicating with various subsystems of the embedded

    system and with the external world.

    Communication interface can be categorized in to two types for an embedded product:Device or Board level communication interface (On-board communication interface)

    Product level communication interface (External communication interface)

    On-board communication interface On-board communication interface refers to the different communication channels/buses for

    interconnecting the various integrated circuits and other peripherals within the embedded system. I2C BUS SPI BUS

  • 8/13/2019 Embedded Systems Unit i

    12/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    UART 1-WIRE INTERFACE PARALLEL INTERFACEInter Integrated Circuit Bus (I

    2C BUS)

    TheI2C BUSwas designed to provide an easy way of connection between a microprocessor ormicrocontroller system and the peripheral chips.

    It is a synchronous bi-directional two-wire serial interface bus.Features Two bus lines are required i.e. serial data line (SDA) and serial clock line (SCL).

    Each device is provided with unique address and simple master and slave relationships exist at all times. It is a true multi-master bus including collision detection and arbitration to prevent data corruption if two

    or more masters simultaneously initiate data transfer. Serial 8-bit oriented data transfer can be made at 100 kbps in Standard mode, 400kbps in Fast mode and

    3.4Mbps in High speed mode. Number of ICs that can be connected to the same bus is limited by the maximum bus capacitance.

    I2

    C BUSI2C BUS Signals

    SDA SDA is responsible for transmitting the serial data across the devices.SCL SCL is responsible for generating synchronous clock pulses.START High-to-Low transition of the SDA line while SCL line is high.ACK Receiver pulls SDA line LOW transmitter allows it to float.DATA Transition take place while SCL is LOW.STOPLow-to-High transition of the SDA line while SCL line is high.

    Devices connected to theI2C BUS can act as master or slave device. The master device is responsible for controlling the communication by initiating and terminating data

    transfer, sending data and generating necessary synchronization clock pulses.

    The address of aI2C device is provided while hardwiring at the time of designing the embedded hardwar The slave device waits for the commands from the master and responds up on receiving the commands.Sequence of Operation

    After initiating data transfer by START condition, the master sends the address of the slave device towhich it wants to communicate over a SDA line. The master device sends Read/Write bit (RD=1, WR=0

    along with slave address.

    Slave devices connected to the bus compares the address received to the address assigned to them. If anyof the devices address matches with address sent by master on SDA line responds to master by sending

    ACK bit.

  • 8/13/2019 Embedded Systems Unit i

    13/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Up on receiving ACK bit master device sends 8-bit data to the slave device over SDA line if the requesteoperation is write to device. If the operation is read, the slave device sends data to the master over SDAline.

    After completion of data transfer and successful reception of data slave device sends ACK bit to themaster.

    The master device terminates the master by pulling SDA and SCL line to High to indicate STOPcondition.

    Advantages of l2C

    Good for communication with on-board devices that are accessed occasionally. Easy to link multiple devices because of addressing scheme. Cost and complexity do not scale up with the number of devices.Disadvantage of l

    2C

    The complexity of supporting software components can be higher than that of competing schemes (for exampleSPI).

    Applications of l2C

    Used as a control interface to signal processing devices those have separate data interfaces, e.g. RF tuners, videdecoders and encoders, and audio processors.

    Serial Peripheral Interface (SPI) busThe SPI bus is a synchronous bi-directional full duplex four-wire serial interface bus. SPI is a single mast

    multi-slave system.Signal lines for SPI busMaster Out Slave In (MOSI) Signal line carrying the data from master to slave device.

    Master In Slave Out (MISO) Signal line carrying the data from slave to master device.

    Serial Clock (SCLK) Signal line carrying the clock signals.

    Slave Select (SS) Signal line for slave device select.

    The master device is responsible for generating the clock signals. It selects the required slave device basserting corresponding slave devices slave select signal as LOW and data out line of all the slav

    devices in high impedance state.

    SPI devices contain a certain set of registers. The serial peripheral control register holds variouconfiguration parameters like master/slave selection for the device, baud rate selection fo

    communication, clock signal control etc.

    The status registerholds the status of various conditions for transmission and reception. SPI works on the principle of SHIFT REGISTER for the data to transmit or receive. During transmission from master to slave, the data in masters shift register is shifted out to MOSI pin an

    it enters the shift register of slave device through MOSI pin of slave device.

  • 8/13/2019 Embedded Systems Unit i

    14/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    During transmission for slave to master, the shifted out data enters the shift register of master devicthrough MISO pin.

    SPI bus is suitable for applications requiring transfer of data instreams. The limitation of SPI bus is that it does not supportAcknowledgement mechanism.

    Universal Asynchronous Receiver Transmitter (UART) UART based data transmission is an asynchronous form of serial data transmission i.e. it does not require

    clock signal to synchronize the transmitting end and receiving end for transmission.

    The serial communication settings for both transmitter and receiver should be identical (baud rate, paritystart, stop) While sending a byte of data, a start bit is added first and stop is added at the end of the data stream, necessary parity bit is also included for error checking.

    The UART of the receiving device discards the start, stop and parity bit from the received bit streamand provides only serial data.

    For proper communication, the Transmit line of sending device is connected to the Receive line oreceiving device.

    UART provide hardware handshaking signals to support control over serial data flow. Most of the processors/controllers are integrated UART built-in to support serial data transmission anreception.

    1-Wire Interface 1-Wire Interface is an asynchronous half duplex communication protocol developed by Maxim DallaSemiconductor referred to asDallas 1-Wire Protocol. It has single signal line called DQ for Communication and follows the master-slave communicatiomodel.

    It supports one master multiple slave device communication on the bus. 1-wire allows power to be sent on the same signal wire. Every 1-wire device has unique 64-bit identification number for addressing each individual device on thbus.

    The identifier has three parts: 8bit family code, 48bit serial number and an 8bit CRC code.

    1-WIRE INTERFACESequence of operation

    o The master device sendsRESETpulse (pulling 1-wire to LOW) on the 1-wire bus.o The slave devices present on the bus respond with a Presence pulse. o The master device sends ROM command (64-bit address). This addresses the slave device to which

    wants to initiate a communication.

    o The master can only initiate a Read data/Write data from the device or to the device. The master devicsends read/write command to read/write the internal memory or register of the slave device.

    o The communication over 1-wire bus is divided into timeslots of 60microseconds.Note:480s for reset pulse, slave responds last 60s of reset pulse; for writing bit 1 by master 1 to 15s the

    release and for writing bit 0 minimum of 1 timeslot and maximum of 2 time slots. To read a bit from slave

  • 8/13/2019 Embedded Systems Unit i

    15/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    to 15s. If slave wants to send bit1 releases the bus for rest of time slot and for bit 0 pulls the bus to low fo

    the rest of time slot.

    Parallel Interface The on-board parallel interface is used for communicating with peripheral devices which are memormapped to the host system.

    The host processor/controller contains a parallel bus and the device supports parallel bus can directlconnect to the bus system.

    The communication through parallel bus is controlled through control signals i.e. read/write and devicselect. Each device contains device select line and device becomes active when it is asserted by the hoprocessor.

    The direction of data i.e. from host to the device and device to the host is controlled by Read/Wricontrol signal and the processor has control over this signal.

    An address decoder circuit is used for generating the chip select signals for the device. Parallel communication is host processor initiated, so if device wants to initiate the communication, thedevice has to inform the processor through interrupts.

    The width of the parallel interface is determined by the data bus width of the host processor (4bit, 8bi16bit, 32bit, 64bit). The bus width of the host and device should be the same.

    External Communication InterfacesThe external communication interface refers to the different communication channels/buses used by th

    embedded system to communicate with the external world.

    RS 232 C and RS485 RS-232C (Recommended Standard number 232 revision C) developed by Electronic Industry Associatio

    (EIA). RS-232 extends UART communication signals for external data communication. It is a full duple

    wired asynchronous serial communication.

    As per EIA standard logic low is represented with +3 and +25v called Space and logic high with -3 and25v called Mark.

    RS-232 supports two different types of connectors,DB-9 connector and DB-25 connector. RS-232 provides various handshaking and control signals for proper data flow of communication apa

    from transmit and receive signals.

    In RS-232, the devices involved for data communication are called Data Communication Equipme(DCE) and Data Terminal Equipment (DTE).

    RS232 INTERFACE

  • 8/13/2019 Embedded Systems Unit i

    16/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Control signals for proper data flowo Request To Send (RTS) When DTE wants to send data to DCE RTS is activated.o Clear To Send (CTS) CTS is activated when DCE is ready to accept the data.o Data Terminal Ready (DTR) DTR is activated by DTE when it is ready to accept data.o Data Set Ready (DSR) DSR is activated by DCE when it is ready for establishing

    communication link.

    o Data Carrier Detect (DCD) DCD is used by the DCE to indicate the DTE that a good signal being received.

    o Ring Indicator (RI) RI signal for indicating an incoming call on the telephone line. RS-232 supports only point-to-point communication and not suitable for point-to-multi-dro

    communication. EIA introduced another version RS-422 which supports point-to-multi-dro

    communication i.e. with one transmitter device and receiver devices up to 10.

    RS-485 is enhanced version of RS-232 which supports multi-drop communication with 32 transmittindevices and 32 receiving devices on the bus.

    Universal Serial Bus (USB) USB is a wired high speed serial bus for data communication. The USB communication system follow

    star topology with a USB host at centre and one or more peripherals connected to it.

    A USB host can support up to 127 slave peripheral devices and other USB hosts. USB transmits data in packet format. The USB communication is a host initiated one.

    The USB host controller is responsible for controlling the data communication, establishing connectivitpacketizing and formatting the data.

    The USB standard uses two different types of connector at the ends of the USB cable. Type A connectois used for upstream connection(connection with host, ex: PC, laptop) and Type B connectoris use

    for downstream connection(connection with slave device).

    USB interface has the ability to carry power to the connecting devices (GND and VBUSpins). Each USB device contains a product ID (PID) which is embedded in to the USB chip by the manufacture

    and vendor ID (VID) is supplied by the USB standards forum. These are essential for loading drivers toUSB device for communication.

    USB supports four different types of data transfers i.e. Control, Bulk, Isochronous and Interrupt.o Control transfer is used by USB system software to query, configure and issue commands to th

    USB device.

    o Bulk transfer is used for sending a block of data to the device. It supports error checking ancorrection. (Ex: transfer data to printer)

    o Isochronous transfer, data is transmitted in streams in real-time. It does not support errchecking and re-transmission of data. (Ex: Audio devices)

    o Interrupt transfer is used for transferring small amounts of data. This mechanism uses pollintechnique to see whether USB device has any data to send. (Ex: Data from mouse or keyboard)

    IEEE 1394 (FIREWIRE) IEEE 1394 is a wired, isochronous high speed serial communication. It is also known as Hig

    Performance Serial Bus (HPSB).

  • 8/13/2019 Embedded Systems Unit i

    17/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    IEEE 1394 provides plug and play capability and host insertion capability. IEEE 1394 is a popular communication interface for connecting embedded devices like digital camer

    camcorder, and scanners to desktops for data transfer and storage.

    It supports peer-to-peer and point-to-multipoint communication allowing 63 devices to be connected othe bus and each device is provided 6-bit identification number.

    Unlike USB interface it does not require a host for communicating between devices. The hardware implementation for IEEE 1394 is much costlier than USB implementation.

    The protocol architecture for the communication between devices is as follows:o Physical layer This layer specifies the electrical and mechanical connections. Bus initializatio

    and arbitration are the functions of this layer and ensures that only one device transmits data at

    time.

    o Data link layer This layer takes care of packet delivery, acknowledgements and addressing othe devices.

    o Transaction layerThis layer handles the writing and reading of the data from the devices.o Management protocols These protocols are used to manage the bus and they run on each of th

    devices.

    Infrared (IrDA) Infrared (IrDA) is a serial half duplex, line of sight based wireless technology communication betwee

    devices.

    Infrared interfaces are used in remote control units of TV, VCR, air-conditioner etc. IrDA is a populinterface forfile exchange and data transfer in low cost devices.

    Infrared communication technique uses infrared waves of electromagnetic spectrum for transmitting data

    Infrared Data Association (IrDA) supports point-point and point-to-multipoint communicatioprovided all devices are in line of sight.

    Infrared interface is classified in to various types based on different data rates:IR Type Data rate

    Serial IR (SIR) 9600 to 115.2kbps

    Medium IR (MIR) 0.576Mbps and 1.152Mbps

    Fast IR (FIR) 4Mbps

    Very Fast IR (VFIR) 16Mbps

    Ultra Fast IR (UFIR) 100Mbps (under development)

    IrDA communication involves a transmitter unit for transmitting the data over IR, LED can be used asIR source for transmitter and receiver unit for receiving data, photo diode acts as a receiver. IrDA is responsible for defining and licensing the specifications for IR data communications. It has tw

    essential parts:

    o Physical link part is responsible for the physical transmission of data between devices supportinIR communication.

    o Protocol part is responsible for defining the rules of communication. The drawback with infrared is that it operates in line of sight communication mode and it cannot penetra

    through walls. It supports only data.

    Bluetooth (BT)

  • 8/13/2019 Embedded Systems Unit i

    18/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    Bluetooth is a low cost, low power, short range wireless technology for data and voice communicationBluetooth enabled devices contain a Bluetooth wireless radio for the transmission and reception of data.

    Bluetooth supports point-to-point and point-to-multipoint wireless communication. Bluetooth device hasunique identification number.

    A Bluetooth device can function as either master or slave. When a network is formed by master and onor more slave devices referred to as Piconet. A piconets supports a maximum of seven slave devices.

    Bluetooth technology is the easiest communication channel for transferring ringtones, music filepictures, media files etc among cell phone users.

    The Generic Access Profile (GAP) defines the requirements for detecting a Bluetooth device anestablishing connection with it.

    The Serial Port Profile (SPP) is used for serial data communication. File Transfer Protocol (FTP) for fitransfer between devices. Human Interface Device (HID) for supporting human interface devices likkeyboard and mouse.

    Wi-Fi Wi-Fi or Wireless Fidelity communication technique for networked communication devices whic

    supports Internet Protocol (IP) based communication. Each device is identified by an IP address which

    unique to each device on the network.

    Wi-Fi based communication requires an intermediate agent called Wi-Fi router/Wireless Access Poi(WAP).

    Wi-Fi router is responsible for :

    o Restricting the access to a network.o Assigning IP address to devices on the network.o Routing the data packets to the intended devices on the network.

    Wi-Fi enabled devices contain a wireless adaptor for transmitting and receiving data in the form of radisignals through an antenna called Wi-Fi Radio.

    Wi-Fi radio is turned ON, searches the available networks and lists out the Service Set Identifier (SSID) the available networks and if network is security enabled then password is required to connect to

    particular SSID.

    For securing the data, Wi-Fi uses security mechanisms such as Wired Equivalency Privacy (WEPWireless Protected Access (WPA) etc.

    Wi-Fi supports data rates ranging from 1Mbps to 150 Mbps and offers a range of 100 to 300 feet.Zigbee Zigbee is a low power, low cost, low data rate and secure applications for wireless Personal Are

    Networking (WPAN)

    Zigbee devices:o Zigbee Coordinator The Zigbee Coordinator acts as the root of the Zigbee network and

    responsible for initiatingthe Zigbee network and it has the capability to store informationabo

    the network.

    o Zigbee Router (ZR) Full Function Device (FFD) The Zigbee Router (ZR) is responsible fpassing information from device to another device or another ZR.

  • 8/13/2019 Embedded Systems Unit i

    19/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

    o Zigbee End Device (ZED)/ Reduced Function Device (RFD) The Zigbee End Device (ZEDcan provide functionality for data communication. It can communicate with ZR or ZC and donot have capability to act as a mediator for transferring data from one device to another.

    ZIGBEE Network Model

    Zigbee application areas are home and industrial and automation, medical/patient tracking, smokdetectors, heating control etc.

    General Packet Radio Service (GPRS) GPRS is a communication technique for transferring data over a mobile communication network lik

    GSM. Data is sent as packets in GPRS communication. GPRS is mainly used by mobile enableembedded devices for data communication.

    The transmitting device splits data in to several packets and at the receiving end the data is re-constructeby combining the received data packets.

    In GPRS communication, radio channel is shared between several users, so channel is divided in to 8 timslots and transmits data over the available channel.

  • 8/13/2019 Embedded Systems Unit i

    20/21

    EMBEDDED SYSTEMS

    SV COLLEGE OF ENGINEERING DEPARTMENT OF ECE

  • 8/13/2019 Embedded Systems Unit i

    21/21

    EMBEDDED SYSTEMS