Professional Documents
Culture Documents
Lecture 1
-
Introduction to
Embedded Systems
-
Damir Isovic
1
2012-09-03
Example: Airbag
Airbags are inflatable cushions built into the steering wheel or dashboard,
designed to rapidly expand in a frontal crash.
When the car hits something, it gets decelerated (looses speed). If the
deceleration is fast enough, the crash sensors are triggered, and they
notify the control unit to inflate the airbag.
Airbag
Crash
sensors
Crash
2
2012-09-03
3
2012-09-03
4
2012-09-03
5
2012-09-03
Embedded
computers
98%
Desktop
computers 2%
Embedded system vs PC
Desktop PC
• A general purpose product
• Performs many different things
• Significant system resources
• Advanced GUI
• Executes at its own pace
Embedded system
• A single purpose product
• Does one or a few things efficiently
• Often simpler and more application specific
hardware
• Often primitive and dedicated user interface
ECU
(no mouse, keyboard and screen)
• Execute at a pace determined by the
environment
6
2012-09-03
Embedded system vs PC
Must be efficient
• Energy efficient
• Code size efficient
• Run-time efficient
• Weight efficient
• Cost efficient – often a mass product
Pacemaker battery
• All unneeded features are a disadvantage! lifetime is 7-12 years
7
2012-09-03
Reactive systems
• connected to physical environment through sensors Airbag
and actuators
• execute at a pace determined by the environment
Reliable (dependable)
• How reliable the result product must be
• Depends very much on the product:
o An antilock braking system for a car most always work
o A children's toy may still be useful even if it contains minor bugs
8
2012-09-03
Real-time systems
9
2012-09-03
…otherwise…
Delayed signal
10
2012-09-03
3. Wheel disc
2. Pressure
brakes
passed to the
squeezed
brake fluid
1. Brake
pedal
pushed
Embedded Controller
Displayed
pictures
per second
Perceived as
30 smooth video
24
Not perceived as
15 smooth video
10
11
2012-09-03
Example: Airbag
Let’s look again on our example with the airbag….
Airbag
Crash
sensors
Crash
REAL-TIME:
The decision to deploy an airbag is made within 15 to 30 milliseconds
after the onset of the crash, and the airbags are inflated within
approximately 50-80 milliseconds.
Example: Airbag
The airbag must not be inflated too late, nor too early!
Collision
Too early Too late
time
Real-time ≠ fast !
Real-Time = predictable!
12
2012-09-03
How?
Predictable vs fast
13
2012-09-03
Predictable vs fast
Hard real-time
• Hard deadlines – catastrophe if deadline is missed
• Worst-case system behavior considered
• E.g. automotive, airplanes, industrial control, …
Soft real-time
• Fuzzier deadlines – can miss some deadlines
• Average-case considered
• E.g., consumer electronics
14
2012-09-03
15
2012-09-03
16
2012-09-03
Assembly languages
• today primarily used as a complement to a ...
high-level language MOVE (_X),D0
CMP D0,#5
• Usually only for startup system code or small BGT L1
code pieces which cannot be written in any MUL D0,#3
MOVE D0
other way JMP L2
L1: ADD D0,#1
• Lacks code portability L2:
• Finding skilled assembly programmers is hard ...
C++
• An object-oriented superset of C ...
class Thread {
• offers greater opportunities for expression, public:
encapsulation, re-use than C Thread();
int Start(void *arg);
• Increasingly popular among embedded protected:
int Run(void * arg);
programmers static void *Entry(void*);
…
• Hard to make C++ code as compact and };
Thread::Thread() {}
efficient as C code
Java
• Object-oriented language
...
• Increasingly popular among high-end ES class RunnableThread
implements Runnable
programmers {
− However, only subsets of the Java Thread runner;
public RunnableThread() {}
environment is normally used public RunnableThread(String
− Java’s byte code interpretation might be threadName)
{
slower and less predictable than running runner = new Thread(this,
precompiled machine code threadName);
runner.start();
• There exists special processors running Java }
byte code (picoJava, ARM926RJ-S,…) }
…
17
2012-09-03
Reusable software
• Writing reusable code is useful to aid transition to new projects
• This cannot always be done, since many ES are very individual
Development tools
• There is a large variety of ES development tools
• They are usually less powerful and easy to use than the
corresponding PC development tools
18
2012-09-03
Hardware knowledge
• An ES developer gets close to the hardware
• Things like integrated circuits, boards, buses, attached devices,
schematics, and oscilloscopes must be well understood
Peripheral interfaces
• Embedded developers need to know how to communicate with the
different devices or peripherals in order to have full control of the
devices in the system
19
2012-09-03
Pedometer
• Count steps, keep time, averages, etc.
• Identify when a step is actually taken
• 8-bit processor, runs ~forever on a
single battery
20
2012-09-03
Forestry machines
• Controlling arms & tools
• Navigating the forest
• Communicate with
remote database
• Tough environment
− -40°C at startup, +100°C when
running
• 16-bit C167 processors
• CAN network
Mobile phones
• Multiprocessor
− 8/16/32-bit for UI
− DSP for radio
− 32-bit ARM in IR port
− 32-bit ARM in Bluetooth
− 10-200 MHz main CPU
• Huge memories
• Huge amount of software
Automotive
• Multiple networks
• CAN for body electronics: 30+ nodes
• CAN for engine control: few nodes
• LIN for instruments
• MOST for infotainment
• Many diverse processors
• 8-bit - door locks, lights, etc.
• 16-bit - most functions
• 32-bit - engine control, airbags
21
2012-09-03
This course...
Today, all advanced products contain embedded systems…
Mars Pathfinder
…they are tricky…. Mars, July 4, 1997
Lost contact
due to embedded
software failure.
Ariane 5
…they are risky…. French Guyana, June 4, 1996
$800 million
embedded software
failure
This course…
22