Embedded Software Engineering

What is an embedded system?

Combination of computer hardware, software, and some mechanical parts,

Designed to perform a specific function.

Every household has one!

Very few people realize that a processor and software are involved in the preparation of their lunch or dinner!!!

General-purpose computer is not designed to perform a specific function. It is a blank slate!

 

 

ppt53 trang | Chia sẻ: việt anh | Lượt xem: 1244 | Lượt tải: 0download
Bạn đang xem trước 20 trang mẫu tài liệu Embedded Software Engineering, để tải tài liệu gốc về máy bạn click vào nút DOWNLOAD ở trên
g constraintsMake certain calculations or decisions in a timely mannerA missed deadline is as bad as a wrong answerConsequences of a missed deadline:severe  hard real-timeacceptable  soft real-time9ESEEmbedded System VariationBesides CPU and software, what else is common among embedded systems?Memory storage: ROM, RAM, Input: knobs, buttons, probes, sensors, communication signals, Output: human-readable display, microwave radiation, communication signals, changes to physical worldOutputs = functions (inputs, elapsed time, current temperature, etc.)10ESEGeneric Embedded System11ESEProduction CostProcessing powerMemoryDevelopment costNumber of unitsExpected lifetimeReliabilityCommon design requirements12ESECommon Design Requirements13ESEExamples of Embedded SystemsDigital WatchTelegraphCordless Bar-Code ScannerLaser PrinterVideo Game PlayerUnderground Tank MonitorMars ExplorerNuclear Reactor Monitor14ESEDigital WatchFunction:display date/timemeasure event length to the nearest 1/100 sSimple tasksSmall processing power or memoryThen, why use a processor?Ans: to support a range of models & features from a single hardware15ESEDigital Watch (contd)Simple, inexpensive 8-bit processorOn-chip ROMOnly registers, no RAMInputs: buttonsOutputs: LCD and speakerRequirements:High reliabilityLow production cost16ESETelegraphConnects a printer to a networkPrinter has a high-speed serial portTelegraph description:Little plastic box2 to 3 inches on a side½ inch thickpigtail cable connects to printer serial portnetwork connector17ESETelegraph (sketch)18ESETelegraph (functions)Receive data from networkCopy data to serial port of printerSort unordered data packets and provide a clean data stream to printerFeed printer one print job at a time and hold off all other computersNetwork printer must provide status information to any requesting computer on network, even if it is busy printing19ESETelegraph (functions)Work with several types of printers without user configurationRespond rapidly to certain events: various kinds of network frames to which Telegraph must send response within 200 microsecondsMust keep trace of time. If a computer crashes, must give up on that print job after 2 minutes and print from another computer. Otherwise, printer will be unavailable.20ESETelegraph Development ChallengesThroughputResponseTestabilityDebugabilityReliabilityMemory SpaceProgram Installation21ESETelegraph: ThroughputPrinter can print only as fast as Telegraph provides data to itMust not be a bottleneck between computer and printer Throughput = run fasterSolution: clever programmingbetter searching and sortingbetter numerical algorithmsdata structures faster to parse22ESETelegraph: ResponseResponse to frames within 200 microsecondsResponse is a common problem in embedded systemsTradeoff betweenThroughput, andResponse23ESETelegraph: TestabilityNot easy to determine if it worksLot of software deals with uncommon eventsEmbedded systems must deal with ANYTHING without human interventionEg: lots of code deals with the problem of network data lossHowever, data does not get lost often, especially in a perfect, new labHard to test those lines of code24ESETelegraph: DebugabilityWhat if testing uncovers a bug?Telegraph has no screen, no keyboard, no speaker, not even little lights!No cute icons or message boxes!It just stops working!A bug in network software?A bug in software for tracking printing job?A bug in software for printer status reporting?25ESETelegraph: ReliabilityIt is not allowed to crash!Customers may have tolerance for crash/reboot of PC, but nobody has patience for little plastic boxes that CRASH!Must function without human intervention26ESETelegraph: Memory Space32 KB memory for program32 KB memory for dataHow to make software fit into the available space?A necessary skill for embedded-system software engineers!27ESETelegraph: Program InstallationThe software in Telegraph did not get there because someone clicked a mouse on an icon!How to install software into embedded systems?What tools are necessary?28ESECordless Bar-Code ScannerUser pulls triggerCordless Bar-Code Scanner activates laser to read bar codeSends bar code across a radio link to cash register29ESECordless Bar-Code Scanner30ESECordless Bar-Code ScannerHow different is its design from telegraph?Mostly same problems as telegraphNo problem of throughput:little data in a bar codeuser can’t pull the trigger that fastOne problem the telegraph does not have: Power Consumption31ESECordless Bar-Code Scanner:Power ConsumptionCordless  power source = batteryHandheld  limited weight of battery 	(for comfortable use)How long must battery last?Forever!!! 	(Infeasible)Next best answer:Last for an 8-hour shiftRecharge in holster at night32ESECordless Bar-Code Scanner:Power Consumption8-hours also not feasible!How to run laser, microprocessor, memory, and radio for 8 hours on battery?Solution: Use software to turn off hardware that are not needed at any given time, including processor!33ESELaser PrinterHigh processing powerMicroprocessor responsible forgetting data from printer portssensing user button press on control panelpresenting messages to user on control panelsensing paper jamsrecovering from paper jamsnoticing printer is out of paperetc.34ESELaser Printer: Processor HogsPrint job:text on a slanted lineunusual fontscrewball sizeFigure out where the black dots go on a page!Users expect quick response when they push buttons, no concern oftrigonometric function value computationswhere serifs of a rotated letter should go?35ESEVideo Game PlayerSome features are more powerful than PCHigh processing powerLow production costCompanies don’t care how much it costs to develop the system but, production cost must be low (~US$100)!Even encourage engineers to design custom processors at hundreds of thousands dollarsHighly specialized processor!36ESEVideo Game Player (contd)Production cost is crucialTricks to shift costs aroundMove as much memory and other peripheral electronics as possibleoff of the main circuit board andonto the game cartridges!Powerful 64-bit CPU + few MB memoryEnough to bootstrap the machine to a state from which additional memory on the game cartridges can be accessed37ESEUnderground Tank MonitorWatches gasoline levels in the underground tanks at a gas stationDetect leaks before gas station turns into a toxic waste dump by mistakeSet off a loud alarm if a leak is discoveredSystem description16 buttons20-character Liquid Crystal Display (LCD)Thermal printer38ESEUnderground Tank Monitor (contd)How much gasoline is in a tank?Read the level of two floats in the tanklevel of gasolinelevel of water at the bottom of tankRead temperature at various levels in tank (gasoline expands & contracts considerably with temperature changes)No false alarms (gasoline cooled off, contracted, float lowered  alarm?)39ESEUnderground Tank Monitor: Costbuys one only because government agencytells the gas station owner he has to!thus, as inexpensive as possible!Extremely inexpensive microcontroller: add 8- bit numbersMicroprocessor will be very busy just calculating how much gasoline there is really down there  processor hog40ESEMars ExplorerIn 1976, two unmanned spacecraft arrived on the planet Mars.to collect samples of Martian surface, analyze chemical makeup, transmit results back to earthPC rebooted everydayBUT, 2 computers survived a journey of 34 million miles and functioned correctly for 5 years!!! RELIABILITY!!!41ESEMars ExplorerNASA launched the PathfinderPrimary goal: getting to Mars on a budgetTwo embedded systemsa landing craft: 32-bit CPU, 128 MB RAMa rover: 8-bit CPU, 512 KB RAMLow production cost42ESEMars ExplorerWhat if a memory chip failed?Or, software bugs caused a crash?Fault tolerance:Redundant circuitryExtra functionalityExtra processorSpecial memory diagnosticsHardware timer to reset system if software got stuck43ESENuclear Reactor MonitorMust do many thingsOnly thing of interest to us:two temperatures must be always equalIf not, a malfunction!Consequence: disastrous!!!44ESEWhy C for embedded software?a “very-level” high-level languagecompact, efficient code for almost all processorsdirect hardware control, without losing the benefits of a high-level languageappropriate for both 8-bit and 64-bit processorsfor systems with bytes, KB, MB of memoryfor design teams of 1, 12, or more people45ESEOther embedded languagesassembly languageC++AdaVHDL46ESEAssembly Languagecomplete control of CPU and hardwarehigh software development costslack of code portabilitylack of skilled assembly programmersused as an adjunct to high-level languages, for small pieces of code that must beextremely efficient orultra-compact, orcannot be written in any other way.47ESEC++better data abstractionreduce efficiency of executable programsmore popular with large development teams, where the benefits to developers outweighs the loss of program efficiency48ESEAdaObject-Oriented Substantially different from C++ Designed by US Department of Defense For mission-critical military software development Twice accepted as international standard (Ada83, Ada95)Not popular outside of defense and aerospace industries49ESEVHDLVHSIC (Very high speed integrated circuits) Hardware Description Language.1980-1990 y.Mentor Graphics, Cadence, Synopsys, Xilinx, Altera: FPGA50ESETypical HardwareMicroprocessor: execute codeMemory: different memories for program & dataEmbedded systems do not have the following:a keyboarda screena disk driveCD, speakers, microphones, diskettes, modemsEmbedded systems have: serial port, network interface, sensors, actuators, etc.51ESEProgramming Embedded Systems in Cand C++ (Design Platform)Arcom Control Systems’ Target188EB boardIntel’s 16-bit 80188EB processor128 KB RAM256 KB ROMinputsoutputsperipheral components52ESEMicroprocessors in embedded systems53ESEHomeworkRead Reference/Textbook [1]Report onStudy and Install/Implement uC/OSRun the sample programsModify some features and programs 54ESE

File đính kèm:

  • pptembedded_software_development_lecture01_6391.ppt
Tài liệu liên quan