EMBEDDED SYSTEM DESIGN                                                                       UNIT I
EMBEDDED SYSTEM
       An embedded system is an electronic/electro-mechanical system designed to perform a
specific function and is a combination of both hardware and firmware (software).
       Every embedded system is unique, and the hardware as well as the firmware is highly
specialized to the application domain. Embedded systems are becoming an inevitable part of any
product or equipment in all fields including household appliances, telecommunications, medical
equipment, industrial control, consumer products, etc.
EMBEDDED SYSTEMS VS GENERAL COMPUTING SYSTEMS
Criteria          General Purpose Computer               Embedded System
Contents          A system which is a combination of     A system which is a combination of
                  a generic hardware and a General       special purpose hardware and embedded
                  Purpose Operating System for           OS/firmware for executing a specific set
                  executing a variety of applications.   of applications
OS                It     contains       a                It     may or         not    contain an
                         general purpose operating              operating system for functioning.
                  system (GPOS).
Alterations       Applications are alterable by the      Applications are      not-alterable by
                  user.                                  the user.
Key factor        Performance is key factor.             Application specific requirements are
                                                         key factors.
Power             More                                   Less
Consumption
Response Time     Not critical                           Critical for some applications
Execution         Need not be deterministic              Deterministic for certain types of ES
                                                         Like ‘Hard Real Time’ systems.
EMBEDDED SYSTEM DESIGN                                                                 UNIT I
HISTORY OF EMBEDDED SYSTEMS
        Embedded systems were in existence even before the IT revolution. In the olden days,
embedded systems were built around the old vacuum tube and transistor technologies and the
embedded algorithm was developed in low level languages.
        Advances in semiconductor and nano-technology and IT revolution gave way to the
development of miniature embedded systems. The first recognized modern embedded system is
the Apollo Guidance Computer (AGC) developed by the MIT Instrumentation Laboratory
for the lunar expedition.
        They ran the inertial guidance systems of both the Command Module (CM) and the
Lunar Excursion Module (LEM). The Command Module was designed to encircle the moon
while the Lunar Module and its crew were designed to go down to the moon surface and land
there safely.
        The first mass-produced embedded system was the guidance computer for the
Minuteman-I missile in 1961. It was the ‘Autonetics D-17’ guidance computer, built using
discrete transistor logic and a hard-disk for main memory.
        The first integrated circuit was produced in September 1958 but computers using them
didn’t begin to appear until 1963. Some of their early uses were in embedded systems, notably
used by NASA for the Apollo Guidance Computer and by the US military in the Minuteman-II
intercontinental ballistic missile.
CLASSIFICATION OF EMBEDDED SYSTEMS
Some of the criteria used in the classification of embedded systems are as follows:
(1) Based on generation
(2) Complexity and performance requirements
(3) Based on deterministic behaviour
(4) Based on triggering.
EMBEDDED SYSTEM DESIGN                                                                         UNIT I
   1. Classification Based on Generation
This classification is based on the order in which the embedded processing systems evolved from
the first version to where they are today. As per this criterion, embedded systems can be
classified into the following:
   1.   First Generation:           The early embedded systems were built around 8-bit
        microprocessors like 8085 and Z80, and 4-bit microcontrollers. Simple in hardware
        circuits with firmware developed in Assembly code. Digital telephone keypads, stepper
        motor control units etc. are examples of this.
   2.   Second Generation: These are embedded systems built around 16-bit
        microprocessors and 8 or 16-bit microcontrollers, following the first generation
        embedded systems. The instruction set for the second generation processors/controllers
        were much more complex and powerful than the first generation processors / controllers.
        Data Acquisition Systems, SCADA systems, etc. are examples of second generation
        embedded systems.
   3.   Third Generation: With advances in processor technology, embedded system
        developers started making use of powerful 32bit processors and 16bit microcontrollers
        for their design. A new concept of application and domain specific processors/controllers
        like Digital Signal Processors (DSP) and Application Specific Integrated Circuits
        (ASICs) came into the picture. The instruction set of processors became more complex
        and powerful and the concept of instruction pipelining also evolved. Embedded systems
        spread its ground to areas like robotics, media, industrial process control, networking, etc.
   4.   Fourth Generation: The advent of System on Chips (SoC), reconfigurable
        processors and multicore processors are bringing high performance, tight integration and
        miniaturisation into the embedded device market. The SoC technique implements a total
        system on a chip by integrating different functionalities with a processor core on an
        integrated circuit. Smart phone devices, mobile internet devices (MIDs), etc. are
        examples of fourth generation embedded systems.
