Fundamentals Of UNIT 1 FUNDAMENTALS OF EMBEDDED SYSTEMS

Transcription

UNIT 1 FUNDAMENTALS OF EMBEDDEDSYSTEMSStructure1.01.11.21.3Fundamentals ofEmbedded SystemsPage Nos.IntroductionObjectivesEmbedded System: An Introduction1.2.1 Components of an Embedded System1.2.2 Block Diagram and Characteristics of an Embedded System1.2.3 Classification of an Embedded System556Embedded Operating System1.3.1 Classification of an Embedded Operating System8Requirements and Specification in Embedded SystemProgramming Languages for Embedded System and Classification10121.3.2 Characteristics of an Embedded Operating System1.41.51.5.1 Hardware Languages1.5.2 VHDL V/s Verilog1.6Selected Embedded System ther Readings and References1919191.01.6.1 Washing Machine1.62. Digital Sound RecorderINTRODUCTIONEmbedded systems are basic electronic devices used to control, monitor or assist theoperation of equipment, machinery or a plant. The choice of word “embedded”reflects the fact that these are integral part of the system. Uses of embedded system inour real life are increasing day by day. Children need such systems to play videogames and to operate chocolate vending machine, Housewives need embeddedsystems for microwave, TV, music system, and other system appliances.In this unit you will learn about basics of embedded system: its uses, its components,its basic requirements in terms of Hardware and Software and support ofProgramming Languages. We will also highlight some application of embeddedsystem in our real life scenario at the end of this unit.1.1OBJECTIVESAfter going through this unit, you will be able to: define embedded operating system; identify Basic Requirements and its Specification; explain Design methodology; describe the use of programming languages in embedded system; and5

State of the Art Practices inInformation Technology 1.2list the use of applications of Embedded System.EMBEDDED SYSTEM: AN INTRODUCTIONAn embedded device can range from a relatively simple product for ex. a toaster tocomplex mission critical applications such as those used in avionics. A typicalembedded device will have both hardware and software components. The hardwarecould be micro components such as embedded microprocessor or microcontroller.Microcontroller is relatively small, has a on chip memory, an I/O controller and othersupported modules to do processing and controlling tasks. The software consists ofapplications that perform dedicated tasks and may run on Real time operating systemwhich will be explained later in this unit.Embedded System may be either an independent system or a part of a large system. Itis specialized computer system but not a general purpose workstation like a desktop ora computer. Such kind of systems is housed on a single microprocessor board withprograms which are stored in ROM (Read Only Memory). Embedded system isusually a compact, portable and mass produced electronic devices. In the early days,embedded systems were designed using microprocessors like 8085. But nowadays, weare using a wide range of processors from other manufacturers.Before we want to the basic of an embedded system, we should see a wide range of itsapplications. In fact, almost all modern electronic devices use some sort of embeddedsystem technology inside them and we always come across such devices: DVDplayers, air conditioners, printers, attendance machines, handphone, digital camera,ATM machines, we will see some examples of embedded system in section 1. Now itis time to give a proper definition.Definitions: “Embedded Systems are devices which are used to control, monitor orassist the operation of an equipment, machinery or plant”. The term “control”defines the main function of Embedded System because their purpose is to control anaspect of a physical system such as pressure, temperature and so on. Also the term“monitor” defines the progress of activities.Where do we use Embedded Systems? From several examples listed earlier thesesystems are extremely common in the home, vehicle and the workplace. At Home: Washing Machines, dishwashers, ovens, central heating system,burglars alarms, etc. In Motor Vehicle: Engine management, security (locking or anti theftdevices), air conditioning, brakes, radio etc. In Industry & Commerce: Machine control, factory automation, robotics,electronic commerce office equipments.1.2.1Components of an Embedded SystemAn embedded system has three main components : Hardware, Software and timeoperating systemi)6Hardware

Power SupplyProcessorMemoryTimersSerial communication portsOutput/Output circuits System application specific circuitsii) Software: The application software is required to perform the series of tasks.An embedded system has software designed to keep in view of three constraints: Fundamentals ofEmbedded SystemsAvailability of System MemoryAvailability of processor speedThe need to limit power dissipation when running the system continuously incycles of wait for events, run , stop and wake up.iii) Real Time Operating System: (RTOS) It supervises the application softwareand provides a mechanism to let the processor run a process as per scheduling anddo the switching from one process (task) to another process.1.2.2Block Diagram and Characteristics of an Embedded SystemEmbedded systems are executed by a microcontroller, which communicates with thesensors and actuators. It means that a user of an embedded system is not able tochange the functionality of the system through modifying or replacing the softwarebecause it is kept in ROM.Embedded gure 1: Embedded SystemFigure 1 shows basic components used in Embedded System are as follows: Microcontroller: It monitors and controls the environment. Sensors: It collects data from environment through input devices. Actuators: It displays the system's status through output devices. Timer: It provides response within a certain time frame.Characteristics of Embedded System7

