Embedded System Life Cycle, GPIO and Intro To Arduino
Embedded System Life Cycle, GPIO and Intro To Arduino
• …wake up …
• …have breakfast …
Examples in your Daily Life
Cont….
• …get into your car …
SENSORS A/D
Conversion CPU D/A
Conversion ACTUATORS
Auxiliary
Human Diagnostic Systems
Interface Port (Power,
Cooling)
ELECTROMECHANICAL
Backup & Safety
EXTERNAL
ENVIRONMENT
Peripherals
• Peripheral is something which is NOT part of
the computer
• Peripheral is a hardware element used to
perform a defined functionality
• Why?
– CPU cannot do all the required functionality
– Required functionality is not common for all systems
• Allows to choose the best required for the system
• Example
– Time display system – A watch
– Automatic cloth washing system – A washing machine
What is an Embedded
System?
• “An embedded system is a system that has
software embedded into computer-hardware,
which makes a system dedicated for an
application (s) or specific part of an application
or product or part of a larger system.”
What is an Embedded
System?
• An Embedded system is computing system
other than a desktop computers- Frank
Vahid/Tony
• An embedded system is the one that has
computer hardware with software embedded in it
as one of its most important component.
• It is any device that includes a programmable
computer but is not itself intended to be a
general purpose computer-Wayne Wolf
What is an Embedded
System?....
• Embedded System are electronics systems that
contain a Microprocessor, Micro
Controller, but we don’t think of them as
computer. The computer is hidden in the
system- Todd D.Mortan
• An embedded system is a System whose
principle function is not computational, but which
is controlled by computer embedded with in it. –
Tim Wilmshurst
Some of the main characteristics:
– Dedicated (not general purpose)
– Contains a programmable component
– Interacts (continuously) with the environment
Major components of Embedded
system
• Hardware
• Software
• RTOS
Hardware
Hardware components of an embedded
system
• Power supply and reset Ckt
• i/p device interfacing and driver ckts
• o/p device interfacing and driver ckts
• System application specific ckts
• Processor
• Timer
• Interrupt controller
• Program memory
• Data Memory
• Serial communication Port
• Parallel communication Port
Application Software
– Perform concurrently a series of task
RTOS
– Defines the way the system works
– Supervises the application software
– Provides a mechanism to let the processor to
run a process as per scheduling (Process
scheduling)
– Perform Context switching between the
processes
Classification of embedded
System
Eg.
Cars Cruise controller
Missile Target System
Missile Target System
Car Cruise Control
Complex Algorithms
• The operations
performed by
the processor
may be more
Complex
Eg.
Automobile
engine Control
Mobile Phone
User Interface
• Microprocessor are frequently used to
control complex user interfaces that may
include multiple menus and many options
Multirate
• ES have several real time activities at the
same time.
• They need to control some operations run
at slow rate and some
Optimizing atMatrices
Design high rate
Eg.
Multimedia
Manufacturing Cost
Depends on
• Processor Used
• Amount of memory required
• Type Of I/O
Power
• Power consumption affects
– Battery life
– Heat Consumption
An embedded system example -- a
digital camera
Digital camera chip
CCD
lens
– Flexibility:
• The ability to change the functionality of the system without
incurring heavy NRE cost
– Time-to-prototype:
• The time needed to build a working version of the system
– Time-to-market:
• The time required to develop a system to the point that it can
be released and sold to customers
– Maintainability:
• The ability to modify the system after its initial release.
– Correctness, safety
Design metric competition --
improving one may worsen others
Power • Expertise with both
software and
Performance Size hardware is needed to
optimize design metrics
– Not just a hardware or
NRE cost
software expert, as is
common
Digital camera chip
CCD
CCD Pixel coprocessor D2A
– A designer must be
A2D
lens
preprocessor
comfortable with various
JPEG codec Microcontroller Multiplier/Accum technologies in order to
DMA controller Display ctrl Hardwarthe best for a given
choose
e
application and constraints
Memory controller ISA bus interface UART LCD ctrl
Software
Losses due to delayed market
entry
• Simplified revenue model
Peak revenue
– Product life = 2W, peak at W
Peak revenue from – Time of market entry defines a
delayed entry
Revenues ($)
• Example
– NRE=$2000, unit=$100
– For 10 units
– total cost = $2000 + 10*$100 = $3000
– per-product cost = $2000/10 + $100 = $300
$200,000 $200
A A
B B
$160,000 $160
C C
to ta l c o st (x1000)
p e r p ro d u c t c o st
$120,000 $120
$80,000 $80
$40,000 $40
$0 $0
0 800 1600 2400 0 800 1600 2400
Num b e r o f units (vo lu m e ) Num b e r o f units (vo lu m e )
• Limited Observation
• Complex Testing
• Limited Development Environment
Does it optimize the design metrics?
• NRE Cost
• Unit Cost
• Size
• Performance
• Flexibility
• Time to prototype
• Time to Market
• Maintainability
• Correctness
• Safety
CONSTRAINT
Time In Months
• Market window reveals during which time a
product would have highest sales
• Missing this window , which means that the
product begins being sold further to the right on
the time scale can mean significant loss in sales
• Each day of delay results in million dollars loss
• Average time to market constraint – 8 Months
Assume Peak
Revenue at time W
Market
Market
rise
Fall
On time Delayed 2W
W
entry Entry
• Revenue on time entry = area of bigger triangle
• Revenue on delayed entry = area of smaller
triangle
• % Revenue Loss =
( (Ontime – delayed)/Ontime)*100
2 8
months months 16
months
NRE & Unit Cost Metrics
Assume Three technologies are available for
developing a product
Tech NRE Cost Unit cost
A 2000 100
B 30,000 30
C 100000 2
Total cost = NRE Cost + Unit cost*# of units
Per product cost = (NRE cost/#of Units) + Unit
cost
Total cost Vs # of Units produced
A
T
o
t
B
a
l
C
C
o
s
t
P
e
r
p A
r
o
d
u
c C
t
c B
o
s
t
Number of units
Performance Design Metric
• Performance of a system is a measure of how long the system
takes to execute our desired task
• Main measures of performance
Latency Time b/w start of task of task execution to end
Through put No of task that can be processed per unit time
requirements
specification
architecture
component
design
system
integration
Top-down vs. bottom-up
• Top-down design:
– start from most abstract description;
– work to most detailed.
• Bottom-up design:
– work from small components to big system.
• Real design uses both techniques.
Stepwise refinement
• At each level of abstraction, we must:
– analyze the design to determine
characteristics of the current state of the
design;
– refine the design to add detail.
Requirements
• Plain language description of what the
user wants and expects to get.
• May be developed in several ways:
– talking directly to customers;
– talking to marketing representatives;
– providing prototypes to users for comment.
Functional vs. non-functional
requirements
• Functional requirements:
– output as a function of input.
• Non-functional requirements:
– time required to compute output;
– size, weight, etc.;
– power consumption;
– reliability;
– etc.
Our requirements form
name
purpose
inputs • Type of data
outputs • Data character tics
• Types of IO devices
functions
performance
manufacturing cost
power
physical size/weight
Example: GPS moving map
requirements
• Moving map
obtains position I-78
Scotch Road
map from local
database.
lat: 40 13 lon: 32 19
GPS moving map needs
• Functionality: For automotive use. Show major
roads and landmarks.
• User interface: At least 400 x 600 pixel screen.
Three buttons max. Pop-up menu.
• Performance: Map should scroll smoothly. Lock
onto GPS within 15 seconds.
• Cost: $120 street price = approx. $30 cost of
goods sold.
GPS moving map needs, cont’d.
• Physical size/weight: Should fit in hand.
• Power consumption: Should run for 8
hours on four AA batteries.
GPS moving map
requirements form
Specification
• A more precise description of the system:
– should not imply a particular architecture;
– provides input to the architecture design
process.
• May include functional and non-functional
elements.
• May be executable or may be in
mathematical form for proofs.
GPS specification
• Should include:
– What is received from GPS;
– map data;
– user interface;
– operations required to satisfy user requests;
– background operations needed to keep the
system running.
Architecture design
• What major components go satisfying the
specification?
• Hardware components:
– CPUs, peripherals, etc.
• Software components:
– major programs and their operations.
• Must take into account functional and non-
functional specifications.
GPS moving map block diagram
user
database interface
GPS moving map hardware
architecture
GPS
receiver
memory
panel I/O
GPS moving map software
architecture
position pixels
database
renderer
search
user
timer
interface
Designing hardware and software
components
• Must spend time architecting the system
before you start coding.
• Some components are ready-made, some
can be modified from existing designs,
others must be designed from scratch.
System integration
• Put together the components.
– Many bugs appear only at this stage.
• Have a plan for integrating components to
uncover bugs quickly, test as much
functionality as early as possible.
A phase representation of the
embedded design life cycle:
Time flows from the left and proceeds through seven phases:
Product specification
LED Panel
Bluetooth
Keypad
Circuit Diagram (H/w)
An Example Embedded System
Digital camera
Block Diagram
• CCD
– Charge couple device
– Contains an array of light senitive photocells
that capture Image
• A2D
– Analog images to digital
• D2A
– Digital images to analog
• CCP Preprocessor
Commands CCD to read Image
• JPEG Codec
Compress and decompress the image
using JPEG Compression standard
• Pixel Coprocessor
For rapid Display of an image
• Memory Controller
Controls access to memory chip found
in camera
• DMA controller
Enables direct memory access by
other devices while the Microcontroller is
performing other functions
• UART
Communication with PC’s serial
PORT
• ISA Bus Interface
Enables with faster connection with
PC’s ISA Bus
• LCD Control & Display Control
Controls the display on the camera LCD
Display
• Multiplier/Accumulator
Performs a particular frequently executed
compution faster than the µc could