Introduction to
Embedded Computing and
ARM Processors
T.Ramprakash
AP/ECE
Ramco Institute of Technology
Academic Year 2016-17 (Odd Sem)
Complex Systems and Microprocessors
• Embedding Computers
• Characteristics of Embedded computing
application
• Why use microprocessors?
• Challenges in embedded computing system
design
• Performance of embedded computing systems
Embedding Computers
• It is any device that includes a programmable
computer but is not itself intended to be a
general purpose computer
• Whirlwind – 1940’s (aircraft simulator)
• Levels of Microprocessors based on their word
size
• Application of Microprocessors
BMW 850i Brake and Stability control system
• ASC +T (Automatic Stability control system)
Characteristics of Embedded computing application
• Complex Algorithms
• User Interface
• Realtime
• Multirate
• Manufacturing Cost
• Power and Energy
Why Use Microprocessors?
• Flexible
• Efficient
• Highly optimized
• Programmability
• Realtime
• Low power and low cost
Challenges in Embedded computing system design
• Hardware
• Deadlines
• Power Consumption
• Upgradeability
Performance of Embedded Computing Design
• CPU
• Platform
• Program
• Task
• Multiprocessor
FORMALISMS FOR SYSTEM DESIGN
FORMALISMS FOR SYSTEM DESIGN
• UML – Unified Modeling Language
• successive refinement and progressively adding
detail to the design
• Many graphical elements in UML diagram
• UML design emphasis on
– Design is described as number of interacting objects
rather than a few large monolithic blocks of code
– Objects will correspond to real pieces of S/W and H/W
FORMALISMS FOR SYSTEM DESIGN
• Structural Description
• Behavioral Description
Structural Description
An object in UML notation
d1: Display
pixels: array[] of pixels
elements
menu_items
object name
class name
attributes
A Class in UML notation
Display
pixels
elements
menu_items
mouse_click()
draw_box
operations
class name
Attributes
Relationships between objects and
classes
• Association: objects communicate but one
does not own the other.
• Aggregation: a complex object is made of
several smaller objects.
• Composition: aggregation in which owner
does not allow access to its components.
• Generalization: define one class in terms of
another.
Class derivation
– Derived class inherits attributes, operations of
base class.
Derived_class
Base_class
UML
generalization
Class derivation example
Display
pixels
elements
menu_items
pixel()
set_pixel()
mouse_click()
draw_box
BW_display Color_map_display
base
class
derived class
Multiple inheritance
Speaker Display
Multimedia_display
base classes
derived class
Behavioral Description
State Machine
a b
state state name
transition
Types of events
• Signal: asynchronous event.
• Call: synchronized communication.
• Timer: activated by time.
Signal event
<<signal>>
mouse_click
leftorright: button
x, y: position
declaration
a
b
mouse_click(x,y,button)
event description
Call event
c d
draw_box(10,5,3,2,blue)
Time out event
e f
tm(time-value)
Sequence diagram
m: Mouse d1: Display u: Menu
mouse_click(x,y,button)
which_menu(x,y,i)
call_menu(i)
time
Model Train Controller
Model Train setup
console
power
supply
rcvr motor
ECC address headercommand
Message
Requirements
• Console can control 8 trains on 1 track.
• Throttle has at least 63 levels.
• Inertia control adjusts responsiveness with at
least 8 levels.
• Emergency stop button.
• Error detection scheme on messages.
Requirement Form
name Model train controller
purpose Control speed of 8 model trains.
inputs Throttle, inertia, emergency stop,
train number
outputs Train control signals
functions Set engine speed. inertia; emergency
stop
performance Can update train speed at least 10
times/sec
manufacturing cost $50
power 10W (wall powered)
Size/Weight console comfortable for 2 hands
DCC
• Digital Command Control
• National Model Railroad Association
• Defines way in which model trains, controllers
communicate
• Standard S-9.1, DCC Electrical Standard.
• Standard S-9.2, DCC Communication Standard
DCC Electrical Standard
• Voltage moves around the power supply
voltage; adds no DC component.
time
logic 1 logic 0
58 ms >= 100 ms
DCC Communication Standard
• Basic packet format: PSA(sD)+E
• P: preamble = 1111111111.
• S: packet start bit = 0.
• A: Address data byte.
• s: data byte start bit.
• D: data byte (data payload).
• E: packet End bit = 1.
DCC Packet Types
• Baseline packet: minimum packet that must
be accepted by all DCC implementations.
– Address data byte gives receiver address.
– Instruction data byte gives basic instruction.
– Error correction data byte gives ECC
Specification
• Conceptual Specification
• Detailed Specification
Conceptual Specification
• Before we create a detailed specification, we
will make an initial, simplified specification.
command name parameters
set-speed speed
(positive/negative)
set-inertia inertia-value (non-
negative)
estop none
Message classes
command
set-inertia
value: unsigned-
integer
set-speed
value: integer
estop
Typical control sequence
:console :receiver
1..n: command
Console system classes
console
panel formatter transmitter
Knob* sender*
1
1
1
11
1
1
1
1
1
Console system classes
• Panel: describes analog knobs and interface
hardware.
• Formatter: turns knob settings into bit
streams.
• Transmitter: sends data on track.
Train system classes
train set
train
receiver controller
motor
interface
detector*
pulser*
1
1..t
1
1
1 1
1 1
1
1
1
1
Train class roles
• Receiver: digitizes signal from track.
• Controller: interprets received commands and
makes control decisions.
• Motor interface: generates signals required by
motor.
Detailed Specification
• Refining for more detailed specification
• Not complete specification, but will add detail
to the classes and major decisions in the
specification.
Console physical object classes
knobs*
train-knob: integer
speed-knob: integer
inertia-knob: unsigned-
integer
emergency-stop: boolean
Set-knobs()
pulser*
pulse-width: unsigned-integer
direction: boolean
sender*
send-bit()
detector*
read-bit() : integer
Train Speed Control
• Motor controlled by pulse width modulation:
V
+
-
duty
cycle
Panel and motor interface classes
panel
train-number() : integer
speed() : integer
inertia() : integer
estop() : boolean
new-settings()
motor-interface
speed: integer
panel class defines the controls.
new-settings() behavior reads the controls
motor-interface class defines the motor speed
held as state
Transmitter and receiver classes
transmitter
send-speed(adrs: integer,
speed: integer)
send-inertia(adrs: integer,
val: integer)
set-estop(adrs: integer)
receiver
current: command
new: boolean
read-cmd()
new-cmd() : boolean
rcv-type(msg-type:
command)
rcv-speed(val: integer)
rcv-inertia(val:integer)
Transmitter class has one behavior for each
type of message sent.
 Receiver function provides methods to
 Detect a new message;
 Determine its type;
 Read its parameters (estop has no
parameters).
Formatter class
formatter
current-train: integer
current-speed[ntrains]: integer
current-inertia[ntrains]:
unsigned-integer
current-estop[ntrains]: boolean
send-command()
panel-active() : boolean
operate()
 Formatter class holds state for each train, setting for current train.
 The operate() operation performs the basic formatting task.
