lecture 1: introduction to embedded systems - ntnu · lecture 1: introduction to embedded systems...
TRANSCRIPT
![Page 1: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/1.jpg)
1
www.ntnu.no TDT4258
Lecture 1: Introduction to Embedded Systems
Asbjørn DjupdalARM Norway and IDI, NTNU2013
www.ntnu.no TDT4258
![Page 2: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/2.jpg)
2
www.ntnu.no TDT4258
Lecture overview
• Introduction
• Characteristics of embedded computers
• Embedded system design
• Design process examples
![Page 3: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/3.jpg)
3
www.ntnu.no TDT4258
Lecture overview
• Introduction
• Characteristics of embedded computers
• Embedded system design
• Design process examples
![Page 4: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/4.jpg)
4
www.ntnu.no TDT4258
Embedded systems
Any device that includes a programmable computer but is not itself a general-purpose computer
![Page 5: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/5.jpg)
5
www.ntnu.no TDT4258
Examples
• Washing machine• Quartz wristwatch• PC keyboard• Printer• TV, radio• GPS• Digital camera
Embedded systems are everywhere!
![Page 6: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/6.jpg)
6
www.ntnu.no TDT4258
Example: Automotive
• Over 100 embedded processors– Check seat belt– Dashboard devices– Engine control– Brake system– ...
• Many different systems with various processing and communication needs
![Page 7: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/7.jpg)
7
www.ntnu.no TDT4258
Lecture overview
• Introduction
• Characteristics of embedded computers
• Embedded system design
• Design process examples
![Page 8: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/8.jpg)
8
www.ntnu.no TDT4258
Characteristics of embedded systems• Take advantage of application characteristics to
optimize the design
• Very varied– From simple to sophisticated functionality– May have real-time requirements– Probably requires low manufacturing cost– Often has low power as requirement– Might have environment requirements
• Designed with tight deadlines by small teams– Acceptable is good enough
![Page 9: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/9.jpg)
9
www.ntnu.no TDT4258
Functional complexity
• Functional complexity can be high for some devices
• Sophisticated algorithms– Laser printer– Cell phone
• Sophisticated user interfaces– Multitouch GPS
![Page 10: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/10.jpg)
10
www.ntnu.no TDT4258
Real-time requirements
• Must finish operations by deadlines– Hard real-time: Missing deadlines causes failures– Soft real-time: Missing deadlines degrades performance
• Some systems are multi-rate– Different operations with different rates
• Video playback: Audio has different requirements from video
![Page 11: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/11.jpg)
11
www.ntnu.no TDT4258
Non-functional requirements
• Mass-marked items– Low manufacturing cost is essential– Limits memory, processing power, ...– Must achieve requirements at minimum cost
• Reduce power consumption– Essential for battery powered application– Reduces operating cost even in wall powered devices– Reduces temperature -> increases life time
• Work in extreme environment– Satellites– Deep sea
![Page 12: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/12.jpg)
12
www.ntnu.no TDT4258
Embedding computers
CPU
mem
input
output analog
analog
embeddedcomputer
![Page 13: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/13.jpg)
13
www.ntnu.no TDT4258
Processing units
• Processing units– CPU – general purpose computing
• 8 bit, 16 bit, 32 bit
– GPU – graphics ++– DSP – signal processing
• Typically integrated into a single chip, together with I/O-devices, memory, ...– Microcontroller (small, cheap)– System-On-Chip (powerful, expensive)
CPU
mem
input
output analog
analog
embeddedcomputer
![Page 14: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/14.jpg)
14
www.ntnu.no TDT4258
Custom logic vs. microprocessors• Custom logic: FPGA, ASIC
– Custom made logic, either in ASIC or FPGA– Hard to design (expensive)– Potential for creating more optimal solution
• Microprocessors– General, “easy” to write software– Simplifies the design– Simplifies the design of product families
• Can use SW to differentiate product
![Page 15: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/15.jpg)
15
www.ntnu.no TDT4258
The performance paradox
• Would think custom logic always wins:– Microprocessors use much more logic (silicon area) than custom
logic (for small systems)– Microprocessors are (mostly) sequential, while custom logic often
exploits parallelism much more
• Not true, microprocessor can often be as fast or faster:– Large design teams
• Complex, deep pipelines
– Aggressive VLSI technology• Too expensive for all but the highest volumes
![Page 16: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/16.jpg)
16
www.ntnu.no TDT4258
Power and energy
• Custom logic might beat processors for low power devices
• But CPUs have SW and HW techniques to reduce power consumption
• Only extreme power requirements results in implementing custom logic
![Page 17: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/17.jpg)
17
www.ntnu.no TDT4258
Energy micro EFM32
![Page 18: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/18.jpg)
18
www.ntnu.no TDT4258
Lecture overview
• Introduction
• Characteristics of embedded computers
• Embedded system design
• Design process examples
![Page 19: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/19.jpg)
19
www.ntnu.no TDT4258
Challenges in embedded system design• How to meet performance requirements
– Improve HW: CPU, memory, busses, clock, ...– Improve SW: More clever algorithms, optimizations
• How to minimize power?– Turn off unnecessary logic? Change SW algorithms?
• How to meet deadlines?– Increase component cost or development cost?
![Page 20: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/20.jpg)
20
www.ntnu.no TDT4258
HW/SW codesign
• You are designing a complete system
• Where to put functionality, HW or SW?
• The physics of software– Computers are physical machines– Embedded SW designers need to understand this
• Energy consumption• Performance
![Page 21: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/21.jpg)
21
www.ntnu.no TDT4258
Design process
requirements
specification
architecture
componentdesign
systemintegration
![Page 22: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/22.jpg)
22
www.ntnu.no TDT4258
Top-down or bottom-up
• Top down:– Start from high level, abstract description– Work towards more details
• Bottom-up:– Work from small components to big system
• A real design team uses both
![Page 23: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/23.jpg)
23
www.ntnu.no TDT4258
Architecture design
• How to choose which components are needed, how to divide tasks between HW and SW?
• Ideal– Draw toplevel, functional diagram– Use spec to decide which HW modules are needed for the various
functions• Good enough performance• Low enough power consumption• Cheap
– Design communication busses to support spec
![Page 24: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/24.jpg)
24
www.ntnu.no TDT4258
How it is typically done
• Find development board which can do what you need
• HW design group uses this as reference, removes unneeded components and creates HW design
• SW design group uses the board for SW development while waiting for HW prototype
![Page 25: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/25.jpg)
25
www.ntnu.no TDT4258
Development boards
• Very common and useful tool for developing embedded systems
![Page 26: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/26.jpg)
26
www.ntnu.no TDT4258
Challenges with developing and testing• Emulators, development boards, prototype boards
– Reduces observability and controllability
• Complex test situation, many interactive components, timing is critical for behaviour
![Page 27: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/27.jpg)
27
www.ntnu.no TDT4258
Lecture overview
• Introduction
• Characteristics of embedded computers
• Embedded system design
• Design process examples
![Page 28: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/28.jpg)
28
www.ntnu.no TDT4258
Design example: GPS
• A GPS device for car use
• Moving map
• Location from GPS
• Map from local storage
![Page 29: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/29.jpg)
29
www.ntnu.no TDT4258
GPS: Requirements
• Show major roads and landmarks• Output: 600x400 screen• Input: Three buttons, popup menu
• Performance: Smooth map scrolling, 1s power up time, find position within 15s
• Cost: $500 street price
• Size: Fit dashboard• Power consumption: Comparable to
CD-player• Function in -10ºC, storage -30ºC
requirements
specification
architecture
componentdesign
systemintegration
![Page 30: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/30.jpg)
30
www.ntnu.no TDT4258
GPS: Specification
• More detailed than the requirements
• Unambigous
• Understandable
• All top level functionality and characteristics specified– Map data– GPS data
– User interface– ...
requirements
specification
architecture
componentdesign
systemintegration
![Page 31: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/31.jpg)
31
www.ntnu.no TDT4258
GPS: Architecture design
• Identify major components– HW and SW– Use off-the-shelf when possible
requirements
specification
architecture
componentdesign
systemintegration
![Page 32: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/32.jpg)
32
www.ntnu.no TDT4258
GPS: Architecture design
GPSreceiver
searchengine
renderer
userinterface
DB
display
![Page 33: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/33.jpg)
33
www.ntnu.no TDT4258
GPS: Architecture design
• Important high level choices– HW: CPU architecture, necessary I/O-devices, necessary HW
accelerators (DSP, GPU, FPGA, ASIC, ...)– SW: Operating system, programming language
• Find a commercial development board that mostly fits– STK1000
– RS232 GPS module
• Use devboard as reference for more detailed architecture
GPSreceiver
CPU
panel I/O
framebuffer
memory
display
![Page 34: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/34.jpg)
34
www.ntnu.no TDT4258
GPS: Software development
position databasesearch
renderer
timeruser
interface
pixels
![Page 35: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/35.jpg)
35
www.ntnu.no TDT4258
GPS: Software development
• Start developing for chosen devboard
• Use existing code when possible– OS– Map DB and SW
• Usually, most of the system can be finished before the HW prototype is done
• If HW prototype is delayed: Implement the rest of the system without HW– Simulate missing HW functionality
requirements
specification
architecture
componentdesign
systemintegration
![Page 36: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/36.jpg)
36
www.ntnu.no TDT4258
GPS: System integration
• Move SW over to HW prototype– Many bugs appear at this stage
• Test, debug, maybe redesign
Test as much functionality as early as possible (using devboard, emulators, test code, dummy modules, ...)
requirements
specification
architecture
componentdesign
systemintegration
![Page 37: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/37.jpg)
37
www.ntnu.no TDT4258
UML example: Model train controller
![Page 38: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/38.jpg)
38
www.ntnu.no TDT4258
Digital Command Control (DCC)
• Standard for model train control
• Created by National Model Railroad Association
ECCaddressheader command
1 0
Time
![Page 39: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/39.jpg)
39
www.ntnu.no TDT4258
Requirements
• Console:– Control 8 trains on 1 track– Throttle with 63 levels– Inertia control (8 levels)– Emergency stop button
• Communication– Error detection scheme on messages
![Page 40: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/40.jpg)
40
www.ntnu.no TDT4258
Typical sequence
:console :train_rcvrset-inertiaset-speed
set-speed
set-speed
estop
![Page 41: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/41.jpg)
41
www.ntnu.no TDT4258
Message classes
command
set-inertia
value: unsigned-integer
set-speed
value: integer
estop
![Page 42: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/42.jpg)
42
www.ntnu.no TDT4258
Console system
console
panel formatter transmitter
receiver* sender*
1
1
1
111
11
11
![Page 43: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/43.jpg)
43
www.ntnu.no TDT4258
Train system
train set
train
receiver
controller
motorinterface
detector* pulser*
11..t
1
1
11
1 1
1
1
11
![Page 44: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/44.jpg)
44
www.ntnu.no TDT4258
Control input sequence diagram
:knobs :panel :formatter :transmitter
change in spee d/inertia/e stop
change intrain nu m
ber
change incontrolsettings
read panel
panel settings
panel-active
send-command
send-speed,send-inertia.send-estop
read panel
panel settings
read panel
panel settingschange intrainnumber
set-knobs
new-settings
![Page 45: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language](https://reader031.vdocument.in/reader031/viewer/2022021821/5afbd6587f8b9a444f8b537a/html5/thumbnails/45.jpg)
45
www.ntnu.no TDT4258
Next lecture
• Processor instruction sets– Assembly programming