Embedded System Design
Embedded System Design
Firmware specifications
Describe how the firmware for specific processors will be
designed
Test specification
Describe what must be tested and how to verify that the
system operates correctly
System Design
The
embedded design process
generally follow these steps:
Product requirement definition
Functional requirement definition
Processor selection
Hardware/software specification
System evaluation
Hardware design
Firmware design
Integration
Verification (test)
Product requirement and functional requirement
can be merged into product specification:
Take
into account the use of internal
functions such as serial ports and timers
that restrict the use of certain pins
Pin diagram of 8051 and 8255
Interfaces required
The processor need to interface to real
world hardware.
For example: microchip pic17c42 has two
pulse width modulation outputs that
simplify design such as motor servos
Serial port, the maximum baud rate, refer
to data sheet.
Memory requirement
Essentialpart of embedded system design
Overestimate-costly
Underestimate-the system must be
redesigned.
RAM
example 8052 has 256bytes general purpose
RAM
Need more RAMs, use external RAM, this
requires I/O pins for addressing.
Cont..
ROM
Required for program code and lookup tables
More than 80% is too full, maybe the are some
changes.
Like RAM usage, code size depends on
language selected. Assembly language takes
less space than C language.
Cont..
Number of interrupts:
Interrupt it interrupts program execution
Best used for those things that cannot wait for
the processor to get to them.
Can be used to reduced the hardware
complexity
Cont..
Real time considerations
Related to processing speed
Are what microprocessor generally are
intended to handle.
Example: many processors have PWM output
or timers that can be configured as PWM
outputs. The processor just sends changes in
the duty cycle to the PWM controller.
Cont..
Development environment
New development tools require learning curve
Processing speed
Add up the interrupt latencies
The length of the polling loop must be short
enough to never miss a byte of serial data or a
byte from any other interface.
In some cases, higher speeds gain nothing if wait
states must be inserted to meet the memory
access requirements.
Cont..
ROM ability
Applies to those devices that execute their
programs from internal rom
Mask rom, from manufacturer
High volume
In circuit programming
Sometimes need the capability to program the part in
circuit to perform field upgrade of the firmware
Must have a processor with the program stored in flash
memory
Sometimes need to compromise between cost and
performance
Cont..
Non volatile storage
Sometimes some application need non
volatile storage,
Example, building a television, we want to
remember what channel the set on last,
even power is removed.
Many controllers include a small amount
of EEPROM on chip
Cont..
Memory architecture
Von Neumann and Harvard
Von Neumann architecture permits data and code to be
intermixed. Can put data table in PROM with the code and you
can move the code to RAM and execute it there
Harvard has separate code and data areas. Code executes
from PROM, data comes from a separate RAM and cannot get
data from code space.
Most microprocessors use modified Harvard architecture, that
allows table or other information to be compiled into the code for
use at the runtime.
Advantage of Harvard architecture- there are two separate
memory areas, so code and data can be fetched simultaneously,
increase the throughput of the processor.
In modified Harvard architecture, must be sure that the lookup
table not overlap the code.
Harvard and Von Neumann
Architecture
Cont..
Power requirements:
two issues
To operate from a wall mounted power supply
Battery power supply-need to know the total
operational current.
Environmental requirements
Typically temperature
Extended temperature device (military or
automotive purpose), more expensive.
Cont..
Life cycle cost
Has rooms for upgrading the system
Operator training
Effect the user interface
Example LCD and touch screen require more
memory to store the screen and message
Real requirements
Must look past the request for a specific
feature to get at the real requirement.
Hardware and Software
Requirement
If the product specification is the goal for the
product, the hardware and software
requirements are the goal for the detailed
design.
Hardware and software requirement start with
definition of user interface and system
functionality.
The most productive method of defining the
hardware is to start with the requirement-what
the hardware must have. This is tied to the
system specification because the hardware must
support whatever functionality the system has.
For the example of pool timer there are two
choices for output display/L LED or LCD. LED
is chosen because the timer will be exposed to
the weather all year and the LCD had problem
with cold temperature.
Engineering specification is a list of the
requirement for each microprocessor-based
board.
Hardware specification includes the specific
information that another engineer needs to
understand the design and the software
engineer need to program around the
hardware.
Thehardware specification includes the
following:
Memory and I/O port addresses
Amount of memory available
The definition of each bit in each status
register
The use of each bit on each port pin
An explaination of how peripheral devices are
driven (such as the clock frequency input to a
timer)
Anything else the software engineer needs to
know about the design.
Software specification includes:
A statement of the requirement including the
re q u i re m e n t s d e f i n i t i o n , e n g i n e e r i n g
specifications and hardware definition as
appropriate.
The communication protocol to any other
software whether to another processor or to
another piece of the software for this
processor. this should include description of
buffer interface mechanism, command/
response protocols or anything to which the
complementing code needs to talk.
A description of how the design was
implemented, using flowcharts, pseudocode or
other methods.
Distributed processor system
A distributed processor system might
have a single CPU that communicates
with a host computer and distributes
commands and data to lower level
processor that control motors, sensors
or other simple task.
Advantages:
The actual processing hardware can be
located near the hardware
Cont..
The cost of the processors that control the
option can be added or removed.
The distributed CPU can be lower.
performance or cheaper.
Code for CPU is simpler.
Debugging is simpler.
Techniques of Distributed
Processing
Centralized
Decentralized
Parallel
Open Distributed Processing
Clustering
Centralized processing
Centralized processing is done at a
central location using terminals that are
attached to a central computer.
The central computer performs the
computing function and control the
remote terminals. This type of system
relies totally on the central computer.
Database Management System
Decentralized
Computer system in different location.
Although data may be transmitted
between the computers periodically.
Example: Yahoo server. On each login it
connects you to a different server.
Parallel Processing
Parallel processing is the simultaneous
processing of the same task on two or
more microprocessors in order to obtain
faster result.
Multiple processor
Multiple computer
Share memory resources
Open Distributed Processing
ODP is a reference model in computer
science, which provides a coordinating
framework for the standardization for
open distributed processing (ODP).
It supports distribution, interworking,
platform and technology independence,
and portability, together with an
enterprise architecture framework for the
specification of ODP systems.
Clustering
A cluster is a group of individual
computer systems that can be made to
appear as one computer system.
Clustering is just one form of parallel
computing.
Key point that distinguishes clustering
from other is the ability to view the
cluster either a single entity or a
collection of standalone systems.
Example: a cluster of web server.
Cont..
Advantages of single CPU:
Synchronization is easier.
Communication is easier (with a host or other
system).
Fewer oscillator, so less EMI.
Easier to update or downlod the code.
Fewer development tools are needed.
Example: Application of IEEE 1451-Based
Sensor Network
(b) You are given a choice to select which microprocessor for the design in 1(a). Which
processor will you choose? Give your reason.
Processor A: 16 bit microprocessor, run at 12 MHz, the instructions work in 12 clock cycles per
instruction
Processor B: 8 bit microprocessor, run at 5MHz, the instruction in one clock cycle per
instruction.
(20 marks)