Lecture 01
Lecture 01
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
Existence of processor & software should be completely unnoticed by a device user Eg: microwave oven, VCR, alarm clock
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
11
12
14
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
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: 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
27
28
29
30
31
32
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.
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
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
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
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
43
44
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
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
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