0% found this document useful (0 votes)
74 views

Lecture 01

The document provides an overview of the graduate course "Embedded Software Engineering" including textbooks, what an embedded system is, the history and future of embedded systems, examples of embedded systems like a digital watch, telegraph, and bar-code scanner, and common design requirements. It discusses embedded system variations, real-time systems, and gives more details on examples like a laser printer, video game player, and underground tank monitor.

Uploaded by

Xuan Hoang
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Lecture 01

The document provides an overview of the graduate course "Embedded Software Engineering" including textbooks, what an embedded system is, the history and future of embedded systems, examples of embedded systems like a digital watch, telegraph, and bar-code scanner, and common design requirements. It discusses embedded system variations, real-time systems, and gives more details on examples like a laser printer, video game player, and underground tank monitor.

Uploaded by

Xuan Hoang
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Embedded Software Engineering

Graduate Course ESE (INT 6031, 2013-2014) Lecturer: Dr. Nguyen Ngoc Binh Email: [email protected] Http://www.uet.vnu.edu.vn/~nnbinh

Textbooks, References
[GT] Cng ngh phn mm nhng, N.N. Bnh (sp xut bn)
[1] An Embedded Software Primer, by David Simon, AddisonWesley, 1999, ISBN: 020161569X. [2] MicroC OS II: The Real Time Kernel, by Jean J. Labrosse, CMP Books, 2002, ISBN: 1578201039. [3] Embedded System Design: An Introduction to Processes, Tools, and Techniques, by Arnold S. Berger, CMP Books, 2001, ISBN: 1578200733. [4] Programming Embedded Systems in C and C++, by Michael Barr, OReilly and Associates, 1999, ISBN: 1565923545. [5] Introduction to Embedded Systems Using Windows Embedded CE, by James O. Hamblen, eBook at http://www.microsoft.com/education/facultyconnection/article s/articledetails.aspx?cid=1814&c1=en-us&c2=0 [6] eBook and websites on Linux/GCC, Android, iOS, Windows CE,
2

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!

What is an embedded system?


Installed in a larger system Eg: cars and trucks contain many embedded systems
anti-lock brake controller vehicle emission monitor and controller dashboard information display

Existence of processor & software should be completely unnoticed by a device user Eg: microwave oven, VCR, alarm clock

History and Future


When did embedded systems first appear? Not before 1971! Why? Intel designed the worlds first microprocessor, the 4004, in 1971! 4004 was designed for use in a line of business calculators produced by a Japanese company Busicom. In 1969, Busicom asked Intel to design a set of IC --- one for each of their new calculator models The 4004 was Intels response.
5

History and Future


The microprocessor was an overnight success! Increased use in the next decade:
unmanned space probes computerized traffic lights aircraft flight control systems

In 1980s, embedded systems quietly rode the waves of microcomputer age.

History and Future


Electronic devices in kitchen
bread machines food processors microwave ovens

History and Future


Embedded systems will continue to increase Light switches and thermostats controlled by a central computer Intelligent air-bag systems that dont inflate when children or small adults are present Personal Digital Assistants (PDA) Digital cameras Dashboard navigation systems

offices
fax machines pagers laser printers cash registers credit card readers

living rooms
TV stereos remote controls

Real-Time Systems
Most embedded systems are real-time Has timing constraints Make certain calculations or decisions in a timely manner A missed deadline is as bad as a wrong answer Consequences of a missed deadline:
severe hard real-time acceptable soft real-time

Embedded System Variation


Besides 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 world Outputs = functions (inputs, elapsed time, current temperature, etc.)
9 10

Generic Embedded System

Embedded System

11

12

Common design requirements


Production Cost Processing power Memory Development cost Number of units Expected lifetime Reliability
13

Common Design Requirements

14

Examples of Embedded Systems


Digital Watch Telegraph Cordless Bar-Code Scanner Laser Printer Video Game Player Underground Tank Monitor Mars Explorer Nuclear Reactor Monitor
15

Digital Watch
Function:
display date/time measure event length to the nearest 1/100 s

Simple tasks Small processing power or memory Then, why use a processor? Ans: to support a range of models & features from a single hardware

16

Digital Watch (contd)


Simple, inexpensive 8-bit processor On-chip ROM Only registers, no RAM Inputs: buttons Outputs: LCD and speaker Requirements:
High reliability Low production cost

Telegraph
Connects a printer to a network Printer has a high-speed serial port Telegraph description:
Little plastic box 2 to 3 inches on a side inch thick pigtail cable connects to printer serial port network connector

17

18

Telegraph (sketch)

Telegraph (functions)
Receive data from network Copy data to serial port of printer Sort unordered data packets and provide a clean data stream to printer Feed printer one print job at a time and hold off all other computers Network printer must provide status information to any requesting computer on network, even if it is busy printing

19

20

Telegraph (functions)
Work with several types of printers without user configuration Respond rapidly to certain events: various kinds of network frames to which Telegraph must send response within 200 microseconds Must 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.
21

Telegraph Development Challenges


Throughput Response Testability Debugability Reliability Memory Space Program Installation
22

Telegraph: Throughput
Printer can print only as fast as Telegraph provides data to it Must not be a bottleneck between computer and printer Throughput = run faster Solution: clever programming
better searching and sorting better numerical algorithms data structures faster to parse

Telegraph: Response
Response to frames within 200 microseconds Response is a common problem in embedded systems Tradeoff between
Throughput, and Response

23

24