State of the Art Practices inInformation TechnologySome of important Characteristics of embedded system are:1) Embedded Systems are designed to do some specific task i.e., it is not a generalpurpose kind of a system.2) Software for Embedded Systems are stored in ROM or flash memory.3) Knowledge about behavior at design time can be used to minimize resources andto maximize robustness.4) Embedded Systems provide low power consumption in many situations.1.2.3Classification of an Embedded SystemEmbedded system can be classified as: Stand alone Embedded System: It is built using a specialized communicationprocessor, memory a number of network access interfaces (known as networkports), and special software that implements logic for sending information fromone device to another device. Real Time Embedded System: A real time embedded system usually monitorsthe environment where the embedded system is installed. This kind of system isrequired to respond in time to a request. Examples of real time embedded systemsare aircraft engine control systems, nuclear monitoring systems and medicalmonitoring equipment. Network Appliances: Network appliances are a new class of embeddedsystems that in addition to traditional real time processing must support a broadand changing array of network protocols. Mobile Embedded System: Mobile Embedded Systems usually are simple,battery powered systems with resource limitations. In some situations, theirbatteries lifetime becomes a prim issue.1.3EMBEDDED OPERATING SYSTEMAn embedded operating system (EOS) is a system software that manages all the otherprograms and devices in an embedded system. It normally guarantees a certaincapability within a specified storage size and time constraint as well as withapplication programs. Its structure is very similar to a structure of a normal operatingsystem however mainly differentiated by some factors such as type of pre installeddevice, functional limits, taking designed job only. It also normally has boot loader,OS kernel, required device drivers, file systems for the user data and so forth.At their core, embedded operating systems contain some of the same softwarecomponents used on larger operating systems, such as windows and Linux etc. largeroperating systems (OS), embedded operating systems deals with task switching,scheduling of tasks, memory allocation, etc.But there are some distinctions between desk top computer OS and embedded systemOS. Desktop Computer is a general purpose computing system whereas embeddedsystem purpose is for a specific task. Embedded operating systems have severalcommon characteristics that distinguish such systems from other computing systems:8

Fundamentals ofEmbedded SystemsSingle Functioned: Usually executes a specific program repeatedly e.g. pager. Tightly Constrained: All computing systems have constraints on designmetrics, but those on embedded systems can be especially tight. A design metricis a measure of an implementation’s features, such as cost, size, performance andpower. Reactive and Real Time: Many embedded systems must continually react tochanges in the system’s environment and must compute certain results in real timewithout delay. In contrast, a desktop system typically focuses on computationwith relatively infrequent reactions to input devices. Secondary Memory: Generally embedded system doesn’t need secondarymemory. Unlike a desktop computer system which may have new software loaded ontoit frequently, embedded systems retain the same code for a long time, sometimesindefinitely. Embedded operating systems do not usually include support forexternal storage or graphical interfaces, or protection from malicious or unstablecode. The limited memory in embedded systems requires the operating systemand process to work very closely to manage the free resources.1.3.1Classification of an Embedded Operating System (EOS)We can classify Operating Systems (for embedded systems) into two parts called asReal Time Operating Systems and Non Real Time OS as shown in Figure 2.Embedded OSReal Time Operating System (RTOS)E.g. VxWorks, OS 9, RTLinuxNon Real Time Operating SystemE.g. Windows, Palm OSFigure 2: Classification of embedded operating system Real Time Operating Systems are operating systems which guaranteeresponses to each event within a defined amount of time. This type of operatingsystem is mainly used by time critical applications such as measurement andcontrol systems. Some commonly used RTOS for embedded systems are:VxWorks,OS 9, Symbian, and RTLinux etc. Non Real Time Operating Systems do not guarantee definedresponse times. Those systems are mostly used if multiple applications areneeded. Windows and Palm OS are examples for such embedded operatingsystems.Some other features which are quite common to EOS irrespective of anyclassification are presented below.1)Single System Control Loop: Such systems run a single task.9

State of the Art Practices inInformation Technology2) Multitasking Operating System: In a multitasking operating system, severaltasks or processes appear to execute concurrently3) Preemptive Operating System: A preemptive operating system is amultitasking operating system that defines preemptive priorities for tasks. Ahigher priority task always interrupts and is always run before a lower prioritytask.4) Rate Monotonic Operating System: Such operating system guarantees thattasks in the system can run at a certain interval of time for a certain period oftime. When this guarantee is not met, the system software can be notified offailure and take appropriate action.5) Constant Time Operations: Constant time operations are the cornerstone ofreal time responsiveness and predictable capacity loading.6) Interrupt Response Times: Embedded Operating Systems normally providefor fast interrupt response times by separating interrupt handlers in two phases. Inthe first phase, the interrupt handler program reacts to an interrupt and satisfiesthe interrupt condition from a hardware perspective. In the second phase, theinterrupt handler processes the interrupt condition. While executing in the secondphase, other interrupts in the system are enabled and may be handled to allowhigher priority interrupts to take precedence over lower priority interrupts.7) Priority Inversion: Priority inversion is a condition in preemptive operatingsystems where a lower priority task claims a resource that is subsequentlyrequired by a higher priority task.8) Monolithic Operating Systems: A monolithic operating system includes alloperating system code such as device drivers and file system handlers as part of asingle system image.9) Micro Kernels: A micro kernel operating system includes only the barenecessities such as task switching, scheduling and device handling interfaces inthe operating system code.1.3.2Characteristics of an Embedded Operating SystemFor an Embedded OS to be regarded as good, it should have the following features:Modularity: Modularity is a concept that has an application in thecontexts of computer science, particularly programming language. A module canbe defined variously, but generally must be a component of a larger system, andoperate within that system independently from the operations of the componentsof the system. Scalability: The property of a multiprocessing computer that defines theextent to which addition of more processors increases aggregate computingcapability. Windows NT server 4.0 is generally considered to be scalable to eightIntel processors. CPU.10A CPU support: There is no meaning of an OS without a compatible

Flexibility and Configurability: By flexibility we mean to say that theEmbedded OS must be adjustable to change/modification. A configuration is anarrangement of functional units according to their nature, number, and chiefcharacteristics. Often, configuration pertains to the choice of hardware, software,firmware, and documentation. The configuration affects the system function.Fundamentals ofEmbedded Systems Have a small foot prin

Fundamentals of Embedded Systems Single Functioned: Usually executes a specific program repeatedly e.g. pager. Tightly Constrained: All computing systems have constraints on design metrics, but those on embedded systems can be especially tight. A design metric