EMBEDDED SYSTEM DESIGN                                                                   UNIT I
   2. Classification Based on Complexity and Performance
According to this classification, embedded systems can be grouped into the following:
Small-Scale Embedded Systems
Embedded systems which are simple in application needs and where the performance
requirements are not time critical fall under this category. An electronic toy is a typical
example of a small-scale embedded system. Small-scale embedded systems are usually built
around low performance and low cost 8 or 16 bit microprocessors/microcontrollers. A small-
scale embedded system may or may not contain an operating system for its functioning.
Medium-Scale Embedded Systems
Embedded systems which are slightly complex in hardware and firmware (software)
requirements fall under this category. Medium-scale embedded systems are usually built around
medium performance, low cost 16 or 32 bit microprocessors/microcontrollers or digital signal
processors. They usually contain an embedded operating system (either general purpose or real
time operating system) for functioning.
Large-Scale Embedded Systems/Complex Systems
Embedded systems which involve highly complex hardware and firmware requirements fall
under this category. They are employed in mission critical applications demanding high
performance. Such systems are commonly built around high performance 32 or 64 bit RISC
processors/controllers or Reconfigurable System on Chip (RSoC) or multi-core processors and
programmable logic devices. They may contain multiple processors/controllers and co-
units/hardware accelerators for offloading the processing requirements from the main processor
of the system.
   3. Based on deterministic behaviour
The classification based on deterministic system behaviour is applicable for ‘Real Time’
systems. The application/task execution behaviour for an embedded system can be deterministic
EMBEDDED SYSTEM DESIGN                                                                      UNIT I
or non- deterministic. Based on the execution behaviour, Real Time embedded systems are
classified into Hard and Soft.
   4. Based on triggering
Embedded Systems which are ‘Reactive’ in nature (Like process control systems in industrial
control applications) can be classified based on the trigger. Reactive systems can be either event
triggered or time triggered.
   MAJOR APPLICATION AREAS OF EMBEDDED SYSTEMS
   The application areas and the products in the embedded domain are countless.
   1. Consumer electronics: Camcorders, cameras, etc.
   2. Household appliances: Television, DVD players, washing machine, fridge, microwave
      oven, etc.
   3. Home automation and security systems: Air conditioners, sprinklers, intruder detection
      alarms, closed circuit television cameras, fire alarms, etc.
   4. Automotive industry: Anti-lock breaking systems (ABS), engine control, ignition
      systems, automatic navigation systems, etc.
   5. Telecom: Cellular telephones, telephone switches, handset multimedia applications, etc.
   6. Computer peripherals: Printers, scanners, fax machines, etc.
   7. Computer       Networking      systems:       Network          routers,      switches,
      hubs, firewalls, etc.
   8. Healthcare: Different kinds of scanners, EEG, ECG machines etc.
   9. Measurement & Instrumentation: Digital multi meters, digital CROs, logic analyzers
      PLC systems, etc.
   10. Banking & Retail: Automatic teller machines (ATM) and currency counters, point of
       sales (POS).
   11. Card Readers: Barcode, smart card readers, hand held devices, etc.
EMBEDDED SYSTEM DESIGN                                                                         UNIT I
PURPOSE OF EMBEDDED SYSTEMS
Each embedded system is designed to serve the purpose of any one or a combination of the
following tasks:
           1. Data collection/Storage/Representation
           2. Data Communication
           3. Data (signal) processing
           4. Monitoring
           5. Control
           6. Application specific user interface
   1. Data Collection/Storage/Representation
      Embedded systems designed for the purpose of data collection performs acquisition of
       data from the external world.
      Data collection is usually done for storage, analysis, manipulation and transmission.
      Data can be either analog (continuous) or digital (discrete).
      Embedded systems with analog data capturing techniques collect data directly in the
       form of analog signal whereas embedded systems with digital data collection mechanism
       converts the analog signal to the digital signal using analog to digital (A/D) converters
       and then collects the binary equivalent of the analog data.
      If the data is digital, it can be directly captured without any additional interface by digital
       embedded systems.
      A digital camera is a typical example of an embedded system with data
       collection/storage/representation of data.
      Images are captured and the captured image may be stored within the memory of the
       camera. The captured image can also be presented to the user through a graphic LCD
       unit.
