Title: Embedded Systems Software Development
1Embedded Systems Software Development
- Robert Oshana
- National Technological University
2Lecture 3
- Examples of embedded and real-time systems
3Agenda
- Examples of embedded and real-time systems
- Digital watch
- Video game
- Space craft
- Airbag system
- Digital still camera
- Cell phone
4Embedded system components
Software
Memory
FPGA/ ASIC
CPU
D/A conversion
Actuators
A/D conversion
Sensors
Aux system (power cooling, etc
User interface
Diagnostic port
Electromechanical Backup and safety
External environment
5Digital watch
- Requirements
- Presentation of date and time with accuracy to
the nearest second - Measurement of the length of an event to the
nearest 100th of a second - Audible sound at certain time periods
- Not much processing power required to do this
6Digital watch
- Typical digital watch is an 8-bit processor
- Usually has its own on chip ROM
- May not require any RAM at all if sufficient
registers on chip - Processor, memory, counters, real-time clock all
on one chip
7Digital watch
- Other hardware
- Inputs (buttons on the watch)
- Outputs (LCD and speaker)
- Designers goals
- Reasonably reliable product
- Extraordinarily low production cost
- Support product line architecture
- Low cost versions can eliminate stopwatch buttons
or the speaker - Would limit functionality but may not change
software at all
8Digital watch
- Development cost can be higher
- Amortized over thousands or millions of units
9Video game player
- Nintendo-64 and Playstation are examples of
embedded systems - Very powerful machines
- Relatively inexpensive compared to PCs
- Big challenge here is high processing power and
low production cost
10Video game player
- Develop cost is usually not an issue
- Custom processors if necessary
- Special demands of video games
- Production cost must be low (approx 100)
- Shift costs if possible
- Move memory and other peripherals from the main
circuit board to the game cartridges - Decreases cost of unit and increases cost of each
game
11Video game player
- 64-bit processor ends up having only a few MB of
memory - Enough to boot the system to a state where it can
access memory on the game cartridge
12Mars Explorer
- Unmanned spacecraft landing on Mars to collect
and analyze the surface - System built with 20 year old technology
- 34 million mile journey
- Functioned correctly for over 5 years
- Reliability was most important requirement in
this system
13Mars Explorer
- Failure points had to be understood and planned
for - Redundant circuitry
- Extra functionality
- Extra processors
- Special memory diagnostics
- Hardware timers to reset system if it hung
14Sensors and Actuators
15Airbag System Possible Sensors(Including Crash
Severity and Occupant Detection)
SAT satellite with serial communication
interface ECU central airbag control unit
(including accelerometers) ROS roll over
sensing unit WS weight sensor BS buckle switch
16Airbag System Possible Actuators(Including
Crash Severity and Occupant Detection)
ECU
TB Thoraxbag PBP pyrotechnical buckle
pretensioner with load limiter ECU central
airbag control unit
Near future airbag systems gtgt 10 actuator outputs
17Automotive Seat Occupancy Detection
DSP-based Emb system (Processes Information)
Seat w/ Fiber Sensing Technology
- Airbag Deployment Decisions
- (fire airbag? which airbags?
- how much to inflate?, etc.)
18Embedded System - Digital Still Camera
19Embedded System - Cell Phone
20Example embedded program
- Classic hello world is difficult to do in
embedded systems - Used to verify no problems with development tools
or process - Assumes output device to print characters (may
not be one) - Or may require display driver to be written first
- Must begin with assumption that nothing works!
21Example embedded program
- Standard library routines are not there (printf
and scanf) - Requirements for a simple blinking LED system
- Blink and LED at the rate of 1 Hz
Embedded processor P2LTCH
Embedded processor P2LTCH
0100 0000
0100 0000
Green LED
Green LED
22Superstructure
/
Fu
nction main( ) Description Blink the
green LED once a second Notes This outer
loop is hardware independent. However, it
depends on the two hardware dependent
functions Returns This routine contains an
infinite loop
/ void main(void) while
(1) toggleLed(LED_GREEN) / change the
state of the LED / delay(500)
/ pause for 500 milliseconds /
/ main() /
23toggleLed
define P2LTCH 0xFF5E / the offset of
the P2LTCH register / /
Function toggleLed(
) Description toggle the state of one or
both LEDs Notes This function is specific
to Arcoms Target188EB board. Returns None
defined.
/ void toggleLed(unsigned char
ledMask) asm mov dx, P2LTCH / load
the address of the register / in a1, dx
/ read the contents of the register
/ mov ah, ledMask / move the ledMask into
a register / xor a1, ah /
toggle the new requested bits / out dx, a1
/ write the new register contents
/ / toggleLed( ) /
24delay
/
Fu
nction delay( ) Description busy-wait for
the requested number of milliseconds Notes
the number of decrement and test cycles per
millisecond was determined through trial and
error. This value is dependent upon the
processor type and speed Returns None
defined.
/ void delay(unsigned int nMilliseconds)
define CYCLES_PER_MS 260 / number of decrement
and test cycles / unsigned long nCycles
nMilliseconds CYCLES_PER_MS while
(nCycles--) / delay( ) /
25Role of the infinite loop
- Fundamental difference with embedded systems is
that they never end! (infinite loop) - Software makes the embedded system work and
should ALWAYS be running - Digital watch
- Cell phone
- Dont forget to wrap code in infinite loop