Professional Documents
Culture Documents
•2
Example
The missile has to track and intercept an enemy aircraft. The
missile contains an embedded system that tracks the aircraft and
generates a control signal that will launch the missile.
If there is any delay in tracking the aircraft and if the missile
misses the deadline, the enemy aircraft may drop a bomb and cause
a loss of many lives.
•NETWORKED INFORMATION APPLIANCES
•15
EXAMPLES
1.A networked process control system consists of a number of
embedded systems connected as a Local Area Network. Each
embedded system can send real time data to a central location from
where the entire process control system can be monitored. The
monitoring can be done using a web browser such as the Internet
Explorer.
2.A web camera can be connected to the Internet. The web camera
can send pictures in real time to any computer connected to the
Internet. In such a case, the web camera has to run the HTTP server
software in addition to the TCP / IP protocol suite.
•NETWORKED INFORMATION APPLIANCES
•17
3. The door lock of the home can be a small embedded system
with TCP / IP and HTTP server software running on it.
•Weather
•Internet
Monitoring
•System
•Hardware
•Operating System
•Application Software
Memory
Random Access Memory (RAM) and Read Only Memory (ROM).
The contents of the RAM will be erased if power is switched off to
the chip, whereas ROM retains the contents even if the power is
switched off. Hence, the firmware is stored in ROM. When the
power is switched on, the processor reads the ROM, the program is
transferred to RAM and the program is executed.
•OVERVIEW OF EMBEDDED SYSTEM
ARCHITECTURE
•26
Input Devices
Input devices to the embedded system have very limited capability.
There will be no keyboard or mouse, and hence interacting with
the embedded system is no easy task.
Many embedded system will have a small keypad, press a key to
give a specific command.
A keypad may be used to input only the digits.
Many embedded systems used in process control do not have any
input device for user interaction, they take inputs from sensors or
transducers and produce electrical signals that are in turn fed to the
other systems.
•OVERVIEW OF EMBEDDED SYSTEM
ARCHITECTURE
•27
Output Devices
Output devices also have very limited capability.
Some embedded system will have a few Light Emitting Diodes
(LEDs) to indicate the health status of the system modules, or for
visual indication of alarms.
A small Liquid Crystal Display (LCD) may also be used to display
the parameters.
•OVERVIEW OF EMBEDDED SYSTEM
ARCHITECTURE
•28
Communication Interfaces
Embedded systems may need to interact with other embedded
systems or they may have to transmit data to a desktop.
To facilitate this, the embedded systems are provided with one or
few communication interfaces such as RS232, RS422, RS485,
Universal Serial Bus (USB), IEEE 1394, Ethernet, etc,.
•OVERVIEW OF EMBEDDED SYSTEM
ARCHITECTURE
•29
1.Reliability
When the desktop hangs, we need to reset the computer. However,
this is not the case with the embedded systems used in mission
critical applications. They must work with high reliability.
The system should continue to work for thousands of hours
without break. Many embedded system used in industrial control
are inaccessible. They are hidden in some other large sized
equipment; hence there will not be a reset button on such system.
The design of embedded system should be such that in case the
system has to be reset, the reset should be done automatically.
•SPECIALTIES OF EMBEDDED SYSTEMS
•31
1.Performance
Many embedded systems have time constraints.
For example, in a process control system, a constraint can be : “if
the temperature exceeds 40 degrees, open a valve within 10
milliseconds”.
If the deadline are not met in a safety required systems such as
nuclear plant results in severe damage.
•SPECIALTIES OF EMBEDDED SYSTEMS
•33
1.Power Consumption
Many of the embedded systems operate through a battery. To
reduce the battery drain and avoid frequent recharging of the
battery, the power consumption of the embedded system has to be
very low.
To reduce power consumption such hardware components should
be used that consume less power. Besides, emphasis should be on
reducing the components count of the hardware.
To reduce the component count, the hardware designer have the
option of using Programmable Logic Devices (PLDs) and Field
Programmable Gate Arrays (FPGAs).
•SPECIALTIES OF EMBEDDED SYSTEMS
•34
1.Cost
For embedded system used in safety applications of a nuclear plant
or in a spacecraft, cost may be a very important factor.
However, for embedded systems used in consumer electronics or
office automation, the cost is of utmost importance.
•SPECIALTIES OF EMBEDDED SYSTEMS
•35
1.Size
Size is certainly a factor for many embedded systems. The size and
weight are important parameters in embedded systems used in
aircraft, spacecraft, missiles, etc,. because in such cases, every inch
and gram matters.
To reduce the size and weight, again the hardware engineers have
to design their boards by reducing the computer count to the
maximum possible count.
•SPECIALTIES OF EMBEDDED SYSTEMS
•36
So, every time there is a tariff change, the PCO operator has to
replace the program stored in the memory of the embedded system
with new program. There is very cumbersome, considering that a
memory chip will have to be replaced in the thousands of PCOs.
Nowadays, software downloading the software onto the embedded
system through a network connection.
•RECENT TRENDS IN EMBEDDED SYSTEMS
•39
2. Memory
The cost of the memory chip is reducing day by day. As a result,
the embedded system can be made functionally rich by
incorporating additional features such as network protocols and
even graphical user interface.
In olden days, the cost of memory chips used to discourage
developers from porting an operating system onto the target
hardware.
As the memory chips are becoming cheaper, porting an operating
system is no longer an issue. Now, wristwatches with embedded
Linux operating system are available.
•RECENT TRENDS IN EMBEDDED SYSTEMS
•42
1.Programming Languages
Development of embedded software was done mostly in assembly
languages.
However, due to the availability of cross compilers, most of the
development is now done in high level languages such as C.
The object oriented languages like C++ and Java, are now catching
up.
The main attraction of Java programming language was in initiated
mainly to address the embedded system market. Many exciting
applications are possible by having a Java Virtual Machine in an
embedded system.
•RECENT TRENDS IN EMBEDDED SYSTEMS
•46
It enables the system download Java applets from a server and
execute them.
Microsoft’s embedded visual tools can be used for development of
embedded software applications.
People with experience in Microsoft Visual Studio can become
embedded software developers with very little training.
•RECENT TRENDS IN EMBEDDED SYSTEMS
•47
1.Development Tools
Availability of a number of tools for development, debugging and
testing as well as for modeling the embedded system is now paving
way for fast development of robust and reliable systems.
Development tools such as MATLAB and Simulink can be used to
model an embedded system as well as to generate code,
substantially reducing the development time.
Development tools such as BREW (Binary Runtime Environment
for Wireless), Java 2 Micro Edition (J2ME) development tools,
Wireless Application Protocol (WAP) development tools facilitate
easy development of applications for mobile devices.
•RECENT TRENDS IN EMBEDDED SYSTEMS
•48
1.Programmable Hardware
Programmable Logic Devices (PLDs) and Field Programmable
Arrays (FPGAs) pave the way for reducing the components on an
embedded system, leading to small, low cost systems.
After developing the prototype of an embedded system, for mass
production, an FPGA can be developed which will have all the
functionality of the processor, peripherals as well as the application
specific circuitry.
“System –on-chip” is the catchword that reflects the current
developments in programmable hardware – a single chip is the
embedded system.
•ARCHITECTURE OF EMBEDDED SYSTEMS
•50
•ADC •RO
•CPU M
•DAC
•RA
M
•Power •Watchdog
•Clock •Chip •Debug
Supply Timer & Reset
•Circuitry •Select port
Unit Circuitry
•Control
•Unit •Instruction Decoder •Control &
•Status Bus
CPU consists of
Arithmetic Logic Unit (ALU) which performs arithmetic and logic
operations (such as add, multiply, subtract, etc,.)
General purpose registers. These registers constitute the
processor’s internal memory. The number of registers varies from
processor to processor. Registers contain the current data and
operands that are being manipulated by the processor. When a
processor is referred to as of 8bits, 16 bits, etc,. It refers to the width
of the registers.
Control unit that fetches the instructions from memory, decodes
them and executes them.
•HARDWARE ARCHITECTURE
•55
Processor Architectures
In addition to manipulating data, a processor’s job is to read data
and instructions from memory, read and write data to memory, write
data to output devices.
For these functions, the processor communicates with other
devices using three buses, a bus being a group of signals.
These buses are
1.Data bus which carries the data between the processor and other
devices. This bus is bi-directional.
2.Address bus which carries the address information from the
processor to the memory and hence this bus is unidirectional.
•HARDWARE ARCHITECTURE
•57
3. Control and Status bus which carries control / status information
such as whether the operation is read or write, indication of address
error, as well as processor reset signal, clock input and interrupt
signals. This bus is bi – directional.
•Address
Bus
•CPU •Data Bus •Memory
•Control &
Status Bus
Based on the number of memory and data buses used, there are
three types of architectures for the processors. They are
1.Von Neumann Architecture
2.Harvard Architecture
3.Super Harvard Architecture
•HARDWARE ARCHITECTURE
•59
•Address
Bus
•CPU •Data Bus •Memory
(Instruction
& Data)
Harvard Architecture
In Harvard architecture, there are two separate memory blocks –
one is program memory and the other is data memory.
Program memory stores only instructions and data memory stores
only data.
Two pairs of data buses are used between the CPU and the
memory blocks.
Program memory address bus and program memory data bus are
used to access the program memory. Data memory address bus and
data memory data bus are used to access the data memory.
This architecture is much more efficient because accessing the
instructions and data will be very fast.
•HARDWARE ARCHITECTURE
•62
•Data
•Program •Memory
•Memory •Address Bus
•Address Bus
•Program •Data
•CPU •Memory
•Memory
•(Only Data)
•Program
•Data
•Memory
•Memory
•Data Bus
•Data Bus
•Harvard Architecture
•HARDWARE ARCHITECTURE
•63
•Data
•Program •Memory
•Memory •Address Bus
•Address Bus
•CPU •Data
•Program
Memory •Memory
•Instructio •(Only Data)
•Program n
•Cache •Data
•Memory
•Memory
•Data Bus
•Data Bus
•Super Harvard Architecture
•HARDWARE ARCHITECTURE
•64
Interrupts
Interrupt is a signal to the processor that some important event has
occurred.
For example, the processor does not keep on checking whether
you are pressing a key on the keyboard. When a key is pressed, an
interrupt goes to the processor and then the processor reads the key
pressed.
Corresponding to each interrupt, there will be an Interrupt Service
Routine (ISR) that will be executed.
But, before executing the ISR, the processor has to temporarily
halt the work it is doing. So, it saves the contents of the registers by
pushing the register values and stack pointer onto the stack.
•HARDWARE ARCHITECTURE
•66
Then the processor loads the interrupt vector, i.e. the address at
which the ISR is lying, into the program counter.
After the execution of ISR, the processor reloads the registers and
stack pointer, and resumes the previous execution.
There may be more than one interrupt to the processor. Hence,
priorities are assigned to the interrupts so that the processor
executes the highest priority interrupt.
A Programmable Interfaces Controller (PIC) interfaces with CPU
to handle external devices and decide which interrupt has to be
processed.
An interrupt table contains the details of various interrupts such
•HARDWARE ARCHITECTURE
•67
Memory
The memory is divided into two categories : program memory and
data memory. The program memory stores the firmware
permanently whereas data memory contents are erased when power
is switched off.
Both program memory and data memory can be internal to the
processor (as in the case of a micro controller) or it can be external
memory.
In a micro controller, both program memory and data memory are
on chip. However, if the capacity of the internal memory is not
sufficient, the external memory chips can be used to increase the
memory capacity.
•HARDWARE ARCHITECTURE
•73
•Processor
•Address
Bus
•Data Bus
•Flash
•EEPROM •RAM
•Memory
•CPU •DMA
Controller
•I / O device
•Memory
Generally, the data transfer between the I/O device and the
memory is coordinated by the CPU. In cases where handling of the
I/O devices by the processor is not efficient, data transfer between
the I/O device and the memory can take place directly, which is
known as DMA.
A special device called DMA controller does the job.
DMA controller takes the control of the buses and transfer data
between the I/O device and the memory.
•HARDWARE ARCHITECTURE
•85
Function Keypad
Based on the application, an embedded system has to be provided
with a function keypad to input data and / or commands.
•HARDWARE ARCHITECTURE
•10
0
The same line is used for master transmission and slave response.
I2C bus is a mutli master bus, more than one device can act as
master.
•HARDWARE ARCHITECTURE
•10
6
Debugging Port
Debugging a processor based board is very difficult.
Earlier, many processor manufactures used to provide proprietary
interface to do the debugging.
Joint Test Access Group (JTAG) standardized a mechanism for
providing the debugging through a port called JTAG port.
JTAG port provides access to the internals of the processor.
The standard IEEE 1149.1a 1993 (Standard Test Access Port and
Boundary Scan Architecture) gives the details of the protocols used
in JTAG port.
•HARDWARE ARCHITECTURE
•10
7
Communication Interfaces
For embedded systems to interact with the external world, a
number of communication interfaces are provided. They are
Serial Interface using RS232
Serial Interface using RS422 / RS485
Universal Serial Bus (USB)
Infrared
Ethernet
Wireless interface based on IEEE 802.11 Wireless LAN standard
Bluetooth radio interface
•HARDWARE ARCHITECTURE
•10
9
Power Supply Unit
An embedded system operates either through a 230V mains supply
or through a battery.
Since the components in the embedded system require a different
DC voltages such as +12 volts, -12 volts, +5 volts, +3.3 volts etc., a
Power Supply Unit (PSU) is required which provides stable DC
voltages from the mains or battery.
An AC adapter converts the main supply to +5 volts to +12 volts
DC supply giving a current upto 500mA.
The batteries give different voltages, but the output is not stable
and the power supply unit has to drive the necessary voltages from
this DC voltages. Voltage regulators are used for this purpose.
•HARDWARE ARCHITECTURE
•11
0
The input to a voltage regulator is a range of DC voltages and the
output is a stable fixed voltage.
DC – DC converters convert an unregulated voltage to a constant
DC voltage.
There are two types of DC – DC converters used in embedded
systems.
Linear regulators
Switching regulators
In linear regulators, the output voltage is less than the input
voltage. They need less number of components, hence these
regulators cost less and give low noise. But they are less efficient
and waste more power. The IC LM78xx series are example of linear
regulators.
•HARDWARE ARCHITECTURE
•111
for ( ; ; )
{
Statements;
}
Alternatively, you can use while loop as in
while ( )
{
Statements;
}
Each task is assigned a priority. Generally, an operating system can
support 256 priority levels.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•12
8
Task Scheduling
Since only one CPU has to handle multiple tasks, the tasks have to
share the CPU time in a disciplined way so that one task does not
get lot of time while others wait for unduly long time. Important
time critical tasks have to be given high priority; and a mechanism
for deciding which task will get the CPU time next has to be
worked out. This is known as task scheduling.
If the embedded system has to meet real time requirements, the
task scheduling has to be done in such a way that the time deadlines
are met. An operating system in which the time that is required to
execute a task can be estimated is called a ‘deterministic’ operating
system – you should be able to determine the worst case timings for
completing the task.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•12
9
Memory Management
The memory of an embedded system is to be shared by a number
of tasks. So, memory management is another service provided by
OS.
Time services
The operating system needs to keep track of the time for activities
such as the time for which the particular task is running, the time
for which a task can wait for a shared resource, etc. The OS also
provides the timer service. All the above mentioned functions are
carried out by the operating system kernel. The kernel is the heart of
the operating system. The software in embedded system can be
divided into the operating system and the application software.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•13
3
•Application software
•Communication
•Software
•Operating system
•File system
•Kernel
•Libraries
•Device
•manager
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•13
4
Kernel
Kernel manages the tasks to achieve the desired performance of
the embedded system. To manage the tasks, the important
requirement are to schedule the tasks and to provide inter task
communication facilities. To achieve these two requirements, kernel
objects are defined such as tasks, mutexes, ISRs, events, message
boxes, mailboxes, pipes and timers. Kernel provides the necessary
memory management services, time management services, interrupt
handling services and device management services.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•13
6
Device manager
The I / O devices are used to send / receive data from the
embedded system. The OS manages the I/O devices through
interrupts and device drivers. Device drivers provide the necessary
interface between the application and the hardware.
Communication Protocol Software
If the embedded system has communication interface such as
Ethernet, USB etc,. the upper protocol layers such as TCP / IP stack
need to be integrated with the OS. Then the embedded system can
be network enabled.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•13
7
Libraries
The operating system may have some C/C++ library files in object
code, which can be used through the API calls.
File system
Most of the embedded system do not have a secondary storage. In
such cases, the ROM is used to store the program. In case a file
system is required, a small file system can be developed on Flash
memory. Some embedded systems may use a secondary storage just
for booting. For example, an Internet kisok (which is an embedded
system built around, say Pentium based hardware) may use a
CDROM for initial bootup.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•13
8
Communication Software
Most of the embedded systems need a communication interface to
interact with the external world.
To communicate with another device, the embedded system will
have the hardware interfaces. In addition, communication software
needs to be integrated with the firmware.
For instance, to make an embedded system network enabled, in
addition to say Ethernet interface, TCP/IP protocol stack has to run
on it.
The advantage of these interfaces is that the embedded system can
be accessed over network such as LAN, corporate Intranet or even
the public Internet.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•14
4
Internet protocol suite
The Internet protocol suite is the networking model and a set
of communications protocols used for the Internet and similar
networks. It is commonly known as TCP/IP, because its most
important protocols, the Transmission Control Protocol (TCP) and
the Internet Protocol (IP) were the first networking protocols
defined in this standard.
It is occasionally known as the DoD model, because the
development of the networking model was funded by DARPA, an
agency of the United States Department of Defense.
TCP/IP provides end-to-end connectivity specifying how data
should be formatted, addressed, transmitted, routed and received at
the destination.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•14
5
•Two Internet hosts connected via two routers and the corresponding layers used at each hop.
The application on each host executes read and write operations as if the processes were
directly connected to each other by some kind of data pipe. Every other detail of the
communication is hidden from each process. The underlying mechanisms that transmit data
between the host computers are located in the lower protocol layers.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•14
7
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•14
8
Link layer
The link layer is the networking scope of the local network
connection to which a host is attached. This regime is called
the link in TCP/IP literature. It is the lowest component layer of the
Internet protocols, as TCP/IP is designed to be hardware
independent. As a result TCP/IP may be implemented on top of
virtually any hardware networking technology.
The link layer is used to move packets between the Internet layer
interfaces of two different hosts on the same link. The processes of
transmitting and receiving packets on a given link can be controlled
both in the software device driver for the network card, as well as
on firmware or specialized chipsets.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•14
9
Transport layer
The transport layer establishes a basic data channel that an
application uses in its task-specific data exchange. The layer
establishes process-to-process connectivity, meaning it provides
end-to-end services that are independent of the structure of user
data and the logistics of exchanging information for any particular
specific purpose. Its responsibility includes end-to-end message
transfer independent of the underlying network, along with error
control, segmentation, flow control, congestion control, and
application addressing (port numbers). End to end message
transmission or connecting applications at the transport layer can be
categorized as either connection-oriented, implemented in TCP, or
connectionless, implemented in UDP.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•15
3
Application layer
The application layer contains the higher-level protocols used by
most applications for providing user services over a network and for
some basic network support services[. Examples of application
layer protocols include the File Transfer Protocol (FTP), the Simple
Mail Transfer Protocol (SMTP), and Dynamic Host Configuration
Protocol (DHCP).Data coded according to application layer
protocols are then encapsulated into one or (occasionally) more
transport layer protocols (such as TCP or UDP), which in turn
use lower layer protocols to effect actual data transfer.
•ARCHITECTURE OF EMBEDDED OPERATING
SYSTEM
•15
9
Back
•PACKET ASSEMBLER/DISASSEMBLER
•16
8
Back
•POINT TO POINT PROTOCOL
•16
9