Control input sequence diagramchangeinspeed/
inertia/estop
changein
trainnumber
:knobs :panel :formatter :transmitter
change in
control
settings
read panel
panel settings
panel-active
send-command
send-speed,
send-inertia.
send-estop
read panel
panel settings
read panel
panel settings
change in
train
number
set-knobs
new-settings
Formatter operate behavior
idle
update-panel()
send-command()
panel-active() new train number
other
Panel-active behavior
panel*:read-train()
current-train = train-knob
update-screen
changed = true
T
panel*:read-speed() current-speed = throttle
changed = true
T
F
...
F
...
Controller class
controller
current-train: integer
current-speed[ntrains]: integer
current-direction[ntrains]: boolean
current-inertia[ntrains]:
unsigned-integer
operate()
issue-command()
Controller operate behavior
issue-command()
receive-command()
wait for a
command
from receiver
Sequence diagram for set-speed
command
:receiver :controller :motor-interface :pulser*
new-cmd
cmd-type
rcv-speed set-speed set-pulse
set-pulse
set-pulse
set-pulse
set-pulse
Refined command classes
command
type: 3-bits
address: 3-bits
parity: 1-bit
set-inertia
type=001
value: 3-bits
set-speed
type=010
value: 7-bits
estop
type=000
Summary
• Separate specification and programming.
– Small mistakes are easier to fix in the spec.
– Big mistakes in programming cost a lot of time.
• You can’t completely separate specification
and architecture.
– Make a few tasteful assumptions.
Reference
• Wayne Wolf, “Computers as Components -
Principles of Embedded Computer System
Design”, Morgan Kaufmann, 2nd Edition,
2008.
• Marilyn Wolf, “Computers as Components -
Principles of Embedded Computing System
Design”, Third Edition “Morgan Kaufmann
Publisher,2012.

