Embedded System
Embedded Systems: G P Computer System:
Electronics system that contains contains general purpose (GP)
processor (uP/uC/DSP/ASIP etc.) microprocessor, primary &
and peripherals which is
configured to perform specific secondary memories, keyboards,
dedicated application printer, scanner, monitor etc.
Software embeds in ROM and Programmed for GP applications
not accessible to the user
that includes word processing,
accounting, scientific computing,
Mostly designed for time
constrained applications (real time email, multimedia, database
systems) system etc.
either independent system or a user does have access to
part of larger system.
software and decides which OS to
run and which application to
launch.
Dr. Z.M.Patel, SVNIT Surat
Characteristics of Embedded Systems
Single functioned – doing dedicated task repetitively
Tightly Constrained – area, power, cost
Reactive and Real time – react to signals
Safety critical (Dependable) system – Flight control, Fire control, Atomic
power plant
Interacting with harsh physical environment (vibrations, shock, supply
variations etc.)
Design Metrics:
cost (NRE and unit)
Time to market
Power, Performance, Size
Flexibility
Maintainability
Safety and Security
Dr. Z.M.Patel, SVNIT Surat
Classification of Embedded Systems
Small scale
electronic toy, digital watch, home security system, barcode reader, data
acquisition system, lighting control, elevator control
Medium scale
audio/video compression, image processing, digital camera, portable
video games, ATM, TV set top box, medical instruments
Complex (Sophisticated)
Smart Phone, High speed routers, Flight control, Sophisticated industrial
control & Automation
What skills and knowledge required in each case?
Dr. Z.M.Patel, SVNIT Surat
Example (Telegraph) :
Embedded software has to handle many real-world issues such as
Network Data may be out of order, lost or arrive twice
Other computers on Network also want to print
Need to provide status of printer to computers
It has to work with different type of printer
It need to respond quickly and keep track of time
Metrics => correctness, throughput (speed), response time, power consumption,
flexibility
Dr. Z.M.Patel, SVNIT Surat
Example (Digital Camera- Medium Scale):
Dr. Z.M.Patel, SVNIT Surat
Elements of embedded systems
(1) Processors:
General Purpose Processors : e.g.68HCxxx, intel 80x86, SPARC,
PowerPC
Enhanced Computing Capability, Graphics, Complex Math
Microcontrollers : 68HC11xx, 8051 family, PIC series, ARM series
Moderate Computing but enhanced I/O capability
On chip Memory, Peripherals and Debug hardware
Used for => Control and Communication
DSP : TMS series, SHARC
Fast Multiply-Accumulate, Multi-access memory, SIMD/MIMD processing
Digital filtering, Image/Audio processing, Cryptography, Noise shaping
ASSP/ASIP :
processor with hardwired logic customized to an application
(graphics processor, network processor, multimedia processor, …)
Dr. Z.M.Patel, SVNIT Surat
Elements of embedded systems
(2) Memories:
ROM variants (masked ROM, OTPROM, EEPROM, FLASHROM):
Stores firmware (codes for initializing hardware and loading embedded OS),
code for embedded OS and application software
RAM (SRAM, DRAM, NVRAM):
Stores variables, temporary results during program run, stack data
SRAM is common in embedded systems
On Chip Cache in CPU:
Small SRAM tightly coupled to CPU
Contains copies of recently access instructions and data
Dr. Z.M.Patel, SVNIT Surat
Elements of embedded systems
(3) Comm. Interfaces:
On board / On chip => I2C, SPI
External => RS232, RS422, RS485, USB, Ethernet, CAN etc.
(4) Other Components:
Keyboard, LED, LCD, GLCD
ADC/DAC, PWM, Watchdog timer, RTC etc.
Sensors
actuators (motors, relays, valves, solenoids)
Dr. Z.M.Patel, SVNIT Surat
Reset and Brown Out Circuits
Reset Circuit Brown Out Circuit
Dr. Z.M.Patel, SVNIT Surat
WATCHDOG TIMER
It is a hardware timer that monitors the execution of critical part of embedded
software
In down counting, initially embedded software loads it with count value #n before
executing critical piece of code.
# n is decided considering the worst case delay of this piece of code.
Under normal conditions, critical piece of software reloads (or resets) watchdog timer
before it gets timed out
If execution of critical code malfunctioned, behaved abnormally or stuck in loop, the
time out signal is generated.
The time out signal can be used to reset/interrupt microprocessor
Thus it rescues system from Erroneous condition by restarting embedded software
(or by jumping to safe part of software)
Dr. Z.M.Patel, SVNIT Surat
RTC
Keeps track of real time (seconds, minutes, hour, date, month, year, day of the week
etc.).
It has to work in the absence of power (mostly using on chip battery)
Alarm mode → RTC interrupts microprocessor when a particular time is reached
Periodic interrupt mode → RTC generates interrupt periodically
Digital Calibration and Synchronization of RTC:
Dr. Z.M.Patel, SVNIT Surat
Embedded software development
Assembly vs Embedded C
Dr. Z.M.Patel, SVNIT Surat
System Softwares in Embedded
System soft wares : (1) firmware (2) BSP (3) embedded OS or RTOS
[1] Firmware:
First code that runs upon power on
Deeply embedded and low level operation
Typically, it contains code for hardware initialization and loading OS
For some system, it contains complete software
[2] BSP:
System software library to that is needed to use hardware board
BSP a set of libraries (of h/w specific functionalities) that can be accessed
by application software
Dr. Z.M.Patel, SVNIT Surat
RTOS
RTOS (real time operating system) is one type of embedded OS
It performs low level operations such as servicing interrupts, managing & servicing
I/O devices (keypad, display, timers, communication ports ..), memory management,
scheduling of tasks (processes) etc.
RTOS hides system hardware from user/application
Applications use APIs (system calls) to access RTOS services
Kernel Mode => Embedded system runs RTOS functions
Dr. Z.M.Patel, SVNIT Surat