YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Lecture 1: Introduction to Embedded Systems - NTNU · Lecture 1: Introduction to Embedded Systems ... • Introduction • Characteristics of embedded computers ... programming language

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

45

www.ntnu.no TDT4258

Next lecture

• Processor instruction sets– Assembly programming


Related Documents