EMBEDDED SYSTEM DESIGN                                                                    UNIT I
   2. Data Communication
      Embedded data communication systems are deployed in applications from complex
       satellite communication systems to simple home networking systems.
      The transmission is achieved either by a wire-line medium or by a wire-less medium.
      Data can either be transmitted by analog means or by digital means.
      The data collecting embedded terminal itself can incorporate data communication units
       like Wireless modules (Bluetooth, ZigBee, Wi-Fi, EDGE, GPRS, etc.) or wire-line
       modules (RS-232C, USB, TCP/IP, PS2,etc).
      Network hubs, routers, switches, etc. are typical examples of dedicated data transmission
       embedded systems.
   3. Data (Signal) Processing
      Embedded systems with signal processing functionalities are employed in applications
       demanding signal processing like speech coding, synthesis, audio video codec,
       transmission applications, etc.
      A digital hearing aid is a typical example of an embedded system employing data
       processing.
      Digital hearing aid improves the hearing capacity of hearing impaired persons.
   4. Monitoring
      Almost all embedded products coming under the medical domain are with monitoring
       functions only.
      Electro cardiogram machine (ECG) is intended to do the monitoring of the heartbeat of a
       patient but it cannot impose control over the heartbeat.
      Other examples with monitoring function are digital CRO, digital multimeters, and logic
       analyzers.
   5. Control
      A system with control functionality contains both sensors and actuators.
EMBEDDED SYSTEM DESIGN                                                                    UNIT I
      Sensors are connected to the input port for capturing the changes in environmental
       variable or measuring variable.
      The actuators connected to the output port are controlled according to the changes in the
       input variable.
      Air conditioner system used in our home to control the room temperature to a specified
       limit is a typical example for ES for CONTROL purpose.
   6. Applications specific user interface
      Buttons, switches, keypad, lights, speakers, display units, etc. are application-specific
       user interfaces.
      Mobile phone is an example of application specific user interface.
      In mobile phone the user interface is provided through the keypad, graphic LCD module,
       system speaker, vibration alert, etc.
CHARACTERISTICS OF AN EMBEDDED SYSTEM
Unlike general purpose computing systems, embedded systems possess certain specific
characteristics and these characteristics are unique to each embedded system. Some of the
important characteristics of an embedded system are as follows:
   (1) Application and domain specific
   (2) Reactive and Real Time
   (3) Operates in harsh environments
   (4) Distributed
   (5) Small size and weight
   (6) Power concerns
  1. Application and Domain Specific
      An embedded system is designed for a specific purpose only.
EMBEDDED SYSTEM DESIGN                                                                    UNIT I
      It will not do any other task.
      Ex. Air conditioners embedded control unit, it cannot replace microwave oven…
      Ex. A washing machine can only wash, it cannot cook.
      Because the embedded control units of microwave oven and air conditioner are
       specifically designed to perform certain specific tasks.
      Certain embedded systems are specific to a domain: ex. A hearing aid is an application
       that belongs to the domain of signal processing and telecom with another control unit
       designed to serve another domain like consumer electronics.
   2. Reactive and Real Time
      Certain embedded systems are designed to react to the events that occur in the nearby
       environment. These events also occur real-time.
      Ex. Flight control systems, Antilock Brake Systems (ABS), etc. are examples of Real
       Time systems
      Ex. An air conditioner adjusts its mechanical parts as soon as it gets a signal from its
       sensors to increase or decrease the temperature when the user operates it using a
       remote control.
      An embedded system uses Sensors to take inputs and has actuators to bring out the
       required functionality.
   3. Operation in Harsh Environment
      Certain embedded systems are designed to operate in harsh environments like a dusty
       one or a high temperature zone or an area subject to vibrations and shock or very high
       temperature of the deserts or very low temperature of the mountains or extreme rains.
      These embedded systems have to be capable         of   sustaining   the   environmental
       conditions it is designed to operate in.
   4. Distributed
      The term distributed means that embedded systems may be a part of a larger system.