Telegraph: Testability
Not easy to determine if it works Lot of software deals with uncommon events Embedded systems must deal with ANYTHING without human intervention Eg: lots of code deals with the problem of network data loss However, data does not get lost often, especially in a perfect, new lab Hard to test those lines of code

Telegraph: Debugability
What 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?

25

26

Telegraph: Reliability
It 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 intervention

Telegraph: Memory Space


32 KB memory for program 32 KB memory for data How to make software fit into the available space? A necessary skill for embedded-system software engineers!

27

28

Telegraph: Program Installation


The 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?

Cordless Bar-Code Scanner


User pulls trigger Cordless Bar-Code Scanner activates laser to read bar code Sends bar code across a radio link to cash register

29

30

Cordless Bar-Code Scanner

Cordless Bar-Code Scanner


How different is its design from telegraph? Mostly same problems as telegraph No problem of throughput:
little data in a bar code user cant pull the trigger that fast

One problem the telegraph does not have: Power Consumption

31

32

Cordless Bar-Code Scanner: Power Consumption


Cordless power source = battery Handheld limited weight of battery (for comfortable use) How long must battery last? Forever!!! (Infeasible) Next best answer:
Last for an 8-hour shift Recharge in holster at night

Cordless Bar-Code Scanner: Power Consumption


8-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!

33

34

Laser Printer
High processing power Microprocessor responsible for
getting data from printer ports sensing user button press on control panel presenting messages to user on control panel sensing paper jams recovering from paper jams noticing printer is out of paper etc.

Laser Printer: Processor Hogs


Print job:
text on a slanted line unusual font screwball size

Figure out where the black dots go on a page! Users expect quick response when they push buttons, no concern of
trigonometric function value computations where serifs of a rotated letter should go?

35

36

Video Game Player


Some features are more powerful than PC High processing power Low production cost Companies dont 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 dollars Highly specialized processor!

Video Game Player (contd)


Production cost is crucial Tricks to shift costs around Move as much memory and other peripheral electronics as possible
off of the main circuit board and onto the game cartridges!

Powerful 64-bit CPU + few MB memory Enough to bootstrap the machine to a state from which additional memory on the game cartridges can be accessed
37 38

Underground Tank Monitor


Watches gasoline levels in the underground tanks at a gas station Detect leaks before gas station turns into a toxic waste dump by mistake Set off a loud alarm if a leak is discovered System description
16 buttons 20-character Liquid Crystal Display (LCD) Thermal printer

Underground Tank Monitor (contd)


How much gasoline is in a tank? Read the level of two floats in the tank
level of gasoline level of water at the bottom of tank

Read temperature at various levels in tank (gasoline expands & contracts considerably with temperature changes) No false alarms (gasoline cooled off, contracted, float lowered alarm?)

39

40

Underground Tank Monitor: Cost


buys one only because government agency tells the gas station owner he has to! thus, as inexpensive as possible! Extremely inexpensive microcontroller: add 8bit numbers Microprocessor will be very busy just calculating how much gasoline there is really down there processor hog

Mars Explorer
In 1976, two unmanned spacecraft arrived on the planet Mars. to collect samples of Martian surface, analyze chemical makeup, transmit results back to earth PC rebooted everyday BUT, 2 computers survived a journey of 34 million miles and functioned correctly for 5 years!!! RELIABILITY!!!

41

42

Mars Explorer
NASA launched the Pathfinder Primary goal: getting to Mars on a budget Two embedded systems
a landing craft: 32-bit CPU, 128 MB RAM a rover: 8-bit CPU, 512 KB RAM

Mars Explorer
What if a memory chip failed? Or, software bugs caused a crash? Fault tolerance:
Redundant circuitry Extra functionality Extra processor Special memory diagnostics Hardware timer to reset system if software got stuck

Low production cost

43

44

Nuclear Reactor Monitor


Must do many things Only thing of interest to us:
two temperatures must be always equal

New Mobile Devices


Smartphones
iOS Devices (iPhone, iPad, iPod, )

If not, a malfunction! Consequence: disastrous!!!

Android Devices (SONY, Kyocera, Nokia)

http://en.wikipedia.org/wiki/List_of_iOS_devices

45

http://www.android.com/devices/

46

Cu trc H nhng

Cu trc chung ca TD

47

48

Why C for embedded software?


a very-level high-level language compact, efficient code for almost all processors direct hardware control, without losing the benefits of a high-level language appropriate for both 8-bit and 64-bit processors for systems with bytes, KB, MB of memory for design teams of 1, 12, or more people

Other embedded languages


assembly language C++ Ada

49

50

Assembly Language
complete control of CPU and hardware high software development costs lack of code portability lack of skilled assembly programmers used as an adjunct to high-level languages, for small pieces of code that must be
extremely efficient or ultra-compact, or cannot be written in any other way.

C++
better data abstraction reduce efficiency of executable programs more popular with large development teams, where the benefits to developers outweighs the loss of program efficiency

51

52

Ada
Object-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 industries

Typical Hardware
Microprocessor: execute code Memory: different memories for program & data Embedded systems do not have the following:
a keyboard a screen a disk drive CD, speakers, microphones, diskettes, modems

Embedded systems have: serial port, network interface, sensors, actuators, etc.
53 54

Programming Embedded Systems in C and C++ (Design Platform)


Arcom Control Systems Target188EB board Intels 16-bit 80188EB processor 128 KB RAM 256 KB ROM inputs outputs peripheral components

Microprocessors in embedded systems

55

56

Homework
Read Reference/Textbook [1] Report on
Study and Install/Implement uC/OS Run the sample programs Modify some features and programs

57

You might also like