labour force

37
EMBEDDED AND REAL EMBEDDED AND REAL TIME SYSTEMS TIME SYSTEMS 1/29/2012 INTRODUCTION TO EMBEDDED COMPUTING

Upload: s-s

Post on 10-May-2015

398 views

Category:

Career


1 download

TRANSCRIPT

Page 1: labour force

EMBEDDED AND REAL EMBEDDED AND REAL TIME SYSTEMSTIME SYSTEMS

1/29/2012INTRODUCTION TO

EMBEDDED COMPUTING

Page 2: labour force

UNIT-1

INTRODUCTION TO EMBEDDED COMPUTINGEMBEDDED COMPUTING

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 3: labour force

COMPLEX SYSTEMS AND MICROPROCESSORSMICROPROCESSORS

What is an embedded computer system? It is any device that includes a programmable computer but is not itself intended to be a general-purpose computer.

h C i i lf b dd d iThus a PC is not itself an embedded computing ystem,although PCs are often used to build embedded computing systemsembedded computing systems. But a fax machine or a clock built from a microprocessor is an embedded computing systemmicroprocessor is an embedded computing system.

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 4: labour force

Embedding ComputersEmbedding Computers

Whirlwind, a computer designed at MIT in the late 1940s and early 1950s.microprocessor is a single-chip CPU in 1970’s but it is very simple.first microprocessor, the Intel 4004,was designed for an embedded application,namely, a calculator.

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 5: labour force

Characteristics of Embedded C ti A li tiComputing Applications

Complex algorithmsUser interfaceReal timeMultirateMultirateManufacturing costPower and energy

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 6: labour force

Why Use Microprocessors?Why Use Microprocessors?

Microprocessors are a very efficient way to implement digital systems.Microprocessors has new features to keep up with rapidly changing marketsp p y g g

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 7: labour force

Challenges in Embedded C ti S t D iComputing System Design

How much hardware do we need?How do we meet deadlines?How do we minimize power consumption?How do we design for upgradability?How do we design for upgradability?Does it really work?

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 8: labour force

DEADLINEDEADLINE

Deadline is to speed up the hardware so thatthe program runs faster. Of course, that makes the system more expensive. It i l ti l ibl th t i i thIt is alsoentirely possible that increasing the CPU clock ratemay notmake enough differenceto execution time since the program’sdifferenceto execution time,since the program s speedmay be limited by thememory system

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 9: labour force

1.2 THE EMBEDDED SYSTEM DESIGN PROCESSDESIGN PROCESS

Embedded System Design Process aimed at two objectives. First-various steps in Embedded System design. gSecond- Design methodology.

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 10: labour force

EMBEDDED SYSTEM DESIGN PROCESSDESIGN PROCESS

1/29/2012INTRODUCTION TO EMBEDDED

COMPUTING

Page 11: labour force

RequirementsRequirements

TWO PHASES:Informal description from the customers.pRefine the requirements into a specificationspecification.

PerformanceC tCostPhysical size and weight

1/29/2012INTRODUCTION TO EMBEDDED

COMPUTING

Page 12: labour force

SpecificationSpecification

The specification is more precise—it serves as the contract between the customerand the architects. As such, the specification must be carefully written so that itaccurately reflects the customer’s requirements and does so in a way that can beclearlyrequirements and does so in a way that can beclearly followed during design.

1/29/2012INTRODUCTION TO EMBEDDED

COMPUTING

Page 13: labour force

Architecture DesignArchitecture Design

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 14: labour force

HardwareHardware

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 15: labour force

SoftwareSoftware

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 16: labour force

Designing Hardware and Software ComponentsSoftware Components

You will have to design some components yourself. Even if you are using only standard integrated circuits, you may have to design the printed circuit boardyou may have to design the printed circuit board thatconnects them.You will probably have to do a lot of custom programming as well.When creating these embedded software modules, you must of course make use of your expertise to ensure that the system runs properly in real time and that itthat the system runs properly in real time and that it does not take up more memory space than is allowed

1/29/2012INTRODUCTION TO EMBEDDED

COMPUTING

Page 17: labour force

System IntegrationSystem Integration

System integration is difficult because it usually uncovers problems. It is oftenhard to observe the system in sufficient detailIt is oftenhard to observe the system in sufficient detail to determine exactly what is wrong the debugging facilities for embedded systems

1/29/2012INTRODUCTION TO EMBEDDED

COMPUTING

Page 18: labour force

MODEL TRAIN CONTROLLERMODEL TRAIN CONTROLLER

In order to learn how to use UML to model systems

PURPOSES OF EXAMPLE:

Follow a design through several levels of abstraction.Gain experience with UML.

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 19: labour force

Model train setupModel train setup

rcvr motor

powerl

console

supply

ECCaddressheader commandINTRODUCTION TO EMBEDDED

COMPUTING

ECCaddressheader command

1/29/2012

Page 20: labour force

RequirementsRequirements