EMBEDDED SYSTEM DESIGN                                                                     UNIT I
      These components are independent of each other but have to work together for the
       larger system to function properly
      Ex. Automatic Teller Machine (ATM) contains a card reader                embedded unit,
       responsible for reading and validating the user’s ATM          card, transaction unit for
       performing transactions, a currency counter for dispatching/vending currency to the
       authorized person and a printer unit for printing the transaction details.
      This can visualize these as independent embedded systems. But they work together to
       achieve a common goal.
   5. Small Size and Weight
      An embedded system that is compact in size and has light weight will be desirable or
       more popular than one that is bulky and heavy.
      Ex. Currently available cell phones. The cell phones that have the maximum features are
       popular but also their size and weight is an important characteristic.
   6. Power Concerns
      It is desirable that the power utilization and heat dissipation of any embedded system
       be low.
      If more heat is dissipated then additional units like heat sinks or cooling fans need to be
       added to the circuit.
      Ex. The production of highamount of heat demands cooling requirements like
       cooling fans which in turn occupies additional space and make the system bulky.
       Nowadays ultra low power components are available in the market.
      Select the design according to the low power components like low dropout regulators,
       and controllers/processors with power saving modes.
      Also power management is a critical constraint in battery operated application.
      The more the power consumption the less is the battery life.
EMBEDDED SYSTEM DESIGN                                                                      UNIT I
Quality Attributes of Embedded Systems
   Quality attributes are the non-functional requirements that need to be documented properly
    in any system design.
       If the quality attributes are more concrete and measurable, it will give a positive impact
        on the system development process and the end product.
       The various quality attributes that needs to be addressed in any embedded system
        development are broadly classified into two, namely
                   1. Operational Quality Attributes
                   2. Non-Operational Quality Attributes
    1. Operational Quality Attributes
    The operational quality attributes represent the relevant quality attributes related to the
    embedded system when it is in the operational mode or ‘online’ mode. The important quality
    attributes coming under this category are listed below:
           a. Response
           b. Throughput
           c. Reliability
           d. Maintainability
           e. Security
           f. safety
    a. Response
              Response is a measure of quickness of the system.
              It gives you an idea about how fast your system is tracking the input variables.
              Most of the embedded system demand fast response which should be real-time.
              Ex. An embedded system deployed in flight control application should respond
               in a Real Time manner.
              Any response delay in the system will create potential damages to the safety of
               the flight as well as the passengers.
              It is not necessary that all embedded systems should be Real Time in response.
EMBEDDED SYSTEM DESIGN                                                                    UNIT I
            For example, the response time requirement for an electronic toy is not at all
             time-critical.
   b. Throughput
            Throughput deals with the efficiency of system.
            It can be defined as rate of production or process of a defined process over a
             stated period of time.
            The rates can be expressed in terms of units of products, batches produced, or
             any other meaningful measurements.
            In case of card reader like the ones used in buses, throughput means how many
             transactions the Reader can perform in a minute or hour or day.
            Throughput is generally measured in terms of ‘Benchmark’. A ‘Benchmark’ is a
             reference point by which something can be measured.
            Benchmark can be a set of performance criteria that a product is expected to
             meet or a standard product that can be used for comparing other products of
             the same product line.
   c. Reliability
            Reliability is a measure of how much percentage you rely upon the proper
             functioning of the system or what is the % susceptibility of the system to failure.
            Mean Time between Failures (MTBF) and Mean Time To Repair (MTTR)
             are the terms used in defining system reliability.
            MTBF gives the frequency of failures in hours/weeks/months.
            MTTR specifies how long the system is allowed to be out of order following a
             failure.
            For an embedded system with critical application need, it should be of the order
             of minutes.
   d. Maintainability
            Maintainability deals with support and maintenance to the end user or client in
             case of technical issues and product failures or on the basis of a routine system
             checkup.
