- Advantages And Disadvantages Of Embedded Systems Pdf
- Embedded Systems Examples
- Embedded Systems Vs Operating Systems
Demerits or Disadvantages of Computer Systems. The Following are the Computer disadvantages:: Health Issues. Spread of pornography; Virus and hacking attacks; Computer can not take their own decision NO IQ; Negative effect on Environment; Crashed networks; Computer can not work on itself; Spread of violence,hatred; Online Cyber Crimes; Data and Information violation. Embedded operating systems run in mobiles, tablets like we handle in our daily life. The storage of this operating system in on chips. These systems have not vast variety of features but only necessary features that can work for the user. Embedded systems have some disadvantages. Yehia (2011) stated that, some disadvantages of embedded systems are hard to backup embedded files.
Table of Contents.Communication Protocols in Embedded SystemsEmbedded System is an electronic system or device which employs both hardware and software. A processor or controller takes input from the physical world peripherals like sensors, actuators etc., processes the same through appropriate software and provides the desired output.In this case, the components have to communicate with each other to provide the anticipated output. Each communicating entity should agree to some protocol to exchange information.
Many different protocols are available for embedded systems and are deployed depending upon the application area.Fig. 1 – Introduction to Communication ProtocolsIn general, the communication protocols is associated with physical layer describing the signals incorporated, signal strength, hand shaking mechanism, bus arbitration, device addressing, wired or wireless, data lines etc.
The processes such as system configuration, selection of baud rate and transmitting & receiving data is associated with application layer. Types of Communication Protocols in Embedded SystemsCommunication protocols are broadly classified into two types:.
Inter System Protocol. Intra System ProtocolFig 2 – Classification of Communication Protocols Inter System Communication ProtocolsInter system protocols establish communication between two communicating devices i.e.
Between PC and microprocessor kit, developmental boards, etc. In this case, the is achieved through inter bus system. 3 – Inter System Communication Protocols Types of Inter System Communication ProtocolsInter system protocol can be categorized into:.
USB Communication protocols. UART Communication protocols. USART Communication protocolsUSB Communication ProtocolsUniversal Serial Bus (USB) is a two-wired serial communication protocol. It allows 127 devices to be connected at any given time. USB supports plug & play functionality.USB protocol sends and receives the data serially between host and external peripheral devices through data signal lines D+ and D.
Apart from two data lines, USB has V CC and Ground signals to power up the device. The USB pin out is shown in Figure 4 below.Fig. 4 – USB Pin Out.
Data is transmitted in the form of packets where two devices communicate each other. Data packets compose of 8 bits (byte) with LSB (Least Significant Bit) transmitted first.USB associates NRZI (Non Return to Zero Invert) encoding scheme to transmit data with sync field to synchronize the host system and receiver clock signals.In USB, data is transferred in three different speeds such as:Fig. 5 – USB speeds Advantages of USB Communication ProtocolThe advantages of USB Communication Protocol are as follows:. Fast and simple. It is of low cost.
Plug and Play hardware.Disadvantages of USB Communication ProtocolThe disadvantages of USB Communication Protocol are as follows:. Needs powerful master device. Specific drivers are required.UART Communication ProtocolsUniversal Asynchronous Receiver/ Transmitter (UART) is not a communication protocol but just a physical piece of hardware which converts parallel data into serial data. Its main purpose is to transmit and receive data serially.UART is also two-wired i.e., the serial data is handled by Tx (Transmitter) and Rx (Receiver) pins.UART transmits data, which induces that no clock signal is associated in transmitting and receiving data. Instead of clock signal, UART embed start and stop bits with actual data bits, which defines the start and end of data packet.When receiver end detects the start bit, it starts to read the data bits at specific baud rate meaning both transmitting and receiving peripherals should work under same baud rate.
UART works under half duplex mode meaning it either transmits or receives at a time.Fig. 6 – UART FrameExample: Emails, SMS USART Communication ProtocolUniversal Synchronous Asynchronous Receiver/ Transmitter (USART) is identical to that of UART with only added functionality synchronous. That is, the transmitter will generate a clock signal which will be recovered at the receiver end from the data stream transmitted without knowing baud rate ahead.UART works under full duplex mode meaning it can transmit and receive data at same time.USART encompass the abilities of UART, which enables application of both depending on the applications area.Fig.
— Ken Olson, President of Digital Equipment Corporation,1977One of the more surprising developments of the last few decades hasbeen the ascendance of computers to a position of prevalence in humanaffairs. Today there are more computers in our homes and offices thanthere are people who live and work in them.
Yet many of these computersare not recognized as such by their users. In this chapter, we’ll explainwhat embedded systems are and where they are found. We will also introducethe subject of embedded programming and discuss what makes it a uniqueform of software programming. We’ll explain why we have selected C as thelanguage for this book and describe the hardware used in theexamples. What Is an Embedded System?An embedded system is a combination ofcomputer hardware and software—and perhaps additional parts, eithermechanical or electronic—designed to perform a dedicated function.
Agood example is the microwave oven. Almost every household has one, andtens of millions of them are used every day, but very few people realizethat a computer processor and software are involved in the preparationof their lunch or dinner.The design of an embedded system to perform a dedicated functionis in direct contrast to that of the personal computer. It too iscomprised of computer hardware and software and mechanical components(disk drives, for example).
However, a personal computer is not designedto perform a specific function. Rather, it is able to do many differentthings. Many people use the term general-purpose computer to makethis distinction clear. As shipped, a general-purpose computer is ablank slate; the manufacturer does not know what the customer will dowith it. One customer may use it for a network file server, another mayuse it exclusively for playing games, and a third may use it to writethe next great American novel.Frequently, an embedded system is a component within some largersystem. For example, modern cars and trucks contain many embeddedsystems.
One embedded system controls the antilock brakes, anothermonitors and controls the vehicle’s emissions, and a third displaysinformation on the dashboard. Some luxury car manufacturers have eventouted the number of processors (often more than 60, including one ineach headlight) in advertisements. In most cases, automotive embedded systems are connected by acommunications network.It is important to point out that a general-purpose computer interfaces to numerous embeddedsystems. For example, a typical computer has a keyboard and mouse, eachof which is an embedded system. These peripherals each contain aprocessor and software and is designed to perform a specific function.Another example is a modem, which is designed to send and receivedigital data over an analog telephone line; that’s all it does.
And thespecific function of other peripherals can each be summarized in asingle sentence as well.The existence of the processor and software in an embedded systemmay be unnoticed by a user of the device. Such is the case for amicrowave oven, MP3 player, or alarm clock. In some cases, it would evenbe possible to build a functionally equivalent device that does notcontain the processor and software. This could be done by replacing theprocessor-software combination with a custom integrated circuit ( IC)that performs the same functions in hardware. However, the processor andsoftware combination typically offers more flexibility than a hardwireddesign. It is generally much easier, cheaper, and less power intensiveto use a processor and software in an embedded system.
History and FutureGiven the definition of embedded systems presented earlier in thischapter, the first such systems could not possibly have appearedbefore 1971. That was the year Intel introduced the world’s firstsingle-chip microprocessor. This chip, the 4004, was designed foruse in a line of business calculators produced by the Japanese companyBusicom. In 1969, Busicom asked Intel to design a set of customintegrated circuits, one for each of its new calculator models. The4004 was Intel’s response. Rather than design custom hardware for eachcalculator, Intel proposed a general-purpose circuit that could beused throughout the entire line of calculators. This general-purposeprocessor was designed to read and execute a set ofinstructions—software—stored in an external memory chip.
Intel’s ideawas that the software would give each calculator its unique set offeatures and that this design style would drive demand for its corebusiness in memory chips.The microprocessor was an overnight success, and its useincreased steadily over the next decade. Early embedded applicationsincluded unmanned space probes, computerized traffic lights, andaircraft flight control systems.
In the 1980s and 1990s, embeddedsystems quietly rode the waves of the microcomputer age and broughtmicroprocessors into every part of our personal and professionallives. Most of the electronic devices in our kitchens (bread machines,food processors, and microwave ovens), living rooms (televisions,stereos, and remote controls), and workplaces (fax machines, pagers,laser printers, cash registers, and credit card readers) are embeddedsystems; over 6 billion new microprocessors are used each year. Lessthan 2 percent (or about 100 million per year) of thesemicroprocessors are used in general-purpose computers.It seems inevitable that the number of embedded systems willcontinue to increase rapidly. Already there are promising new embeddeddevices that have enormous market potential: light switches andthermostats that are networked together and can be controlledwirelessly by a central computer, intelligent air-bag systems thatdon’t inflate when children or small adults are present, medicalmonitoring devices that can notify a doctor if a patient’sphysiological conditions are at critical levels, and dashboardnavigation systems that inform you of the best route to yourdestination under current traffic conditions. Clearly, individuals whopossess the skills and the desire to design the next generation ofembedded systems will be in demand for quite some time. Real-Time SystemsOne subclass of embedded systems deserves anintroduction at this point. A real-time systemhas timing constraints.
The function of a real-time system is thuspartly specified in terms of its ability to make certain calculationsor decisions in a timely manner. These important calculations oractivities have deadlines for completion.The crucial distinction among real-time systems lies in whathappens if a deadline is missed. For example, if the real-time systemis part of an airplane’s flight control system, the lives of thepassengers and crew may be endangered by a single missed deadline.However, if instead the system is involved in satellite communication,the damage could be limited to a single corrupt data packet (which mayor may not have catastrophic consequences depending on the applicationand error recovery scheme). The more severe the consequences, the morelikely it will be said that the deadline is “hard” and thus, that thesystem is a hard real-time system.
Real-time systems atthe other end of this continuum are said to have “soft” deadlines—asoft real-time system. Shows someexamples of hard and soft real-time systems. Figure 1-1. A range of example real-time systemsReal-time system design is not simply about speed. Deadlines forreal-time systems vary; one deadline might be in a millisecond, whileanother is an hour away. The main concern for a real-time system isthat there is a guarantee that the hard deadlines of the system arealways met. In order to accomplish this the system must bepredictable.The architecture of the embedded software, and its interactionwith the system hardware, play a key role in ensuring that real-timesystems meet their deadlines.
Key software design issues includewhether polling is sufficient or interrupts should be used, and whatpriorities should be assigned to the various tasks and interrupts.Additional forethought must go into understanding the worst-caseperformance requirements of the specific system activities.All of the topics and examples presented in this book areapplicable to the designers of real-time systems. The designer of areal-time system must be more diligent in his work.
He must guaranteereliable operation of the software and hardware under all possibleconditions. And, to the degree that human lives depend upon thesystem’s proper execution, this guarantee must be backed byengineering calculations and descriptive paperwork.
Variations on a ThemeUnlike software designed for general-purpose computers, embeddedsoftware cannot usually be run on other embedded systems withoutsignificant modification. This is mainly because of the incrediblevariety of hardware in use in embedded systems. The hardware in eachembedded system is tailored specifically to the application, in order tokeep system costs low. As a result, unnecessary circuitry is eliminatedand hardware resources are shared wherever possible.In this section, you will learn which hardware features are commonacross all embedded systems and why there is so much variation withrespect to just about everything else. Later in the book, we will lookat some techniques that can be used to minimize the impact of softwarechanges so they are not needed throughout all layers of thesoftware. Common System ComponentsBy definition, all embedded systems contain a processor and software, butwhat other features do they have in common?
Certainly, in order to have software, there must be aplace to store the executable code and temporary storage for runtimedata manipulation. These take the form of read-only memory (ROM) andrandom access memory (RAM), respectively;most embedded systems have some of each. If only a small amount ofmemory is required, it might be contained within the same chip as theprocessor. Otherwise, one or both types of memory reside in externalmemory chips.All embedded systems also contain some type of inputsand outputs. For example, in a microwave oven, the inputs are thebuttons on the front panel and a temperature probe, and the outputsare the human-readable display and the microwave radiation. Theoutputs of the embedded system are almost always a function of itsinputs and several other factors (elapsed time, current temperature,etc.). The inputs to the system usually take the form of sensors andprobes, communication signals, or control knobs and buttons.
Theoutputs are typically displays, communication signals, or changes tothe physical world. See for ageneral example of an embedded system. Figure 1-2. A generic embedded systemWith the exception of these few common features, the rest of theembedded hardware is usually unique and, therefore, requires uniquesoftware. This variation is the result of many competing designcriteria.The software for the generic embedded system shown in variesdepending on the functionality needed.
The hardware is the blankcanvas, and the software is the paint that we add in order to make thepicture come to life. Gives justa couple of possible high-level diagrams that could be implemented onsuch a generic embedded system.
Figure 1-3. (a) Basic embedded software diagram and (b) a more complexembedded software diagramBoth the basic embedded software diagram in (a) and themore complex embedded software diagram in (b) containvery similar blocks. The hardware block is common in bothdiagrams.The device drivers are embedded software modules thatcontain the functionality to operate the individual hardware devices.The reason for the device driver software is to remove the need forthe application to know how to control each piece of hardware. Eachindividual device driver would typically need to know only how tocontrol its hardware device. For instance, for a microwave oven,separate device drivers control the keypad, display, temperatureprobe, and radiation control.If more functionality is required, it is sometimes necessary toinclude additional layers in the embedded software to assist with thisadded functionality.
In this example, the complex diagram includes areal-time operating system( RTOS) and a networking stack. The RTOS can helpthe programmer separate the application’s functionality into distincttasks for better organization of the application software and a moreresponsive system. We will investigate the use of an RTOS later inthis book. The network stack also adds to the functionality of thebasic embedded system; a microwave oven might use it to pop up amessage on your desktop computer when your lunch is ready.The responsibilities of the application software layer is thesame in both the basic and the complex embedded software diagrams.
Ina microwave oven, the application processes the different inputs andcontrols the outputs based on what the user commands it to do.You’ll notice that the software in isrepresented by discrete blocks stacked on top of one another withfixed borders. This is done deliberately, to indicate the separationof the different software functional layers that make up the completeembedded software system. Later, we will break down these blocksfurther to show you how you can keep your embedded software clean,easy to read, and portable. Keeping these software layers distinct,with well-defined methods that neighboring layers can use tocommunicate, helps you write good embedded software. Requirements That Affect Design ChoicesEach embedded system must meet a completely different set ofrequirements, any or all of which can affect the compromises andtrade-offs made during the development of the product.
Advantages And Disadvantages Of Embedded Systems Pdf
For example, ifthe system must have a production cost of less than $10, otherdesirable traits—such as processing power and system reliability—mightneed to be sacrificed in order to meet that goal.Of course, production cost is only one of the possibleconstraints under which embedded hardware designers work. Other commondesign requirements include. Processing powerThe workload that the main chip can handle. A commonway to compare processing power is the millions of instructions per second(MIPS) rating. If two otherwise similar processors have ratingsof 25 MIPS and 40 MIPS, the latter is said to be the morepowerful. However, other important features of the processorneed to be considered. One is the register width, which typically ranges from 8 to64 bits.
Today’s general-purpose computers use 32- and 64-bitprocessors exclusively, but embedded systems are still mainlybuilt with less costly 4-, 8-, and 16-bit processors. MemoryThe amount of memory (ROM and RAM) required to hold theexecutable software and the data it manipulates. Here thehardware designer must usually make his best estimate up frontand be prepared to increase or decrease the actual amount as thesoftware is being developed. The amount of memory required canalso affect the processor selection.
In general, the registerwidth of a processor establishes the upper limit of the amountof memory it can access (e.g., a 16-bit address register canaddress only 64 KB (2 16 ) memory locations). Number of unitsThe expected production run. The trade-off betweenproduction cost and development cost is affectedmost by the number of units expected to be produced and sold.For example, it rarely makes sense to develop custom hardwarecomponents for a low-volume product. Power consumptionThe amount of power used during operation.
This is extremelyimportant, especially for battery-powered portable devices. Acommon metric used to compare the power requirements of portabledevices is mW/MIPS (milliwatts per MIPS); the greater thisvalue, the more power is required to get work done. Lower powerconsumption can also lead to other favorable devicecharacteristics, such as less heat, smaller batteries, lessweight, smaller size, and simpler mechanical design. Development costThe cost of the hardware and software designprocesses, known as nonrecurring engineering (NRE). This isa fixed, one-time cost, so on some projects, money is no object(usually for high-volume products), whereas on other projects,this is the only accurate measure of system cost (for theproduction of a small number of units). LifetimeHow long the product is expected to stay in use. Therequired or expected lifetime affects all sorts of designdecisions, from the selection of hardware components to how muchsystem development and production is allowed to cost.
How longmust the system continue to function (on average)? A month, ayear, or a decade? ReliabilityHow reliable the final product must be. If it is achildren’s toy, it may not have to work properly 100 percent ofthe time, but if it’s an antilock braking system for a car, ithad sure better do what it is supposed to do each and everytime.In addition to these general requirements, each system hasdetailed functional requirements.
These are the things that give theembedded system its unique identity as a microwave oven, pacemaker, orpager.illustrates the range of typical values for each of the previous designrequirements. The “low,” “medium,” and “high” labels are meant forillustration purposes and should not be taken as strict delineations.An actual product has one selection from each row. In some cases, twoor more of the criteria are linked. For example, increases in requiredprocessing power could lead to increased production costs.
Conversely,we might imagine that the same increase in processing power would havethe effect of decreasing the development costs—by reducing thecomplexity of the hardware and software design. So the values in aparticular column do not necessarily go together. Digital WatchAt the current peak of the evolutionary path that beganwith sundials, water clocks, and hourglasses is the digital watch.Among its many features are the presentation of the date and time(usually to the nearest second), the measurement of the length of anevent to the nearest hundredth of a second, and the generation of anannoying little sound at the beginning of each hour. As it turns out,these are very simple tasks that do not require very much processingpower or memory. In fact, the only reason to employ a processor at all is to support a range of models andfeatures from a single hardware design.The typical digital watch contains a simple, inexpensive 4-bitprocessor.
Because processors with such small registers cannot addressvery much memory, this type of processor usually contains its ownon-chip ROM. And, if there are sufficient registers available, thisapplication may not require any RAM at all.
In fact, all of theelectronics— processor, memory, counters, and real-time clocks—arelikely to be stored in a single chip. The only other hardware elementsof the watch are the inputs (buttons) and outputs (display andspeaker).A digital watch designer’s goal is to create a reasonablyreliable product that has an extraordinarily low production cost. If, after production, some watches arefound to keep more reliable time than most, they can be sold under abrand name with a higher markup. For the rest, a profit can still bemade by selling the watch through a discount sales channel. Forlower-cost versions, the stopwatch buttons or speaker could beeliminated. This would limit the functionality of the watch but mightrequire few or even no software changes.
And, of course, thecost of all this development effort may be fairly high,because it will be amortized over hundreds of thousands or evenmillions of watch sales.In the case of the digital watch, we see that software,especially when carefully designed, allows enormous flexibility inresponse to a rapidly changing and highly competitive market. Video Game PlayerWhen you pull the Sony PlayStation 2 out from yourentertainment center, you are preparing to use an embedded system. Insome cases, these machines are more powerful than personal computersof the same generation. Yet video game players for the home market arerelatively inexpensive compared with personal computers. It is thecompeting requirements of high processing power and low productioncost that keep video game designers awake at night.The companies that produce video game players don’t usuallycare how much it costs to develop the system as long as the productioncosts of the resulting product are low—typically around a hundreddollars.
They might even encourage their engineers to design customprocessors at a development cost of millions of dollars each. So,although there might be a 64-bit processor inside your video gameplayer, it is probably not the same processor that would be found in ageneral-purpose computer.
In all likelihood, the processor is highlyspecialized for the demands of the video games it is intended toplay.Because production cost is so crucial in the home video gamemarket, the designers also use tricks to shift the costs around. Forexample, one tactic is to move as much of the memory and other peripheral electronics as possible offof the main circuit board and onto the game cartridges.
This helps to reduce the cost of the gameplayer but increases the price of every game. So, while the systemmight have a powerful 64-bit processor, it might have only a fewmegabytes of memory on the main circuit board. This is just enoughmemory to bootstrap the machine to a state from which it can accessadditional memory on the game cartridge.We can see from the case of the video game player that inhigh-volume products, a lot of development effort can be sunk intofine-tuning every aspect of a product. Mars RoverIn 1976, two unmanned spacecrafts arrived on the planet Mars. As partof their mission, they were to collect samples of the Martian surface,analyze the chemical makeup of each, and transmit the results toscientists back on Earth. Those Viking missions were amazing.Surrounded by personal computers that must be rebooted occasionally,we might find it remarkable that more than 30 years ago, a team ofscientists and engineers successfully built two computers thatsurvived a journey of 34 million miles and functioned correctly forhalf a decade.
Clearly, reliability was one of the most important requirementsfor these systems.What if a memory chip had failed? Or the software had containedbugs that had caused it to crash? Or an electrical connection hadbroken during impact?
There is no way to prevent such problems fromoccurring, and on other space missions, these problems have provedruinous. So, all of these potential failure points and many others hadto be eliminated by adding redundant circuitry or extra functionality:an extra processor here, special memory diagnostics there, a hardwaretimer to reset the system if the software got stuck, and so on.More recently, NASA launched the Pathfinder mission.
Its primary goal was to demonstratethe feasibility of getting to Mars on a budget. Of course, given theadvances in technology made since the mid-70s, the designers didn’thave to give up too much to accomplish this. They might have reducedthe amount of redundancy somewhat, but they still gave Pathfinder moreprocessing power and memory than Viking.
The MarsPathfinder was actually two embedded systems: a landing craft and arover. The landing craft had a 32-bit processor and 128 MB of RAM; therover, on the other hand, had only an 8-bit processor and 512 KB ofRAM. These choices reflect the different functional requirements ofthe two systems. Production cost probably wasn’t much of an issue ineither case; any investment would have been worth an improvedlikelihood ofsuccess. Life As an Embedded Software DeveloperLet’s now take a brief look at some of the qualities of embeddedsoftware that set embedded developers apart from other types of softwaredevelopers. An embedded software developer is the one who gets her handsdirty by getting down close to the hardware.Embedded software development, in most cases, requiresclose interaction with the physical world—the hardware platform. We say“in most cases” because there are very large embedded systems thatrequire individuals to work solely on the application-layer software forthe system.
These application developers typically do not have anyinteraction with the hardware. When designed properly, the hardwaredevice drivers are abstracted away from the actual hardware so that adeveloper writing software at the application level doesn’t know how astring gets output to the display, just that it happens when aparticular routine is called with the proper parameters. Hardware knowledgeThe embedded software developer must become intimatelyfamiliar with the integrated circuits, the boards and buses, andthe attached devices used in order to write solid embeddedsoftware (also called firmware). Embedded developers shouldn’tbe afraid to dive into the schematics, grab an oscilloscope probe,and start poking around the circuit to find out what is goingon.
Efficient codeBecause embedded systems are typically designed with theleast powerful and most cost-effective processor that meets theperformance requirements of the system, embedded softwaredevelopers must make every line of code count. The ability towrite efficient code is a great quality to possess as a firmwaredeveloper. Peripheral interfacesAt the lowest level, firmware is veryspecialized, because each component or circuit has its ownactivity to perform and, furthermore, its own way of performingthat activity. Embedded developers need to know how to communicatewith the different devices or peripherals inorder to have full control of the devices in the system. Reactingto stimuli from external peripherals is a large part of embeddedsoftware development.For example, in one microwave oven, the firmware might getthe data from a temperature sensor by reading an 8-bit register inan external analog-to-digital converter; in another system, thedata might be extracted by controlling a serial bus thatinterfaces to the external sensor circuit via a singlewire. Robust codeThere are expectations that embedded systems will run foryears in most cases. This is not a typical requirement forsoftware applications written for a PC or Mac.
Now, there areexceptions. However, if you had to keep unplugging your microwavein order to get it to heat up your lunch for the proper amount oftime, it would probably be the last time you purchased a productfrom that company. Minimal resourcesAlong the same lines of creating a more robust system,another large differentiator between embedded software and othertypes of software is resource constraints. The rules for writingfirmware are different from the rules for writing software for aPC.
Take memory allocation, for instance. An application fora modern PC can take for granted that it will have access topractically limitless resources. But in an embedded system, youwill run out of memory if you do not plan ahead and design thesoftware properly.An embedded software developer must closely manageresources, from memory to processing power, so that the systemoperates up to specification and so failures don’t occur. Forexample, using standard dynamic memory allocation functions cancause fragmentation, and eventually the system may cease tooperate. This requires a reboot since you have no place to storeincoming data.Quite often, in embedded software, a developer will allocateall memory needed by the system at initialization time.
This issafer than using dynamic memory allocation, though it cannotalways be done. Reusable softwareAs we mentioned before, code portability orcode reuse—writing software so that it can bemoved from hardware platform to hardware platform—is very usefulto aid transition to new projects. This cannot always be done; wehave seen how individual each embedded system is. Throughout thisbook, we will look at basic methods to ensure that your embeddedcode can be moved more easily from project to project. So if yournext project uses an LCD for which you’ve previously developed adriver, you can drop in the old code and save some precious timein the schedule.
Development toolsThe tools you will use throughout your career as anembedded developer will vary from company to company and oftenfrom project to project. This means you will need to learn newtools as you continue in your career. Typically, these tools arenot as powerful or as easy to use as those used in PC softwaredevelopment.The debugging tools you might come across could varyfrom a simple LED to a full-blown in-circuit emulator (ICE). This requiresyou, as the firmware developer, and the one responsible fordebugging your code, to be very resourceful and have a bag oftechniques you can call upon when the debug environment islacking.
Throughout the book, we will present different “low-levelsoftware tools” you can implement with little impact on thehardware design.These are just a few qualities that separate embedded softwaredevelopers from the rest of the pack. We will investigate these andother techniques that are specific to embedded software development aswe continue. The C Language: The Lowest Common DenominatorOne of the few constants across most embedded systems is the use of the Cprogramming language.
More than any other, C has become the language ofembedded programmers. This has not always been the case, and it will notcontinue to be so forever. However, at this time, C is the closest thingthere is to a standard in the embedded world. In this section, we’llexplain why C has become so popular and why we have chosen it as theprimary language of this book.Because successful software development so frequently depends onselecting the best language for a given project, it is surprising tofind that one language has proven itself appropriate for both 8-bit and64-bit processors; in systems with bytes, kilobytes, and megabytes ofmemory; and for development teams that range from one to a dozen or morepeople.
Yet this is precisely the range of projects in which C hasthrived.The C programming language has plenty of advantages. It is smalland fairly simple to learn, compilers are available for almost everyprocessor in use today, and there is a very large body of experienced Cprogrammers.
In addition, C has the benefit of processor-independence,which allows programmers to concentrate on algorithms and applicationsrather than on the details of a particular processor architecture.However, many of these advantages apply equally to other high-levellanguages. So why has C succeeded where so many other languages havelargely failed?Perhaps the greatest strength of C—and the thing that sets itapart from languages such as Pascal and FORTRAN—is that it is a very“low-level” high-level language.
As we shall see throughout the book, Cgives embedded programmers an extraordinary degree of direct hardwarecontrol without sacrificing the benefits of high-level languages. The“low-level” nature of C was a clear intention of the language’screators. In fact, Brian W.
Kernighan and Dennis M. Ritchie included thefollowing comment in the opening pages of their book The CProgramming Language (Prentice Hall):C is a relatively “low level” language. This characterization isnot pejorative; it simply means that C deals with the same sort ofobjects that most computers do.
These may be combined and moved aboutwith the arithmetic and logical operators implemented by realmachines.Few popular high-level languages can compete with C in theproduction of compact, efficient code for almost all processors. And, ofthese, only C allows programmers to interact with the underlyinghardware so easily. Other Embedded LanguagesOf course, C is not the only language used by embeddedprogrammers.
At least four other languages—assembly, C, Forth, andAda—are worth mentioning in greater detail.In the early days, embedded software was written exclusively inthe assembly language of the target processor. This gaveprogrammers complete control of the processor and other hardware, butat a price.
Embedded Systems Examples
Assembly languages have many disadvantages, not the leastof which are higher software development costs and a lack of codeportability. In addition, finding skilled assembly programmers hasbecome much more difficult in recent years. Assembly is now usedprimarily as an adjunct to the high-level language, usually only forstartup system code or those small pieces of code that must beextremely efficient or ultra-compact, or cannot be written in anyother way.Forth is efficient but extremely low-level and unusual;learning to get work done with it takes more time than with C.C is an object-oriented superset of C that isincreasingly popular among embedded programmers.
All of the corelanguage features are the same as C, but C adds new functionalityfor better data abstraction and a more object-oriented style ofprogramming. These new features are very helpful to softwaredevelopers, but some of them reduce the efficiency of the executableprogram. So C tends to be most popular with large development teams,where the benefits to developers outweigh the loss of programefficiency.Ada is also an object-oriented language, thoughsubstantially different from C.
Ada was originally designed by theU.S. Department of Defense for the development of mission-criticalmilitary software. Despite being twice accepted as an internationalstandard (Ada83 and Ada95), it has not gained much of a footholdoutside of the defense and aerospace industries. And it has beenlosing ground there in recent years. This is unfortunate because theAda language has many features that would simplify embedded softwaredevelopment if used instead of C or C. Choosing a Language for the BookA major question facing the authors of a book such as thisone is which programming language or languages to discuss. Attemptingto cover too many languages might confuse the reader or detract frommore important points.
On the other hand, focusing too narrowly couldmake the discussion unnecessarily academic or (worse for the authorsand publisher) limit the potential market for the book.Certainly, C must be the centerpiece of any book about embeddedprogramming, and this book is no exception. All of the sample code iswritten in C, and the discussion will focus on C-related programmingissues. Of course, everything that is said about C programming appliesequally to C. We will use assembly language only when aparticular programming task cannot be accomplished in any otherway.We feel that this focus on C with a brief introduction toassembly most accurately reflects the way embedded software isactually developed today and the way it will continue to be developedin the near term.
This is why examples in this edition do not use C.We hope that this choice will keep the discussion clear, provideinformation that is useful to people developing actual systems, andinclude as large a potential audience as possible. However, we docover the impact of C on embedded software in. Consistent Coding PracticesWhatever language is selected for a given project, it isimportant to institute some basic coding guidelines or styles to be followed by alldevelopers on a project. Coding guidelines can make reading codeeasier, both for you and for the next developer that has to inherityour code. Understanding exactly what a particular software routine isdoing is difficult enough without having to fight through severalchanges in coding style that emerged because a number of differentdevelopers touched the same routine over the years, each leaving hisown unique mark.
Stylistic issues, such as how variables are named orwhere the curly brace should reside, can be very personal to somedevelopers.There are a number of decent coding standards floating around onthe Internet. One standard we like is located online at and wasdeveloped by Jack Ganssle. Another that we like, by Miro Samek, is located online at.These standards give you guidelines on everything from directorystructures to variable names and are a great starting point; you canincorporate into them the styles that you find necessary and helpful.If a coding standard for the entire team is not something you can sellyour company on, use one yourself and stick to it.
A Few Words About HardwareIt is the nature of programming that books about thesubject must include examples. Typically, these examples are selected sothat interested readers can easily experiment with them. That meansreaders must have access to the very same software development tools andhardware platforms used by the authors.
Unfortunately, it does not makesense to run any of the example programs on the platforms available tomost readers—PCs, Macs, and Unix workstations.Even selecting a standard embedded platform is difficult. As youhave already learned, there is no such thing as a “typical” embeddedsystem. Phd in history through distance education technology. Whatever hardware is selected, the majority of readers will nothave access to it.
But despite this rather significant problem, we dofeel it is important to select a reference hardware platform for use inthe examples. In so doing, we hope to make the examples consistent and,thus, the entire discussion more clear—whether you have the chosenhardware in front of you or not.In choosing an example platform, our first criterion was that theplatform had to have a mix of peripherals to support numerous examplesin the book.
In addition, we sought a platform that would allow readersto carry on their study of embedded software development by expanding onour examples with more advanced projects. Another criterion was to finda development board that supported the GNU software development tools; with their open sourcelicensing and coverage on a wide variety of embedded processors, the GNUdevelopment tools were an ideal choice.The chosen hardware consists of a 32-bit processor ( the XScale ARM )a hefty amount of memory (64 MB of RAM and 16MB of ROM), and some common types of inputs, outputs, and peripheralcomponents. The board we’ve chosen is called the VIPER-Lite and is manufactured and sold by Arcom.
Embedded Systems Vs Operating Systems
A picture of the ArcomVIPER-Lite development board (along with the add-on module and othersupporting hardware) is shown in. Additionalinformation about the Arcom board and instructions for obtaining one canbe found in. Figure 1-4. The Arcom VIPER-Lite development boardsIf you have access to the reference hardware, you will be able towork through the examples in the book as they are presented. Otherwise,you will need to port the example code to an embedded platform that youdo have access to. Toward that end, we have made every effort to makethe example programs as portable as possible. However, the reader shouldbear in mind that the hardware is different in each embedded system andthat some of the examples might be meaningless on hardware differentfrom the hardware we have chosen here.
For example, it wouldn’t makesense to port our flash memory driver to a board that had no flashmemory devices.Although we will get into some basic details about hardware, themain focus of this book is embedded software. We recommend that you takea look at Designing Embedded Systems by JohnCatsoulis (O’Reilly). John has an extensive background on the subjectand does a wonderful job presenting often difficult material in a veryunderstandable way.
It makes a great companion for this book.