You are on page 1of 6
Chapter 1 An Overview of Embedded Software in This Chapter ‘+ Basic concepts of embedded systems and software 4+ Trends in embedded software development + Embedded systems categorized + Issues and challenges in embedded software development ‘Without our even being aware of it, we are surcunded by embedded systems. In oar daily lives, we use a number of embedded systems — such as those found in TVs, VCRs, toasters, CD players, digital cameras, and mobile phones. Thanks to advances in semiconductor ‘lectronics, embedded systems have recently become increasingly powerful. And whereas writing software for these embedded systems used to be akin t “rocket science,” tis iso longer the case. However, the art and science of embedded software development i changing very rapidly, What Is an Embedded System? The desktop computers with which most of vs ae familiar, as well as workstations and mainframe computers, are "general purpose” computers in that we use them for performing a vanety of everyday tasks such as playing games, word processing, accounting, scientific ‘calculations, and the like. In contrast, an embedded system performs. single well-defined taok. An embedded system can be described as cae consisting of « processor, associated peripheral, and software used fora specific purpose. For example, the VCR's very specific task sto record and play videocassettes. The hardware andthe software ofthe VCR's embedded system are designed to cary out this specific task only, Like any other compating system, an embedded system is combination of hardovare and software. However, the hardware ofa general-purpose computer is typically pre-defined, consisting of a CPU, monitor, a keyboard, 1 mouse, and secondary storage devices such as CD-ROM and/or 3.5" disk drives, and we procure itoff the shelf. In the case ofan embeded system, the hardware is generally custom-built for the system's specific purpose, xainly ‘because te requirements of each system vary considerably. Consider the following two examples of typical embedded systems, illustrating te varying requirements ofthe hardware: + Inamanufscting unit ofa chemical plant, a number of temperatures have tobe ‘measured and based on the values, and certain operations need tobe performed, such as ‘opening a valve. The input tothe system comes from various seasors that measure the temperatures, and the output is a signal that controls valve. In other words, the input tells the device when it should do something, andthe device does it. The hardware, ‘obviously, must be based on tis specific requirement ifthe device isto perform its function. ‘+ Theprocestor in a mobile phone needs to carry outa great deal of communication protocol processing to make telephane calls, and also needs to peefoxm voice Processing fo send and receive speech signais. The mobile phone is another example of ln embedded rystem. However, unlike in the preceding example, the mobile phone has « ‘mass market, and the hardware developers must keep in mind the specific requirements ‘of the protocols used in the mobile networks. For instance, the mobile phones used in North America are different frm those used in Europe because the network protocols are different. Hence the hardware is different. Differences in hardware can also arise ‘because ofthe diflering capubilies of the mobile phones. Hace, depending on the quantity and functionality needed the embedded system hardware neds to be developed with the cost kept in mind. Accordingly, the software that goes into the sysem alo varies wiely to meet te desired fuetionalty Categories of Embedded Systems Embedded systems can be broadly divided int the following categories. This categorization is based on whether the system histo work a an independent unt or it has to be networked, whether ithas to perfor real-sime operations ort, apd son. Stand-alone embedded systems ‘Stand-alone embedded systems work, asthe name suggests, in a stand-alone mode (as opposed to. networked mode), taking input and producing output. The input canbe electrical signals from sensors, or commands from & human being. such ss the pressing of «button. The output ‘can be electrical signals to drive another system, or an LED or LCD display for displaying information to wers, Many embedded systems for process consol in manufacturing units and automobiles fll into this eategory-In process control systems, the inputs come from ‘transduce that convert a paysical entity, such as temperature, into an electrical signal. The ‘electrical signals become the outpat that can control devices such as valves. In some stand- alone systems, the deadlines to carry out a specific task may not be very strict; a few ‘milliseconds this way or that way may not matter mach, In other words, the response time is ‘not crucial, For example, an air conditioning unit can beset to turn on When the temperature reaches certain level. Other examples inthis eateyory are toys, CD players, and measuring ‘nstruments, Real-time embedded systems Some embedded systems are required to carryout specific asks in a pesifed amount of ime Suct systems are called realtime embscied ystems. Conse, fer example, a system that has to opena valve wihin 30 milimcends went tumidycroses a partrul hrs I the {pbs mot cased oat within tha 30-snlscond peri, catastrophe may enue Sch sysern in which realsime sonstin have tobe oly mt ats elled hard real ime embrcde syste: Rela teleport tles ervey wan ls poctn creche in ‘rita ‘asks fnve to be cared out (Realtime “sonstrant” are often imposed in vice und ‘deo commution, bat tse constants we vealed acasenaly, oting cstropic will happen — for instance, a voice packet may be delayed, resulting in «short silence. ‘Systems in which real-time constraints are present bat not critical are called sofi real-rime tmbedaed estes} Networked appliances Some embedded systems are connected fo a network — fypically, one based on a TCPAP (Transmission Control ProtecoVIntemet Protocol) protocol su, such as the Intemet or a ‘ormpauy intranet. These systems are of a aw brand that has emerge in rent years, They ‘un the complete TCP/IP protocol stack and can communicate wih other nodes on the ‘network. Fven'a Web server running HTTP (HyperText Transfer Protocol) can be embedded into the system, The system can monitor some parameters (such as temperatures and pressures) and set the data over a network toa cenralized systems for oaline monitoring. A ‘typical example is the monitoring of equipment in a manufacturing unit. The system sends the ata over the TCPAP network to a central management sysiem, which can be a desktop ‘computer running w Web browser. Another example is x nerwork-cnabled Web camera tht ‘an transmit its video output oer the Intemet These are known as feierner information expliances Mobile devices With the advent of wireless networks that can support very high speeds, mobile devices are capable of supporting high data rate services in addition to the voke services. Accessing Intemet services such as e-mail, the World Wide Web, and so on can be done while a person is on the move. Sueh devices need torun a powerful mobile operating system and download {information from Wed sites. Many such devices are Java-enabled; hence, they cxn downlcad Java npplets and execute them. Field personnel can use devices such as handheld PCs and, ‘alimtops for dita collection, and the data entered can be kept in local memory and ater ‘uploaded ito de corporate databases. Heace, these mobile devices ae capable of storing ‘databases locally intheie memory. The special requirements ofthese mobile devices ae threefold: they should have powerfal computing and communicating capabilites, they should bbe able to perform some real-time tasks in addition to non-real-time tasks, and they should be ccpable of handling multimedia applications. These requirements call fora powerful ‘roceisor, a powerful operating system, and alot of memory with minimal power ‘consumption ‘This took addresses software development for all four categories of embedded systems, using 4 variety of operating systems and development ‘ook. Requirements of Embedded Systems Despite the varying types of embedded systems, they all have some common requiremeats. ‘The following sections describe each ofthese fundamertal characteristics Reliability Embedded systems have to work without the need for the rebooting or resetting typical of ‘many desktop systems, This clls for very reliable hardware and software. If, for example, the ‘embedded system comes toa halt because ofa hardware eror, the sysiem should reset self ‘without the need for human imtervention. Cenainly, liability is eitical in any system, but we arc used to resetting or desktop systems once in a while, thanks tothe unpredictability of ‘erating systems and software. However, embedded software developers mast make the roiiability of the hardware, as well as that of the softwar, of paramount importance because the system is not readily accessible to human intervention. Cost-effectiveness [fan embedded systems designed fora very special purpose, such as fora deep space probe ‘or for use ina nuclear plan, cost may not bean issue. However, ifthe embedded system is for the mass matke, such 3s those used in CD players, toys, and mobile devices, cos isa major ‘consideration. Choosing the right processor, memory devices, nd peripherals tomeet the functionality and perfonmance requremeats while keeping the cos reasonable iso critical importance. In such cases, the designers will develop an Application Spevific Integrated CCieuit (ASIC) or an Application Specifie Microprocessor to reduce the hardware components and hence the cost. Typically a developer first creates a prototype by writing the software for ‘a general-purpose pracesscr, and subsequently develops an ASIC to reduce the cost. Low power consumption “Many embecide systems are powered by bateres, rather than a main supply. In such cases, the power consumpsion should be minimized to avoid draining the bateries. Handware designers must address this issue — for example, by reducing the numberof hardware ‘components, or by designing the processor to revertto ow power or “sleep” mode when there {sno operation to perform. Efficient use of processing power | wide variety of procesors wit varying procesing powers are avaiable embeded ‘yuma. Developers mut erp prong power, inry tad cot in mind when choosing thal pocemee,Proeroor the oem geomlly wed to rfet ou mioe oti © ticroproceic, cx Digital Signal Processor (SP) wed in embeded sysoms. The processing power reqirement js specified in million instuetons per second (MIPS). The MIPS requirement for the application has to be estimated first, and, given this estimate, the developer can choose the precesor With the avaabity of many procesors withthe same capabiltis, choosing a processer has became a tugh ak nowadays, Considerations such es the cost of development wok, separ providl bythe vendor, and previous experience all ole inthe hoi Efficient use of memory Most embed stems do nt have secorary soaps nich ard disk. The memory chips tvaiablo onthe ombud eetem we ely Rend-Only Memory (ROM), oho the progam: {nd Random Access Memory (RAND. 1 hold the data. Depending on te fintonaly, he developer may deermin the program size an the data size based en which memory resuiemens ae more importa. The cost of memory iceranty going dwn, bu even one dollr can make aig dierence, paricalaly wih regard to consumer tems. As most tmtedaedsyems dono have secondary sore flack memory i ws tosoe the program, incl the cperting system, Micto-ontolls and DSPs come with onboard memory (ie the same cen consi the memory swell). Sich proestors reused fer anal ened (pelo os hn cot pony isle end in ecsreticn paealy tt Appropriate execution time In real-time embedded systems, cerain tasks must he performed within a specified time. ‘Consequeny. analyzing the tasks to meet such performance constraints is of considerable importance. Normally, desktop PCs cannot achieve real-time performance. Therefore, special ‘operating systems, known as real-time operating systems, un on these embedded systems. In ‘ard real-time embedded systems, which are subject to very strict deadlines for performing specific ask, the timing analysis sof great importance. In soft realtime systems, ccccasionally the task may not be performed ina timely manver. The software developer needs to ascertain whether the embedded system isa hard real-time system ora soft real-time system and perform the performance analysis accordingly. The performance requirement also calls for code optimization to the maximum possible extent. Though software is generally developed in a high-level language, some computatin-intersive portions of the code may need to be written ‘in assembly language in order for the desired realime performance to be realized, In such «eases, ofcourse, you need to leam the assembly language ofthe target processor. Challenges and Issues in Embedded Software Development Developers of embedded systems have to deal with unique isues. These issues pose ‘nerestng challenges, which are discussed inthe fulowing sections Co-design ‘Because an embedded system consists of hardware and software, deciding which functions of the system should be implemented in hardware and which Functions should be implemented in software is a msjor consideration. For example, consider the Cyclic Redundancy Check (CRC) that is used to check whether a bitstream has eros init, Using a mathematical algrithm, ‘CRCis calculated fora bit pater, and the CRC is used to find erors in transmission. The ‘algorithm can be implemented either in hardware or in software. Should you choose hardware ‘plementation or software implementation? This is always a difficult question io answer. iardovare implementation has the advantage thatthe task execution is faster compared with that of software implementation. On the downside, s chip costi money, consumes valuable power, and cocupies space A software implementation is better if these are major enncerns for ‘particular project. Moreover, software implementation offers flexibility —if the algorithm ‘changes, itis easier to modify the software, Ths issue of choosing between ardware implementation and software implementation is known as a co-design issue. Co-design issues ‘should be resolved between hardware engineers and software engineers, Keeping in mind the foregoing considerations. ‘Another co-design example isthe implementation of the TCP/P stack. For decades, the stack has been implemented only through software, as it offers flexibility to change the protocols. ‘The TCP/P stack is bundled with the personal computer's operating system. Ths is acceptable because desktop computes have alt of primary memory (RAM), as well as secondary storage. Now, however, a single-chip implemewation of the TCPP stack is available, the use of which significantly accelerates the procesting ofthe protocols. Another advantage ofthe TCP/IP chip solution is tha it canbe interated into embedded system hardware, making the embedded system network-enabled. TCP/IP software implementation calls for huge amounts of memory (RAM), which i difficult to accommodate on embedded systems or expensive for a given application Embedding an operating system Itis posible to write embedded software without eny operating system embedded into the ‘system. Developers can implement services such as memory management, inpav/output management, and process management with a combination of assembly language and high- level language such as C. Its also possible to build the software above the operating system. ‘Which isthe beter chicice? Writing your own routines necessary fora particular application resuls in compact and efficent cod, thas saving on processing power and memory.

You might also like