Console can control 8 trains on 1 track.Throttle has at least 63 levels.Inertia control adjusts responsiveness with at least 8 levelswith at least 8 levels.Emergency stop button.E d t ti hError detection scheme on messages.

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 21: labour force

Requirements into our chart formatchart format

name model train controllerpurpose control speed of <= 8 model trainsinputs throttle, inertia, emergency stop,

train #train #outputs train control signals functions set engine speed w. inertia;

emergency stop performance can update train speed at least 10

times/secmanufacturing cost $50 power wall poweredpower wall poweredphysical size/weight

console comfortable for 2 hands; < 2 lbs.

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 22: labour force

Basic system commandsBasic system commands

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 23: labour force

Console physical object classesclasses

knobs*train-knob: integerspeed knob: integer

pulser*

pulse-width: unsigned-ispeed-knob: integer

inertia-knob: unsigned-integer

b l

integerdirection: boolean

emergency-stop: booleanmouse_click()draw box

sender* detector*draw_box

send-bit() read-bit() : integer

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 24: labour force

Panel and motor interface classesclasses

panel motor-interface

train-number() : integerspeed() : integeri i () i

speed: integer

inertia() : integerestop() : booleannew-settings()g ()

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 25: labour force

Class descriptionsClass descriptions

panel class defines the controls.new-settings() behavior reads the controls.

motor-interface class defines the motor speed held as state.speed held as state.

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 26: labour force

Transmitter and receiver classesclasses

transmitter receiver

current: commandsend-speed(adrs: integer,

speed: integer)d i i ( d i

current: commandnew: boolean

read cmd()send-inertia(adrs: integer,val: integer)

set-estop(adrs: integer)

read-cmd()new-cmd() : booleanrcv-type(msg-type:

d)p( g )

command)rcv-speed(val: integer)rcv-inertia(val:integer)

INTRODUCTION TO EMBEDDED COMPUTING

( g )

1/29/2012

Page 27: labour force

Class descriptionsClass descriptions

transmitter class has one behavior for each type of message sent.receiver function provides methods to:

detect a new message;detect a new message;determine its type;read its parameters (estop has noread its parameters (estop has no parameters).

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 28: labour force

Formatter classFormatter class

formatter

current-train: integercurrent train: integercurrent-speed[ntrains]: integercurrent-inertia[ntrains]:

i d i tunsigned-integercurrent-estop[ntrains]: boolean

send command()send-command()panel-active() : booleanoperate()

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 29: labour force

Formatter class descriptiondescription

Formatter class holds state for each train, setting for current train.The operate() operation performs the basic formatting task.g

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 30: labour force

Control input casesControl input cases

Use a soft panel to show current panel settings for each train.Changing train number:

must change soft panel settings to reflectmust change soft panel settings to reflect current train’s speed, etc.

Controlling throttle/inertia/estop:Controlling throttle/inertia/estop:read panel, check for changes, perform command.

INTRODUCTION TO EMBEDDED COMPUTING

command.

1/29/2012

Page 31: labour force

Control input sequence diagramdiagram

k b l f tt t itt:knobs :panel :formatter :transmitter

peed

/op

change incontrol

read panelpanel-active

nge

in sp

ertia

/est

o

settings panel settings send-commandsend-speed,

d i i

read panel

chan in

en be

r

send-inertia.send-estop

panel settingsread panel

change in

chan

ge in

ain

num

b panel settingsg

trainnumber new-settings

INTRODUCTION TO EMBEDDED COMPUTING

c tra set-knobs1/29/2012

Page 32: labour force

Formatter operate behaviorbehavior

update-panel()

idlepanel-active() new train number

send-command()other

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 33: labour force

Panel active behaviorPanel-active behavior

l* d i ()current-train = train-knobT

panel*:read-train() update-screenchanged = true

F

panel*:read-speed() current-speed = throttleT

panel :read speed()changed = true

F

INTRODUCTION TO EMBEDDED COMPUTING

... ...1/29/2012

Page 34: labour force

Controller classController class

controller

current-train: integercurrent train: integercurrent-speed[ntrains]: integercurrent-direction[ntrains]: boolean

t i ti [ t i ]current-inertia[ntrains]:unsigned-integer

operate()issue-command()

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 35: labour force

Setting the speedSetting the speed

Don’t want to change speed instantaneously.Controller should change speed gradually by sending several commands.y g

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 36: labour force

Sequence diagram for set-speed commandspeed command

i t ll t i t f l *:receiver :controller :motor-interface :pulser*new-cmdcmd-typecmd-typercv-speed set-speed set-pulse

set-pulseset pulse

set-pulse

lset-pulse

set-pulse

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012

Page 37: labour force

Refined command classesRefined command classescommandcommand

type: 3-bitsaddress: 3-bitsparity: 1-bit

set-inertia

type=001

set-speed

type=010

estop

type=001value: 3-bits

type=010value: 7-bits type=000

INTRODUCTION TO EMBEDDED COMPUTING1/29/2012