EMBEDDED SYSTEM DESIGN                                                                         UNIT I
            Reliability and maintainability are considered as two complementary
             disciplines. A more reliable system means a system with less corrective
             maintainability requirements and vice versa.
            Maintainability can be classified into two types:
             1. Scheduled or Periodic Maintenance (Preventive Maintenance)
            An inkjet printer uses ink cartridges, which are consumable components and as
             per the printer manufacturer the end use should replace the cartridge after each
             ‘n’ number of printouts to get quality prints.
             2. Maintenance to Unexpected Failures (Corrective Maintenance)
            If the paper feeding part of the printer fails the printer fails to print and it requires
             immediate repairs to rectify this problem.
            Hence it is obvious that maintainability is simply an indication of the
             availability of the product for use. In any embedd
                                                         embedded
                                                                ed system design, the ideal
             value for availability is expressed as
      Where Ai=Availability in the ideal condition, MTBF=Mean Time between Failures, and
      MTTR= Mean Time to Repair
   e. Security
            ‘Confidentially’, ‘Integrity’, and ‘Availability’ are three major measures of
             information security.
            ‘Confidentially’ deals with the protection of data and            application      from
             unauthorized disclosure
                          disclosure.
            ‘Integrity’ deals with the protection of data and application from       unauthorized
             modification.
            ‘Availability’ deals with protection of data and application from unauthorized
             users.
            Certain embedded systems have to make sure they conform to the security
             measures.
EMBEDDED SYSTEM DESIGN                                                                             UNIT I
                 Ex. An electronic safety Deposit Locker can be used only with a pin number like
                  a password.
   f. Safety
                 Safety deals with the possible damages that can happen to the operators, public
                  and the environment due to the breakdown of an embedded system or due to the
                  emission of radioactive or hazardous materials from the embedded products.
                 The breakdown of an embedded system may occur due to a hardware failure or a
                  firmware failure.
                 Safety analysis is a must in product engineering to evaluate the anticipated
                  damages and determine the best course of action to bring down the consequences
                  of the damages to an acceptable level.
    2. Non Operational Attributes
                 The quality attributes that needs to be addressed for the product ‘not’ on the
                  basic of operational aspects are grouped under this category. The important
                  quality attributes coming under this category are listed below:
         i.       Testability & Debug-ability
       ii.        Evolvability
       iii.       Portability
       iv.        Time to prototype and market
        v.        Per unit and total cost
i. Testability & Debug-ability
                 Testability deals with how easily one can test his/her design, application and by
                  which means he/she can test it.
EMBEDDED SYSTEM DESIGN                                                                    UNIT I
             For an embedded product, testability is applicable to both the embedded
              hardware and firmware.
             Debug-ability is a means of debugging the product as such for figuring out the
              probable sources that create unexpected behavior in the total system.
             Debug-ability has two aspects in the embedded system development context,
              namely, hardware level debugging and firmware level debugging.
             Hardware debugging is used for figuring out the issues created by hardware
              problems whereas firmware debugging is employed to figure out the probable
              errors that appear as a result of flaws in the firmware.
ii. Evolvability
             Evolvability is a term which is closely related to Biology.
             Evolvability is referred as the non-heritable variation.
             For an embedded system, the quality attribute ‘Evolvability’ refers to the ease
              with which the embedded product (including firmware and hardware) can be
              modified to take advantage of new firmware or hardware technologies.
iii. Portability
             Portability is a measure of ‘system independence’.
             An embedded product can be called portable if it is capable of functioning in
              various environments, target processors/controllers and embedded operating
              systems.
             A standard embedded product should always be flexible and portable.
iv. Time-to-Prototype and Market
             Time-to-market is the time elapsed between the conceptualization of a product
              and the time at which the product is ready for selling (for commercial product) or
              use (for non-commercial products).
EMBEDDED SYSTEM DESIGN                                                                   UNIT I
            The commercial embedded product market is highly competitive and time to
             market the product is a critical factor in the success of a commercial embedded
             product.
            Product prototyping helps a lot in reducing time-to-market
v. Per Unit Cost and Revenue
            Cost is a factor which is closely monitored by both end user (those who buy the
             product) and product manufacturer (those who build the product).
            Cost is a highly sensitive factor for commercial products.
            Proper market study and cost benefit analysis should be carried out before taking
             decision on the per unit cost of the embedded product.
            When the product is introduced in the market, for the initial period the sales and
             revenue will be low.
            There won’t be much competition when the product sales and revenue increase.
            During the maturing phase, the growth will be steady and revenue reaches highest
             point and at retirement time there will be a drop in sales volume.
                             Product life cycle (PLC) curve