Introduction of
Embedded Systems
What is an embedded system?
A physical system that employs computer control for a specific purpose,
rather than for general-purpose computation.
Embedded systems are application specific & single functioned; application is known
apriori, the programs are executed repeatedly.
They generally have minimal or no user interface.
Embedded Systems is a special purpose computer system/board, which covers all the
devices such as processor, memory, interface and control in single package or board to
perform only a specific application tasks.
A “Short List” of Embedded Systems
Anti-lock brakes Fingerprint identifiers
Auto-focus cameras Home security systems
Automatic teller machine Medical testing systems
Automatic toll systems Modems
Automatic transmission MPEG decoders
Avionic systems Network cards
Battery chargers Network switches/routers
Camcorders Pagers
Cell phones Photocopiers
Cell-phone base stations Printers
Cordless phones Scanners
Cruise control Stereo systems
Digital cameras TV
Disk drives VCR
Electronic card readers Video game controllers
Electronic toys/games Video phones
Fax machines Washers and dryers
Embedded Systems
Embedded systems
information processing systems
embedded into a larger product
Two types of computing
Desktop – produced millions/year
Embedded – billions/year
Non-Embedded Systems
PCs, servers, and notebooks
The future of computing!
Automobiles, entertainment,
communication, aviation, handheld
devices, military and medical
equipments.
Components of Embedded Systems
Components of Embedded Systems
Analog components
- Sensors, controllers,…
Digital components
- Processor, coprocessors
- Memories
- Controllers, busses
- ASIC: Application-Specific Integrated Circuit, a chip designed for a
particular application
Converters – A/D, D/A, …
Software
- Application programs
- Exception handlers
Hardware components of an Embedded
System
CPU: Microprocessor/ Microcontroller/DSP
• Non Volatile memory: EPROM, Flash
• Volatile memory: DRAM, SRAM
• System clocks: RTC circuitry, System clock
• Standard devices: I/O ports, peripherals,
• Custom devices: FPGA, PAL
• Communication devices and drivers: Ethernet, RS-232, USART
• Debug mechanism: Debug port, Watchdog timer, JTAG, ICE
• Buses for device networks: I2C, CAN, SPI, etc.
Characteristics
Application specific
- Optimize for cost, area, power, and performance
Digital signal processing
- Signals are represented digitally
Reactive
- Reacts to changes in the system’s environment
Real-time
- Compute certain tasks before deadline
Distributed, networked,…
Characteristics
Reliability
- Probability of system working correctly at fixed time
Maintainability
- Probability of system working correctly fixed time units after error
occurred
Safety
- Not harmful for user
Security
- Confidential and authentic communication
Essential Considerations
• Response Time -- Real Time Systems
• Area
• Cost
• Portability
• Low Power (Battery Life)
Fault Tolerance-continue operation despite
hardware and software faults
Processor Classifications
Based on register size
-8 bit
-32 bit
Processors can be classified as 8 bit/16 bit/32 bit /64 bit based on the size
of their internal registers.
• Typically, the data bus width equals the size of the data registers so that the
register data can be read/written in one read/write cycle.
Based on Endianness
- Big Endian
- Little Endian
- Big Endian
Eg: SPARC, power PC
Little Endian
Intel processors
• Configurable Processors
some processors can be configured during boot up process as big or little
endian. Eg: ARM processors
Based of instruction set
RISC
CISC
RISC
• Only load/store instructions use the external memory.
• All instructions are same size and fixed length.
• Number of instructions available are less compared to CISC.
• Typically has less pipeline stages than CISC.
Eg ARM processor.
Based of instruction set
CISC
Most instructions can operate directly on external memory.
• Hence require less number of registers.
• Instructions are of different sizes. Hence they take varied clock cycle to
decode and execute each instruction
• Pipeline stages take varied times and hence pipeline is not so efficient as
the RISC processors.
More number of instructions since many complex operations are
implemented
Eg: Intel Pentium processors
Based on Bus Architecture
Von Neumann Architecture
Harvard Architecture
Von Neumann
A Von-Neumann Machine Architecture provides one data path (bus) for
both instruction and data
• As a result, the CPU can either be fetching an instruction from memory, or
read/writing data to it
• Other than less complexity of hardware, it allows for using a single,
sequential memory.
• Today’s processing speeds vastly outpace memory access times, and we
employ a very fast but small amount of memory (cache) local to the
processor
Harvard
Harvard Architecture refers to a memory structure where the processor is
connected to two different memory banks via two sets of buses
• This is to provide the processor with two distinct data paths, one for instruction
and one for data
• Through this scheme, the CPU can read both an instruction and data from the
respective memory banks at the same time
• This inherent independence increases the throughput of the machine by
enabling it to always prefetch the next instruction
• The cost of such a system is complexity in hardware
Commonly used in DSPs
Modern processors employ a Harvard Architecture to read from two instruction
and data caches, when at the same time using a Von-Neumann Architecture
to access external memory
Based on Functionality
General purpose Processors
Special purpose Processors- DSP, Network
General purpose processors:
All the regular processors
Special purpose processors:
Digital Signal Processors
DSP processors are microprocessors designed for efficient mathematical
manipulation of digital signals.
They are optimized for doing intense addition and multiplication
operations.
Based on Functionality
Network Processors
Used in routers. Multiple processors are pipelined to process the network
packets in a optimal way.
Each processor processes multiple packets concurrently in multiple
threads.
Eg : IXP1200 from Intel
Traditional Design Challenges
Low cost Mixed digital/analog
requirements
Light weight
Shrinking time-to-
Reliability
market
Low power
Short product lifetime
Portable
Real-time processing
Complexity
Inherent concurrency
Ease of use
HW/SW co-design
Recent Design Challenges
Design complexity
Ultra low power
- Highly adaptive
- Active power management (voltage scaling, etc.)
- Alternative energy source (solar, etc.)
Internet aware
- Incorporate RF (radio frequency) technologies
- Networking capabilities
* Larger OS, middleware, etc.
* Understanding of many/changing protocols
Verification
Security
Block Diagram of an Embedded
Parallel
To external Processor I/O ports
memory core
Serial
I/O ports
Internal
memory
Counter/Timer
A-to-D conv ersion D-to-A conv ersion
Processor
Figure 9.3. A block diagram of an embedded processor.
Design Issues
Cost
I/O capability
Size
Power consumption
On-Chip memory
Performance
Software
Instruction set
Development tools
Testability and reliability
Various types of Memory
DRAM: Dynamic Random Access Memory
very dense (1 transistor per bit) and inexpensive
requires refresh and often not the fastest access times
often used for main memories
SRAM: Static Random Access Memory
fast and no refresh required
not so dense and not so cheap
often used for caches
Various types of Memory
ROM: Read-Only Memory
often used for bootstrapping
All ROM devices can retain data and programs forever, even during
power failure.
PROM: Programmable ROM
Once programmed, its contents cannot be changed.
One time programmable.
Various types of Memory
EPROM: Erasable-and-programmable ROM
EPROM can be erased and programmed repeatedly.
Essential part of software development and testing.
Hybrid Devices
hybrid memories can be written as desired, like RAM, but maintained their contents
without electrical power, just like ROM
two of hybrid devices – EEPROM and Flash are ROM devices used to store code.
third hybrid device – NVRAM, is modified version of SRAM.
EEPROMs are electrically erasable and programmable
Various types of Memory
Flash memory
high density, low cost, nonvolatile, fast and electrically erasable.
Flash devices can be erased one sector at a time.
sector sizes range from 256 bytes to 16 KB
NVRAM
usually SRAM with a battery backup when power is turned on, operates
just like SRAM when power is turned off, NVRAM draws power from battery
to retain its data
The Embedded Software Development
Process
The Tools
Compiler: Translates human readable code into assembly language or
opcodes for a particular processor. Produces an object file.
Assembler: Translates assembly language into opcodes. Also produces an
object file.
Linker: Organizes the object files, necessary libraries, and other data and
produces a relocatable file.
The Tools
Relocatable file: an object file that holds code and data suitable for linking
with other object files to create an executable or a shared object file. In
other word, you can say that relocatable file is a foundation for creating
executables and libraries.
Locator: Takes the relocatable file and information about the memory of
the system and produces an executable file.(By the way: gcc takes care
of all of these functions at once)
The Tools: Embedded System
Specifics
All of the tools run on the host computer, not the embedded computer.
Compiler
Assembler
Linker
Locator
Another alternative is to add a real-time operating system or embedded
operating system, which may have DSP capabilities like DSP nano RTOS.
The Tools: Embedded System
Specifics
Cross Compiler
A compiler that generates machine language for a different type of
computer than the one the compiler is running in.
Cross-compiling doesn’t guarantee correct target code due to (e.g.,
differences in word sizes, instruction sizes, variable declarations, library
functions)
Cross Assembler
An assembler that generates machine language for a different type of
computer than the one the assembler is running in. It is used to develop
programs for computers on a chip or microprocessors
used in specialized applications that are either too small or are otherwise
incapable of handling the development software.
Moving the program onto the
embedded system
Remember, the program is written (and possibly run in an emulator) on a
host computer, but it still needs to get onto the embedded system.
Methods:
Build/burn the program into the hardware (firmware or other flash
memory)
Bootloader: a bootloader resides on the embedded system and facilitates
loading programs onto the system.
Debug Monitor: The debug monitor is a more robust program on an
embedded system that helps with debugging, and can include a
bootloader as well.
Debugging
Debugging embedded systems can be facilitated with a Debug Monitor,
or through a remote debugger on the host computer. A serial link is
normally set up.
Emulators can be used to test the system without utilizing the actual
hardware
A complete emulator provides a simulation of all aspects of the hardware,
allowing all of it to be controlled and modified, and allowing debugging
on a normal PC.
Debugging
An in-circuit debugger (ICD), a hardware device that connects to the
microprocessor via a JTAG or Nexus interface. This allows the operation of
the microprocessor to be controlled externally, but is typically restricted to
specific debugging capabilities in the processor
An in-circuit emulator (ICE) is a hardware device used to debug the
software of an embedded system. An in-circuit emulator replaces the
microprocessor with a simulated equivalent, providing full control over all
aspects of the microprocessor.
In-circuit emulation can also refer to the use of hardware emulation,
when the emulator is plugged into a system (not always embedded) in
place of a yet-to-be-built chip (not always a processor). These in-circuit
emulators provide a way to run the system with "live" data while still
allowing relatively good debugging capabilities.
Debugging
Software Simulators allow the programmer to debug completely on the
host system, which can be quicker .
When it comes down to it, an oscilloscope and a multimeter can be your
best friend for debugging.
Device Drivers
Device
Any peripheral such as a graphics display, disk driver, terminal, or printer is a
device. A device is usually considered to be a piece of hardware that you
can connect to your computer system and that you wish to manipulate by
sending commands and data.
Device Drivers
Three Classes of Device
Character Devices
ex: Key board, mouse, monitor, printer, Tape, etc.,
Block Devices
Ex: CD-ROM, floppy, Hard disk, etc.,
Network Interfaces
ex: Ethernet card, etc.,
Device Drivers
The OS interacts with devices through a program known as “Device Driver”
A device driver is a specific type of computer software developed to
allow interaction with hardware devices. Typically this constitutes an
interface for communicating with the device, through the specific
computer bus or communications subsystem that the hardware is
connected to, providing commands to and/or receiving data from the
device, and on the other end, the requisite interfaces to the operating
system and software applications
Device Drivers
Structure of Device Driver is OS specific
• Some RTOS allow device drivers to be installed and removed dynamically.
Statically linked driver, whose object code is linked with the kernel. The
code of such device driver is physically contained in the kernel and
therefore loaded in memory when the system boots.
Dynamically linked driver, whose object code is NOT linked with the
kernel. The code of such device driver is NOT contained in the kernel, and
the device driver is loaded and unloaded as and when required.
Real time in operating systems
“The ability of the operating system to provide a required level of service in a
bounded response time.”
Who are the Embedded OS players
Wind River Systems
– VxWorks
– pSOS
Mentor Graphics
– Nucleus
Palm Computing
– PalmOS
Symbian
– SymbianOS