Introduction to embedded computing and arm processors

  • 1.
    Introduction to Embedded Computingand ARM Processors T.Ramprakash AP/ECE Ramco Institute of Technology Academic Year 2016-17 (Odd Sem)
  • 2.
    Complex Systems andMicroprocessors • Embedding Computers • Characteristics of Embedded computing application • Why use microprocessors? • Challenges in embedded computing system design • Performance of embedded computing systems
  • 3.
    Embedding Computers • Itis any device that includes a programmable computer but is not itself intended to be a general purpose computer • Whirlwind – 1940’s (aircraft simulator) • Levels of Microprocessors based on their word size • Application of Microprocessors
  • 4.
    BMW 850i Brakeand Stability control system • ASC +T (Automatic Stability control system)
  • 5.
    Characteristics of Embeddedcomputing application • Complex Algorithms • User Interface • Realtime • Multirate • Manufacturing Cost • Power and Energy
  • 6.
    Why Use Microprocessors? •Flexible • Efficient • Highly optimized • Programmability • Realtime • Low power and low cost
  • 7.
    Challenges in Embeddedcomputing system design • Hardware • Deadlines • Power Consumption • Upgradeability
  • 8.
    Performance of EmbeddedComputing Design • CPU • Platform • Program • Task • Multiprocessor
  • 9.
  • 10.
    FORMALISMS FOR SYSTEMDESIGN • UML – Unified Modeling Language • successive refinement and progressively adding detail to the design • Many graphical elements in UML diagram • UML design emphasis on – Design is described as number of interacting objects rather than a few large monolithic blocks of code – Objects will correspond to real pieces of S/W and H/W
  • 11.
    FORMALISMS FOR SYSTEMDESIGN • Structural Description • Behavioral Description
  • 12.
  • 13.
    An object inUML notation d1: Display pixels: array[] of pixels elements menu_items object name class name attributes
  • 14.
    A Class inUML notation Display pixels elements menu_items mouse_click() draw_box operations class name Attributes
  • 15.
    Relationships between objectsand classes • Association: objects communicate but one does not own the other. • Aggregation: a complex object is made of several smaller objects. • Composition: aggregation in which owner does not allow access to its components. • Generalization: define one class in terms of another.
  • 16.
    Class derivation – Derivedclass inherits attributes, operations of base class. Derived_class Base_class UML generalization
  • 17.
  • 18.
  • 19.
  • 20.
    State Machine a b statestate name transition
  • 21.
    Types of events •Signal: asynchronous event. • Call: synchronized communication. • Timer: activated by time.
  • 22.
    Signal event <<signal>> mouse_click leftorright: button x,y: position declaration a b mouse_click(x,y,button) event description
  • 23.
  • 24.
    Time out event ef tm(time-value)
  • 25.
    Sequence diagram m: Moused1: Display u: Menu mouse_click(x,y,button) which_menu(x,y,i) call_menu(i) time
  • 26.
  • 27.
    Model Train setup console power supply rcvrmotor ECC address headercommand Message
  • 28.
    Requirements • Console cancontrol 8 trains on 1 track. • Throttle has at least 63 levels. • Inertia control adjusts responsiveness with at least 8 levels. • Emergency stop button. • Error detection scheme on messages.
  • 29.
    Requirement Form name Modeltrain controller purpose Control speed of 8 model trains. inputs Throttle, inertia, emergency stop, train number outputs Train control signals functions Set engine speed. inertia; emergency stop performance Can update train speed at least 10 times/sec manufacturing cost $50 power 10W (wall powered) Size/Weight console comfortable for 2 hands
  • 30.
    DCC • Digital CommandControl • National Model Railroad Association • Defines way in which model trains, controllers communicate • Standard S-9.1, DCC Electrical Standard. • Standard S-9.2, DCC Communication Standard
  • 31.
    DCC Electrical Standard •Voltage moves around the power supply voltage; adds no DC component. time logic 1 logic 0 58 ms >= 100 ms
  • 32.
    DCC Communication Standard •Basic packet format: PSA(sD)+E • P: preamble = 1111111111. • S: packet start bit = 0. • A: Address data byte. • s: data byte start bit. • D: data byte (data payload). • E: packet End bit = 1.
  • 33.
    DCC Packet Types •Baseline packet: minimum packet that must be accepted by all DCC implementations. – Address data byte gives receiver address. – Instruction data byte gives basic instruction. – Error correction data byte gives ECC
  • 34.
  • 35.
    Conceptual Specification • Beforewe create a detailed specification, we will make an initial, simplified specification. command name parameters set-speed speed (positive/negative) set-inertia inertia-value (non- negative) estop none
  • 36.
  • 37.
    Typical control sequence :console:receiver 1..n: command
  • 38.
    Console system classes console panelformatter transmitter Knob* sender* 1 1 1 11 1 1 1 1 1
  • 39.
    Console system classes •Panel: describes analog knobs and interface hardware. • Formatter: turns knob settings into bit streams. • Transmitter: sends data on track.
  • 40.
    Train system classes trainset train receiver controller motor interface detector* pulser* 1 1..t 1 1 1 1 1 1 1 1 1 1
  • 41.
    Train class roles •Receiver: digitizes signal from track. • Controller: interprets received commands and makes control decisions. • Motor interface: generates signals required by motor.
  • 42.
    Detailed Specification • Refiningfor more detailed specification • Not complete specification, but will add detail to the classes and major decisions in the specification.
  • 43.
    Console physical objectclasses knobs* train-knob: integer speed-knob: integer inertia-knob: unsigned- integer emergency-stop: boolean Set-knobs() pulser* pulse-width: unsigned-integer direction: boolean sender* send-bit() detector* read-bit() : integer
  • 44.
    Train Speed Control •Motor controlled by pulse width modulation: V + - duty cycle
  • 45.
    Panel and motorinterface classes panel train-number() : integer speed() : integer inertia() : integer estop() : boolean new-settings() motor-interface speed: integer panel class defines the controls. new-settings() behavior reads the controls motor-interface class defines the motor speed held as state
  • 46.
    Transmitter and receiverclasses transmitter send-speed(adrs: integer, speed: integer) send-inertia(adrs: integer, val: integer) set-estop(adrs: integer) receiver current: command new: boolean read-cmd() new-cmd() : boolean rcv-type(msg-type: command) rcv-speed(val: integer) rcv-inertia(val:integer) Transmitter class has one behavior for each type of message sent.  Receiver function provides methods to  Detect a new message;  Determine its type;  Read its parameters (estop has no parameters).
  • 47.
    Formatter class formatter current-train: integer current-speed[ntrains]:integer current-inertia[ntrains]: unsigned-integer current-estop[ntrains]: boolean send-command() panel-active() : boolean operate()  Formatter class holds state for each train, setting for current train.  The operate() operation performs the basic formatting task.
  • 48.
    Control input sequencediagramchangeinspeed/ inertia/estop changein trainnumber :knobs :panel :formatter :transmitter change in control settings read panel panel settings panel-active send-command send-speed, send-inertia. send-estop read panel panel settings read panel panel settings change in train number set-knobs new-settings
  • 49.
  • 50.
    Panel-active behavior panel*:read-train() current-train =train-knob update-screen changed = true T panel*:read-speed() current-speed = throttle changed = true T F ... F ...
  • 51.
    Controller class controller current-train: integer current-speed[ntrains]:integer current-direction[ntrains]: boolean current-inertia[ntrains]: unsigned-integer operate() issue-command()
  • 52.
  • 53.
    Sequence diagram forset-speed command :receiver :controller :motor-interface :pulser* new-cmd cmd-type rcv-speed set-speed set-pulse set-pulse set-pulse set-pulse set-pulse
  • 54.
    Refined command classes command type:3-bits address: 3-bits parity: 1-bit set-inertia type=001 value: 3-bits set-speed type=010 value: 7-bits estop type=000
  • 55.
    Summary • Separate specificationand programming. – Small mistakes are easier to fix in the spec. – Big mistakes in programming cost a lot of time. • You can’t completely separate specification and architecture. – Make a few tasteful assumptions.
  • 56.
    Reference • Wayne Wolf,“Computers as Components - Principles of Embedded Computer System Design”, Morgan Kaufmann, 2nd Edition, 2008. • Marilyn Wolf, “Computers as Components - Principles of Embedded Computing System Design”, Third Edition “Morgan Kaufmann Publisher,2012.