Académique Documents
Professionnel Documents
Culture Documents
Lecture 1.2
Software
(Application Programs)
Coprocessors
Processor
ASIC
Converters
Vijay Savani
APEC, IT, NU.
vijay.savani@nirmauni.ac.in
Outline
• Typical Embedded System Blocks
• Hardware or Software
• Components of Embedded System
Processor
Hardware (Peripheral)
Software (Programme)
Operating System (RTOS)
Case Study: Digital Camera
Books Referred . .
1. Introduction to Embedded Systems by Shibu K V
(Tata McGraw Hill Education Private Limited).
(Ch2)
2. Embedded System design: A unified
hardware/software introduction by Frank Vahid
and Tony Givargis (Wiley Publishers)
3. Embedded System Architecture, Programming
and Design Raj Kamal (Tata McGraw Hill
Education Private Limited)
4. Computers as Components Principles of
embedded computing system design, by Wayne
Wolf (Morgan Kaufmann Publishers)
5. Internet resources
Memory
Communication Interface
System
I/p Ports Core O/p Ports
(Sensors)
(Actuators)
Other supporting
Integrated Circuits &
subsystems
Embedded System
Real World
12-Aug-19 Vijay Savani @ 2019 4
Hardware/Software Partitioning
Hardware or Software
• In an embedded system, assigning functions to hardware
and software is a vital consideration. Many tasks can be
performed in hardware or in software – for example: timing
• Hardware implementation has the advantages that the task
execution is faster than in software implementation.
• Hardware adds a “per unit cost” – where as software adds
a “fixed cost”.
• On the flip side, the hardware chip occupies space, cost
money, and consumes power.
• The choice between hardware and software is driven by
considerations of speed, cost, need for flexibility in
modification of underlying algorithms.
• Typically, only those functions are implemented in
hardware whose speed specifications cannot be met by
software solution.
Hardware/Software Partitioning
Components
of
Embedded System
Hardware (Peripheral)
Timers, Interrupt controller, I/O Devices, Memories, Ports, Sensors,
Actuators etc
Software (Programme)
Which may perform concurrently the series of tasks or
multiple tasks.
Operating System (RTOS)
RTOS defines the way the system work
12-Aug-19 Vijay Savani @ 2019 11
Component of Embedded
System
Processor
Processor
• Each design is unique in embedded
system.
• The kind of processors used in them are
quite varied.
• 8-bit, 16-bit, and 32-bit
processors/microcontroller are available
with different processing powers and
memory addressing capabilities.
• Micro Processor / Micro Controller ???
Microprocessor Vs Microcontroller
Microprocessor Microcontroller
A silicon chip with heart A silicon chip with hand, leg along
CPU Only with heart
CPU + RAM + GP Register + ROM +
Timer + I/O etc..
It is a dependent unit. It is a self contained unit and it
Requires other chips like doesn’t require external Interrupt
Timers, Program and data Controller, Timer, UART etc for its
memory chips, etc.. functioning
Most of the time general Mostly application oriented or
purpose in design and domain specific
operation
Doesn’t contain a built in I/O Most of the processors contain
port. multiple built-in I/O ports (8 or 16
or 32 bit Port or as individual port
pins)
Targeted for high end market Targeted for embedded market where
where performance is important performance is not so critical
(At present this demarcation is invalid)
Limited power saving options Includes lot of power saving features
compared12-Aug-19
to microcontrollers Vijay Savani @ 2019 14
8-bit Processors
• Application involving minimal processing and
I/O functions such as digital watches,
refrigerators, air-conditioners and VCRs use
an 8-bit micro controller.
• The hardware cost is minimal since an 8-bit
micro controller has on-chip memory and
serial interface and so on.
• The system becomes portable interns of size.
• Usually popular for consumer electronics.
• Like A digital watch incorporating an 8-bit
controller uses a set of buttons for input and
an LCD for output.
12-Aug-19 Vijay Savani @ 2019 23
16-/32-/64-bit Processors
• Application involving more processing and I/O
functions such as process control systems,
telecom switches, routers and protocol
converters use 16-/32- bit processor with
more computing and communication
capabilities.
Solution
ISP
• An application-specific instruction-set
processor (or ASIP) can serve as a
compromise between the above processor
options.
• An ASIP is designed for a particular class of
applications with common characteristics,
such as digital-signal processing,
telecommunications, embedded control, etc.
• Using an ASIP in an embedded system can
provide the benefit of flexibility while still
achieving good performance, power and size.
• Examples:
– Texas Instruments- C28x Series, C54xx or C64xx
– Analog Devices SHARC or Tiger SHARC
– Motorola 5600xx
12-Aug-19 Vijay Savani @ 2019 35
Examples:
• TI DSP TMS320DM310
• Trimedia Phillips Media Processor 1x00
series for Processing Streaming and
Data Networks
• Image, Video and Speech: PNX 1300,
PNX 1500 (2002)
Others . . .
• Programmable Logic Devices (PLDs)
• Programmable Logic Devices (PLDs) – CPLDs
and FPGA
• Application Specific Integrated Circuit (ASIC)
• Commercial off-the-shelf devices (COTS)
Component
of Embedded System
Hardware
(Peripherals – Interfacing)
• Memory
• Peripherals
• Sensors & Actuators
• Communication Interface
• Firmware & Software
• Other System Components
Memory
• An embedded system also needs memory for two purposes –
1) To store its program
2) To store its data
• Unlike normal desktops, in which programs and data are stored at
same place, embedded systems store data and programs in different
memories.
• This is simply because the embedded system doesn't have a hard
drive and the program must be stored in memory, even when the
power is turned off.
Memory
Memory – Program Storage Memory
Masked ROM (MROM)
Programmable Read Only Memory (PROM) /
(OTP)
Erasable Programmable Read Only Memory
(EPROM)
FLASH
Peripherals
• Any additional requirement in an
embedded system is dependent on the
equipment it is controlling.
Interfacing
• Plays important role in connecting
processor to peripherals
• Interfacing requirements of devices vary
a lot
• It is necessary to make the device and
processor compatible to each other
• Wide range of interfacing standards
available
Actuator:
A form of transducer device (mechanical or
electrical) which converts signals to corresponding
physical action (motion). Actuator acts as an
output device
Eg. Micro motor actuator which adjusts the position of the cushioning
element in the Smart Running shoes from adidas
12-Aug-19 Vijay Savani @ 2019 47
I/O Subsystem
• Light Emitting Diode (LED)
• 7-Segment LED Display
• Optocoupler
• Stepper Motor
• Relay
• Push button switch
• Keyboard
• Programmable Peripheral Interface
(PPI)
12-Aug-19 Vijay Savani @ 2019 48
Communication Interfaces
• Wide range of interfacing standards
available
• Example:
– SPI, I2C, UART,
– 1-Wire Interface, Parallel Interface
– USB, Fire Wire
– CAN, LIN, TIN
– IrDA, Bluetooth
– Wi-Fi, ZigBee, GPRS, etc.
Embedded Firmware
The control algorithm (Program instructions)
The configuration settings
The embedded firmware can be developed in
various methods like
high level languages like Embedded C/C++ using
an Integrated Development Environment
The IDE will contain an editor, compiler, linker,
debugger, simulator etc. IDEs are different for
different family of processors/controllers.
Write the program in Assembly Language using
the Instructions Supported by your application’s
target processor/controller
12-Aug-19 Vijay Savani @ 2019 50
Reset Circuit
Essential to ensure that the
device is operating at correct
voltage
It brings internal registers and
the different hardware systems
of the processor/controller to a
known state
Starts the firmware execution
from the reset vector
The reset vector can be
relocated to an address for
processors/controllers
supporting bootloader
The reset signal can be either
active high or active low
12-Aug-19 Vijay Savani @ 2019 52
Oscillator Unit
• The instruction execution of a microprocessor/controller occurs in sync with a
clock signal
• The oscillator unit of the embedded system is responsible for generating the
precise clock for the processor
Microcontroller Microprocessor
C : Capacitor
Y : Resonator
Crystal Oscillator
Oscillator
Unit
Quartz Crystal Clock Input Pin
Resonator C C
Y Oscillator
Unit
Microoprocessor/
Controller
Watchdog
Free Running
Reset Pin
Counter
Watchdog Reset
System Clock
Case Study
Software
(Application Programs)
Processor
Coprocessors
ASIC
Converters
Component of Embedded
System
Software & Operating System
also Software Testing
Embedded Software
Embedded Software
• The embedded software interacts with the
hardware circuitry to generate the desire
functionality.
• This interaction is use for efficient
management of I/O operations, memory and
specific tasks to be carried out in accordance
with the stipulated response time.
• Fundamentally, embedded software is.
– Resource-constrained.
– Footprint constrained.
– Time restricted.
How smart things think
12-Aug-19 Vijay Savani @ 2019 68
Development Environment
• The embedded system may not
have a keyboard, a screen, a disk
drive and other peripheral devices
required for programming and
development tasks.
• Therefore most of the programming
for embedded systems is done on a
host, which we commonly refer as
personal computer systems with all
the required programming tools.
• Only after the program has been
written, compiled, assembled and
linked it is moved to the target or
the system that is shipped to the
customers.
12-Aug-19 Vijay Savani @ 2019 69
Text Debugger
editor
Project Simulator
Custom plug-ins
manager
output
(editors, source code
control systems, etc.)
compilers
assembler
RTOS plug-ins
Linker,
libraries
assemblers
compilers
emulators
simulators
linkers
debuggers
12-Aug-19 Vijay Savani @ 2019 71
Terminologies
• Editor
• Assembler
• Compiler
• Linker
• Debugger
• Simulator
• Emulator
Editor
Software code for a micro controller is written in a
programming language of choice (often assembler
or C).
This source code is written with a standard ASCII
text editor and saved as an ASCII text file.
Programming in assembler involves learning a
micro controller's specific instruction set
(assembler mnemonics). But, results in the most
compact and fastest code.
A higher level language like C is for the most part
independent of a micro controller's specific
architecture, but still requires some controller
specific extensions of the standard language to be
able to control all of a chip's peripherals and
functionality.
12-Aug-19 Vijay Savani @ 2019 73
Debugger
• A debugger is a piece of software running on the PC.
• A debugger allows you to download your code to the
emulator's memory and then control all of the
functions of the emulator from a PC.
• Common debugging features include the capability to
examine and modify the micro controller's .
– On-chip registers.
– Data- and program-memory.
– Pausing or stopping program executing at defined
program locations by setting breakpoints.
– Single-stepping.
– Looking at a history of executed code (trace).
Simulator
• Simulators try to model the behavior of the
complete micro controller in software.
• No matter how fast your PC, there is no
simulator in the market that can actually
simulate a micro controller's behavior in real-time.
• A simulator can also not talk to your target
system, so functions that rely on external
components are difficult to verify.
• For that reason simulators are best suited to test
algorithms that run completely within the
microcontroller (like a math routine for
example).
• Assembly
•C
• C++
• Embedded C
• Embedded C++
• Extended Embedded C++
• Python
C/C++ Compilers
• C/C++ compilers generally having
following C++ features:
Classes
Polymorphism
Overloading of operators and
function names
C++ templates and the standard
template library (STL)
Namespaces
Mutable specifier
Embedded C++
• Embedded C++ is a subset of the C++
programming language
• Embedded C++ lacks the following
features of C++
– Templates
– Multiple inheritance
– Exception handling
– Runtime type information
– New cast syntax (operators dynamic_cast, static_cast,
reinterpret_cast, and const_cast)
– Namespaces
Hardware Debugging
• IAR support following hardware debugger
• Angel
• GDB server
• J-link/j-trace
• IAR ROM
• LMI FTDI
• Macraigor
• RDI
• And third party
• Using J-LINK/J-TRACE we can download program
into flash memory
• These two debugger provide support for access CPU
on-chip RAM
12-Aug-19 Vijay Savani @ 2019 81
Operating System
• Multitasking (multiprocessing or
multithreaded) software
• Scheduling multiple tasks
• Management of
– Processes
– Memory
– Device & ports
– Network
– File system
– Timers
– Event functions, inter-processor communication, shared
memory, security, GUIs, ...
Learn by Doing
Excel Thru Experimentation
Lead by Example