It is any device that includes a programmable computer, but is not itself intends to be a general purpose computer. Fax Machine or a Clock built from a μP is an Embedded System.
The word Embedded implies that it lies inside the overall system, hidden from View, forming an integral part of greater whole.
Latency is the waiting period between running the code of a task and the instance at which the need for the task arises. RTOS sets the rules during the execution of software. A small scale embedded system may not need a RTOS.
1Embedded System DesignNARINA THAKURBharti Vidyapeeth’s College ofEngineeringDept of Computer Science
2Introduction•Definition of Computer system•Definition of Embedded system•How are embedded systems designed?(Hardware and Software)•Critical Design challenges
3Definition of a Computer SystemA Computer is a system that has followingor more hardware Components:• A microprocessor• Large memory comprising(i) Primary Memory (ROM, RAM, Cache)(ii) Secondary memory (HDD, CDROM, FDD,Cartridge tapes)• Input devices (KB, Mouse, Digitizer,Scanner)• Output devices (Video Monitor, Printer)• Networking Card (Ethernet LAN)• I/O Units (Modem, Fax cum Modem)
4Definitions of Embedded System• An Embedded System has computerhardware with Software embedded in it asone of its most important components.• Dedicated computer based system for agiven application or product.• It might be either an Independent Systemor• Part of a larger System.• Software embeds in ROM. Does not needany Secondary Memory.
5Definitions Continued……….• Todd D. Morton: Author - EmbeddedµC(s)• Embedded Systems are electronicsystems that contains a µP or µC. But, wedo not think of them as computers.• The computer is hidden or embedded in asystem.
6Definitions Continued……….• Tim Wilmshrust: Author – An Introduction todesign of small scale Embedded Systems.• An Embedded System is a system whoseprincipal function is not computational, Butwhich is controlled by a computerembedded with-in it.• The Computer is likely to be a µP or µC.
7Definition of Embedded System(Continued)• An Embedded System is a µC based,• Software driven, Reliable, Real timecontrol system,• Autonomous or Human or Networkinteractive,• Operating on diverse physical variablesand in diverse / hostile environments• Sold into a competitive & Cost consciousmarket
8Embedded World!• Embedded processors account for 99% ofworld-wide microprocessor production !• Embedded : desktop = 99 : 1
9Embedded Systems• The embeddedsystem iscompletely enclosedin the main system.• It does not interactdirectly with theenvironment.• For example – amicro-computer in acar ignition control.
10What is an Embedded System?• Embedded systems are more limited inhardware and/or software functionality than apersonal computer.• An embedded system is designed to performa dedicated function.• An embedded system is a computer systemwith higher quality and reliabilityrequirements than other types of computersystems.
11A Real Embedded (Indeed)• Simple, not much overhead• Robust, reliable, ready• Protocol sensitive• Ubiquitous (Ever-present)• Acts within the system• Does not react directly withenvironment• Works real time• Senses the sensors, processesthe input, actuates theactuators.
12Embedded System?• Computational– but not first-and-foremost a computer• Integral with physical processes– sensors, actuators• Reactive– at the speed of the environment• Heterogeneous– hardware/software, mixed architectures• Networked– shared, adaptive
13Embedded Systems: Common Situation• Different hardware devices and architectures• Increased complexity• Non-standard tools and design processes• Redundant development efforts• Increased R&D and sustaining costs• Lack of standardization results in greater qualityrisks
14Embedded Systems and their MarketsMarket Embedded DeviceAutomotive Ignition System, Engine Control, Brake SystemConsumerElectronicsDigital and Analog Televisions, Set-Top Boxes,Kitchen Appliances, Toys/Games, Telephones/CellPhones/Pagers, Cameras, GPSIndustrialControlsRobotics and Manufacturing ControlsMedical Infusion Pumps, Dialysis Machines, ProstheticDevices, Cardiac MonitorsNetworking Routers, Hubs, GatewaysOfficeAutomationFax Machine, Photocopier, Printers, Monitors,Scanners
15Components of Embedded System• It has Hardware• Main Application Software-may performconcurrently the series of tasks or multiple tasks• Real Time Operating System (RTOS)Supervises the Application Software,Provides a mechanism to let the processor run aprocess as per scheduling anddo the context switch between the variousprocesses (tasks).
16Components of an Embedded System HardwarePower Supply, Reset and Oscillator CircuitsSystem Application Specific CircuitsInputDevicInterfacing/DriverCircuitsOutputInterfaDriverCircuitsProcessorProgramMemory &DataMemoryTimersInterruptControllerParallelPortsSerialCommPorts
17RTOS in an Embedded System• Has a Kernel. Kernel coordinates the use ofProcessor for multiple tasks that are in ‘Ready’State such that only one task is in ‘Running’ State• Kernel schedules the transition of a task from– ‘Ready’ to ‘Running’ state– Also, from ‘Blocked’ to ‘Running’ state(Preemptive scheduling)• Kernel schedules and dispatches a task to differentState than the present State
18RTOS in an Embedded System• Kernel Controls the inter-process (task)messaging and sharing of variables, queues andpipes.• It schedules their working and execution byfollowing a plan to control the latencies and Meethard deadlines.• RTOS has to be scalable. Memory is optimized byincluding only those parts of the “code” which areneeded in the final software
19Hard / Soft Real-Time Systems• Soft Real-Time System– Compute output response as fast as possible,but no specific deadlines to be met.• Hard Real-Time System– Output response must be computed by specifieddeadline or system fails
20Selection of RTOS• Requirements• Latencies• Tool Support• Processor Support• Type of Delivery• Inter Process Communication• Memory Management• Power Management
21Design of Embedded Systems• Task partitioning between hardware andsoftware• Hardware design and integration• Software development• System integration• Test strategies
22Hardware-Software PartitioningSome tasks could be performed usinghardware or software.Example:A system receiving data packets needs tocalculate a Cyclic Redundancy Check (CRC)value. If the packet is OK, an ACK signalshould be sent within a specified time.CRC could be calculated in S/W or bydedicated H/W.
23Criteria for choice betweenH/W and S/W• Hardware adds a “per unit” cost.• Software adds a “fixed cost”.• Hardware provides speed.• Software provides flexibility.• Software solution can reduce cost – atleast when production is in highvolume.• Hardware solution used when fastresponse is required.
24Example of CRC checkChoice depends on how much time we have forsending the ACK signal.If S/W is too slow, we have no choice – H/Wmust be used.If S/W can meet the timing spec., we coulduse S/W. S/W solution needs Real Time guarantee.
25Hardware Design• Since a micro-controller in an embeddedsystem will run just one program all thetime, hardware resources must bematched to needs of the application.• Modern technology has made it possibleto put the entire electronics – inclusiveof sensors, analog circuits, digitalcircuits, DSP etc. on a single chip.(System On a Chip or SoC).
26Hardware Design Challenges• Compatibility of the entire system• Interface design (linear to digital,asynchronous to synchronous etc.)• Low power design• Modularity and ability to upgrade the systemin the field.• Time to market
27Low Power DesignEspecially important in 3 cases:1. Battery operated and mobile systems – e.g.a portable MP3 music player2. Systems with a limited power source –such as a smart public call booth whichderives power from phone lines.3. High complexity and speed systems –where heat dissipation is a problem
28Low Power Design Techniques• Power smart blocks which go to a lowpower or off mode when not in use.• Reduced voltage swing on loadedbuses.• Coding schemes which minimize thenumber of transitions on signal lines.• Reduced activity (toggling) .• Reduced capacitances.• Superior device engineering.
29Software Design• Software must provide the algorithms etc.needed for implementing the applications.• These algorithms often have an impact onthe choice of hardware as well.For example, whether a DSP processorshould be used or not.• Most embedded system software needs tobe real time software.
30Generic Requirements• Software must be– Modular– Should be reusable, adaptable– Well documented• In embedded systems, hardware andsoftware design must go hand in hand
31Considerations inSoftware Development• Choice of assembly language versushigh level languagesMost systems use high level languages thesedays.However, embedded system software needs tobe much more “hardware aware” than genericsoftware.It is not uncommon to find assembly languageinserts in high level language software.
32Real Time Systems• Real time systems have to guarantee thatthey will respond to an external event withina specified amount of time.• Real Time systems don’t have to be “realfast”. They do have to be reliably “on time”.
33Really Real TimeCycling therocket cone tothe launchingpad!Venue: TERLSTrivandrumYear:1966
34Type of Real Time SystemsBased on the type of timing guaranteethey provide, real time systems areclassified as“soft real time”or“hard real time”.
35Soft Real Time Systems• Soft real time systems provide a timeguarantee, but missing an event is notcatastrophic.• For example, image decoding used duringsatellite TV reception must be completedwithin a “frame time”.• If this guarantee is missed, there will be avisible glitch.• Annoying – but not catastrophic!
36Hard Real Time Systems• Hard real time systems are used whenmissing a timing deadline will lead tocatastrophic results.• For example, a missile guidance systemshould not miss any events!
37So why use soft real timesystems at all?• Both soft and hard real time systemsprovide a real time guarantee. But if we canafford to miss a few events, this guaranteedresponse time can be much shorter.• Soft real time systems would be used innon-critical applications which need to bevery fast.
38Hard and SoftReal Time SystemsThe time guarantee provided by soft realtime systems is statistical in nature –whereas that provided by hard real timesystems is absolute.Design of soft real time systems optimizesaverage case response – whereas hard realtime systems must be designed for worstcase situations.
39Is real time software any different?• Interrupt handling has to be speciallycareful.• Since interrupt handling and taskscheduling is done at the operating systemlevel, special real time compliant operatingsystems should be used.
40Constraints in Embedded Applications(1) Functionality: with-in available System Memoryand Processor Speed(2) Complex Algorithms: As in an AutomobileEngine - Performs complex filtering functions tooptimize performance of the car whileminimizing pollution & Fuel utilization.(3) User Interface: Multiple GUI Menus / Options,Moving Maps in Global Positioning System,Navigation needs sophisticated User InterfaceUser inputs from front panel / Remote LAN port
41Constraints in Embedded Applications(4) Meet hard deadlines: Missing deadlines in Realtime(i) Could break a system (if data is not ready)(ii) Could cause unsafe operation, endanger lives(iii) Results in unhappy customers: Misseddeadline in Printer printing a Scrambled Page
42Constraints in Embedded Applications(5) Multi-Rate: Several activities having slow andhigh rates being processed simultaneously.Example: Audio and Video portions of amultimedia stream run at different rates. But, theymust remain closely synchronized with-in 160 mSFailure to meet deadline on either the audio orvideo portion spoils the perception of entirepresentation.
43Constraints in Embedded Applications(6) Manufacturing Cost: Total cost of buildingsystem is important.Cost is determined by the typeof processor, memory size and peripheralsdevices.(7) Limited Power consumption: Large Powerincreases thermal rise, cost and size of product.If Battery powered, may affect battery life.
44Software Components• Device drivers• Schedulers• Real time routines• Non real time routines• Inter process communications– Pipes– Semaphores etc• Watchdog timers