You are on page 1of 43

Paavai Institutions Department of ECE

UNIT-I
ARCHITECTURE OF EMBEDDED
SYSTEMS

Unit - I 1.1
Paavai Institutions Department of ECE

CONTENTS
1 .Introduction
1.1 Categories of Embedded Systems
1.1.1 Stand Alone Embedded Systems
1.1.2 Real Time Systems
1.1.3 Networked Information Appliances
1.1.4 Mobile Devices
1.2 Specifications of Embedded Systems
1.2.1 Safety and Reliability
1.2.2. Performance
1.2.3. Power Consumption
1.2.4. Cost
1.2.5. Robutness
1.2.6. Size
1.2.7. Limited User Interface
1.2.8. Software Upgrading Capability
1.3 Recent Trends of Embedded Systems
1.3.1 Processor Power
1.3.2. Memory
1.3.3. Operating System
1.3.4 Communication Interfaces and Networking Capability
1.3.5. Programming Languages
1.3.6. Development Tools
1.3.7. Programmable Hardware
1.4 Hardware Architecture
1.4.1 Processor Architecture
1.4.2 Von Neumann Architecture
1.4.3 Harvard Architecture
1.4.4 Super Harvard Architecture
1.5 Software Architecture

Unit - I 1.2
Paavai Institutions Department of ECE

1.6 Communication Software


1.7 Process of Generating Executable Image
1.8 Development Testing Tools
1.8.2 Software Development/Testing Tools

Unit - I 1.3
Paavai Institutions Department of ECE

TECHNICAL TERMS

1. STAND ALONE EMBEDDED SYSTEMS

These systems work in stand-alone mode. They take inputs, process them and produce the
desired output. The input is an electrical signal from transducers or commands from a
human being such as the pressing of a button. The output can be electrical signals to drive
another system, an LED display or LCD display for displaying of information to the users.
2. REAL TIME SYSTEMS
Embedded systems in which some specific work has to be done in a specific Time period
are called real time systems.

3. NETWORKED INFORMATION APPLIANCES


Embedded systems that are provided with network interfaces and accessed by networks such
as Local Area network or the Internet are called Networked information appliances.

4. MOBILE DEVICES
Mobile devices such as mobile phones, Personal Digital Assistants (PDAs), smart phones etc.
are a special category of embedded systems. Mobile gadgets need to store databases locally in
their memory. These gadgets imbibe powerful computing and communication capabilities to
perform real time as well as non-real time tasks and handle multimedia applications.
5. SYSTEM-ON-CHIP (SOC)
System-On-Chip (SOC) is the catchword that reflects the current developments in
programmable hardware-a single chip is the embedded system.
6. HARVARD ARCHITECTURE
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. This architecture is much more
efficient because accessing the instructions and data will be very fast.
7. SUPER HARVARD ARCHITECTURE
The super Harvard Architecture (SHARC) is a slight but significant modification of the
Harvard architecture. In Harvard architecture, the data memory is accessed more frequently
than Program memory. Therefore, in SHARC, provision has been made to store some
secondary data in the program memory to balance the load on both memory blocks.

Unit - I 1.4
Paavai Institutions Department of ECE

8. VON NEUMANN ARCHITECTURE


It is the most widely used architecture. It has one memory chip which stores both instructions
and data. The processor interfaces with the memory through address and data buses to
fetch instructions and data.
9. RANDOM ACCESS MEMORY (RAM)
The memory locations can be accessed randomly. RAM is a read-write chip as you can perform
both read and write operations on it.
10. READ ONLY MEMORY (ROM)
ROM is used to store the firmware in embedded systems because it retains its contents even if
power is switched off.
11. FLASH MEMORY:
It is a type of EEPROM. The memory is divided into sectors or blocks. Typical sector size is
256 bytes to 16KB. Each sector is an erasable unit. Flash memory is nowadays extensively
used in embedded systems for storing the firmware.
12. WATCHDOG TIMER
Due to some software or hardware error, a need may arise to reset the processor. Most of the
embedded systems do not have a reset button. The watchdog timer does the resetting. A timer is
set to a large value and it is decremented slowly. If the timer value reaches zeros, the processor
is reset through a reset-signal.

Unit - I 1.5
Paavai Institutions Department of ECE

UNIT I - ARCHITECTURE OF EMBEDDED SYSTEMS

1. INTRODUCTION
An embedded system is a computer system designed to do one or a few dedicated
and/or specific function often with real-time computing constraints. It is embedded as part of
a complete device often including hardware and mechanical parts. By contrast, a general-
purpose computer, such as a personal computer (PC), is designed to be flexible and to meet
a wide range of end-user needs. Embedded systems control many devices in common use
today.
An embedded system can be part of a larger system. Embedded system is used in any
application or device which requires having certain level of automation or intelligence.
Embedded systems are controlled by a main processing core that is either a
microcontroller or digital signal processor. In addition to commonly described embedded
systems based on small computers, a new class of miniature wireless devices called motes is
quickly gaining popularity as the field of wireless sensor networking rises. These motes are
completely self-contained, and will typically run off a battery source for many years before
the batteries need to be changed or charged.

HISTORY OF EMBEDDED SYSTEM

In1930-40s, Computers were comparable large and expensive, beside, they were
dedicated to a single task only. Apollo Guidance Computer (AGC) was first recognizable
modern embedded system developed by Charles Stark Draper, but it was very huge and risk
for Apollo project. Charles developed monolithic integrated circuit in order to reduce the size
and eight of AGC. In 1961, automatic D-17 guidance computer, were the early mass
produced embedded system built from transistor logic and had a hard disk for main memory.
In 1966, new computer emerged with the first high-volume use of Integrated Circuits.
Nowadays, the embedded system finds its application in the fields shown in the Figure 1.1.

Unit - I 1.6
Paavai Institutions Department of ECE

Figure 1.1: Applications of Embedded system

1.1 CATEGORIES OF EMBEDDED SYSTEMS


Based on functionality and performance requirements, embedded systems
can be categorized as:
 Stand-alone embedded systems
 Real time systems
 Networked information appliances
 Mobile devices

Unit - I 1.7
Paavai Institutions Department of ECE

1.1.2 Stand Alone Embedded Systems


These systems work in stand-alone mode. They take inputs, process them and
produce the desired output. The input can be electrical signals from transducers or commands
from a human being such as the pressing of a button. The output can be electrical signals to
drive another system, an LED display or LCD display for displaying of information to the
users.
Examples:
Embedded systems used in
 Process control,
 Automobiles,
 electronic items etc.

1.1.2 Real Time Systems


Embedded systems in which some specific work has to be done in a specific time
period are called real time systems.
Types of real time systems:
Two types.
a. Hard real time systems:
Missing a deadline may lead to a catastrophe.
E.g.: missile embedded with a tracking system
b. Soft real time systems:
The deadline is important but missing the deadline will not lead to a catastrophe.
E.g.: DVD player
1.1.3 Networked Information Appliances
Embedded systems that are provided with network interfaces and accessed by
networks such as Local Area network or the Internet are called Networked information
appliances. Such systems are connected to a network, typically a network running TCP/IP
protocol suite such as the internet or a company’s Intranet
These systems run the protocol TCP/IP stack and get connected either
through PPP or Ethernet to a network and communicate with other nodes in the network.

Unit - I 1.8
Paavai Institutions Department of ECE

Examples
 LAN where 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.

Figure 1. 2: Networked Information Appliance

 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
stack.
1.1.4 Mobile Devices
Mobile devices such as mobile phones, Personal Digital Assistants (PDAs), smart
phones etc. are a special category of embedded systems. Mobile gadgets need to store databases
locally in their memory. These gadgets imbibe powerful computing and communication
capabilities to perform real time as well as non-real time tasks and handle multimedia
applications. The gadgets embed powerful processor and OS, and a lot of money with minimal
power consumption behavior that can be fairly easily changed. PDAs are now capable of
supporting general-purpose application software such as word processors, games etc.

Unit - I 1.9
Paavai Institutions Department of ECE

Limitation
 Memory constraints
 Small size
 Lack of good user interfaces such as full-fledged keyboard and display etc.
1.2 SPECIFICATIONS OF EMBEDDED SYSTEMS
1.2.1 Safety And Reliability
Embedded systems must be very reliable as they perform critical functions. In mission-
critical applications such as aircraft flight control, severe personal injury or equipment damage
could result from the failure of embedded computer. Hence embedded system programmers
should take into considerations all possibilities and write programs that do not fail.
1.2.2. Performance
Many embedded systems have time constraints.
Examples
 For instance, in a process control system, a constraint can be: “if the temperature
exceeds 40 degrees, open a valve within 10 milliseconds”.
 The system must meet such deadlines
1.2.3. Power Consumption
Most of the embedded systems operate through a battery. To reduce the battery drain
and to avoid frequent recharging of the battery, the power consumption of the embedded
system has to be very low. The number of hardware components should also be reduced. To
reduce power consumption, the hardware designers have the option of using PLDs
and FPGAs. Reducing the component count apart from reducing the power
consumption also increases the reliability of the system.
1.2.4. Cost
For embedded systems used in safety applications of a nuclear plant or in a
spacecraft, cost may not be a very important factor. Embedded systems used in consumer
electronics or office automation, the cost is utmost important.
1.2.5. Robutness
Embedded systems must robust as they operate in harsh environment. They should
endure vibrations, power supply fluctuations and excessive heat.

Unit - I 1.10
Paavai Institutions Department of ECE

1.2.6. Size
The size and the weight are important parameters in embedded systems used in
aircraft, spacecraft, missiles etc. because in such cases, every inch and every gram matters. To
reduce the size and the weight, again the hardware engineers have to design their boards by
reducing the component count to the maximum possible extent. he development in
microelectronics has reduced the size and the weight of the embedded system devices to
a very great extent.
1.2.7. Limited User Interface
Some embedded systems do not have any user interface at all. They take electrical
signals as input and produce electrical signals as output. In many embedded systems, the input
is through a small function keypad or a set of buttons. The output is displayed either on a set
of LEDs or a small LCD. Developing a user friendly interface with limitation of the
input/output device is a challenging task for firmware developers.
1.2.8. Software Upgrading Capability
Embedded systems are meant for a very specific task. So, once the software is
transferred to the system, the same will run throughout its life. But, in some cases, it may be
necessary to upgrade the software.
Eg.: The tariff change in the PCO makes the necessity of changing the program for calculating
the amount of a call. So, it is easier to update the software instead of replacing the memory
chip of thousands of PCOs.
1.3 RECENT TRENDS IN EMBEDDED SYSTEMS
In good old days, most of the embedded software was written only in assembly
language and hence writing, debugging and maintaining the code were very difficult and time
consuming. With the availability of powerful processors and advanced development tools,
embedded software is also developed.
1.3.1. Power Processor
About 150 varieties of processors are available from around 50 semiconductor vendors.
Powerful 8-bit, 16-bit, 32-bit and64-bit micro-controllers and microprocessors are available for
real-time analysis of audio and video signals. As a result, the power of desktop computers is now
available on palmtops.

Unit - I 1.11
Paavai Institutions Department of ECE

1.3.2. Memory
The cost of memory chips is reducing day by day. As a result, the embedded system
can be made functionally rich by incorporating additional features such as networking
protocols and even graphical user interfaces. 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.
1.3.3. Operating System
The main advantage of embedding an operating system is that the software
development will be very fast and maintaining the code is very easy. The software can be
developed in a high-level language such as C. So, time to market, the system gets reduced. If
real-time performance is required, a real-time operating system can be used. In addition to
many commercial embedded/real-time operating systems, open source software campaign
led to development of many open source operating systems. The attraction of open source
software is that it is a free and also the complete source code is available to customize the
software as per your application needs.
1.3.4. Communication Interfaces and Networking Capability
Network-enabling of an embedded system has many advantages: It can be accessed over
a network for remote control or monitoring. Besides, upgrading the embedded software is
very easy as the new version can be uploaded through the network interface. Due to the
enhanced memory capacities of the embedded systems, TCP/IP protocol stack and the HTTP
server software can also be ported on to the system and such systems can be accessed over the
Internet from anywhere on the earth.

1.3.5. Programming Languages


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. Many exciting applications are possible by having a Java Virtual machine in an
embedded system.

Unit - I 1.12
Paavai Institutions Department of ECE

1.3.6. 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.

1.3.7. Programmable Hardware


PLDs and 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.
Keyword: System-On-Chip (SOC) is the catchword that reflects the current developments
in programmable hardware-a single chip is the embedded system.

1.4 HARDWARE ARCHITECTURE


Some of the building blocks of embedded system hardware are
 Central Processing Unit

 Memory

 Clock circuitry

 Watchdog Timer/Reset circuitry

 Chip select

 Input/output devices

 Debug port

 Communication Interfaces

Unit - I 1.13
Paavai Institutions Department of ECE

Figure 1. 3: Internal architecture of a processor

Central Processing Unit


The Central Processing Unit (CPU) is the portion of a computer system that carries
out the instructions of a computer program and is the primary element carrying out the
functions of the computer or other processing device. The Central Processing Unit carries out
each instruction of the program in sequence, to perform the basic arithmetical, logical, and
input/output operations of the system.
The CPU used in an embedded system can be of two categories:
 General Purpose Processor (GPP)
 Digital Signal Processor (DSP)
The GPPs are further classified as micro-controllers and microprocessors.
A microcontroller has memory and other peripherals on the chip itself and hence it is
the best choice for small embedded systems. A microprocessor is more powerful but requires a
large number of external components. The CPU consists of the units shown in the figure1.3.

Unit - I 1.14
Paavai Institutions Department of ECE

Arithmetic Logic Unit (ALU)


This unit performs arithmetic and logic operations such as addition,
subtraction, multiplication etc.
General purpose registers
These registers constitute the processor’s internal memory. The number of registers
varies from processor to processor. These registers contain the current data and operands that
are being manipulated by the processor.
Control Unit
It fetches the instructions from memory, decodes them and executes them. A control unit
consists of Instruction Pointer (IP) that points to the next instruction to be executed.
Instruction Pointer is also called Program Counter (PC). Stack Pointer (SP) that points to the
stack in the memory. Instruction Decoder that decodes the instructions. Memory Address
Register and Memory Data Register.

1.4.1 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 and read data from input
devices. To do these functions, the processor communicates with other devices using three
buses, a bus being a group of signals. These buses are:
Data bus: This carries the data between the processor and other devices. This bus is
bidirectional.
Address bus: which carries the address information from the processor to memory and hence
this bus is unidirectional.
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. Based on the number of memory and data buses
used, there are three types of architectures for the processors. These are:
 Von Neumann architecture
 Harvard architecture
 Super Harvard architecture

Unit - I 1.15
Paavai Institutions Department of ECE

1.4.2 Von Neumann Architecture


It is the most widely used architecture. It has one memory chip which
stores both instructions and data. The processor interfaces with the memory through
address and data buses to fetch instructions and data. Figure 1.4 shows the Von Neumann
architecture.

Figure 1.4: Von Neumann Architecture

1.4.3 Harvard Architecture

In this architecture, there are two separate memory blocks:

 Program memory
 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. This architecture is much more
efficient because accessing the instructions and data will be very fast. The figure 1.5 shows the
Harvard architecture.

Figure 1. 5: Harvard Architecture

Unit - I 1.16
Paavai Institutions Department of ECE

1.4.4 Super Harvard Architecture

The super Harvard Architecture (SHARC) is a slight but significant modification of


the Harvard architecture. Therefore, in SHARC, provision has been made to store some
secondary data in the program memory to balance the load on both memory blocks.

Figure 1.6: Super-Harvard Architecture

INTERRUPTS

Interrupt is a signal to the processor that some important event has occurred.

Example:

The processor does not keep on checking whether you are pressing a key on
the keyboard. Whenever a key is pressed, an interrupt goes to the processor and then the
processor reads the key pressed. 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. Then the processor loads the interrupt vector, i.e. the address at which
the ISR is lying, into the program counter. After execution of the ISR, the processor reloads
the registers and the 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.

Unit - I 1.17
Paavai Institutions Department of ECE

Type of interrupts

NMI (Non-Maskable Interrupt) - interrupt that has to be processed immediately.

An interrupt table contains the details of various interrupts such as interrupt number
(IRQ), the memory location where the ISR is stored (interrupt vector), priority of the
interrupt and the frequency with which the interrupt is likely to occur.

CISC and RISC

Processors are divided into the following categories:

CISC (Complex Instruction Set Computer)

RISC (Reduced instruction Set Computer)

MEMORY
Types: Two categories:

 Program memory
 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 microcontroller) 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, you can use external memory chips to increase the memory
capacity.

Classification of memory chips:

 Random Access Memory (RAM)


 Read-Only Memory (ROM)

 Hybrid Memory

Unit - I 1.18
Paavai Institutions Department of ECE

Random Access memory (RAM) :The memory locations can be accessed randomly. RAM is a
read-write chip as you can perform both read and write operations on it. Types:

Static RAM (SRAM) : It loses contents the moment power is switched off to the chip. Faster
and consumes less power.

Dynamic RAM (DRAM): It retains its contents for a fraction of a second even if power is
supplied continuously to the chip. DRAM has to be refreshed periodically. Cheaper and is used
in handheld computers.

Read Only Memory (ROM): ROM is used to store the firmware in embedded systems
because it retains its contents even if power is switched off.

Hybrid Memory devices

Electrically Erasable PROM (EEPROM): EEPROM is similar to EPROM but its


contents can be erased by applying electrical signal to one of the pins of the device.

Non-Volatile RAM : Non-Volatile RAM is SRAM with a battery backup. So, even if
power is switched off, the battery will ensure that the contents are not erased.

Flash Memory: It is a type of EEPROM. The memory is divided into sectors or blocks.
Typical sector size is 256 bytes to 16KB. Each sector is an erasable unit. Flash memory is
nowadays extensively used in embedded systems for storing the firmware.

CLOCK CIRCUITRY

To generate the clock signal, a crystal and oscillator are required. For some processors,
the oscillator circuitry is in-built, only external crystal has to be added to generate the clock
signal. Real Time Clock (RTC) keeps track of the date and time. All processor events are related
to the clock. The higher the clock frequency, the higher the speed of the processor. Different
processors cannot be compared based on clock speed alone. One processor may take one clock
cycle for executing an instruction, whereas another processor may take 16 clock cycles to
execute the same instruction.

Unit - I 1.19
Paavai Institutions Department of ECE

Watchdog Timer/ Reset circuitry

Due to some software or hardware error, a need may arise to reset the processor. Most
of the embedded systems do not have a reset button. The watchdog timer does the resetting. A
timer is set to a large value and it is decremented slowly. If the timer value reaches zero, the
processor is reset through a reset-signal. If a reset button is provided in an embedded system,
on pressing the button, a reset signal is sent to the processor. The processor sends a periodic
signal to the reset circuit indicating that it is healthy. If the reset circuitry does not receive this
signal, then the processor is reset.

Chip Select

The processor must be able to uniquely identify a peripheral to communicate with it.
The processor performs this identification using a signal called Chip Select (CS). The chip select
signal is available to all the peripherals connected to the bus.

Input/output (I/O) devices:

Can be of two types.

Programmed I/O : The processor sends the data to the device on its own.

Interrupt-Driven I/O: The processor is interrupted by an interrupted by an interrupt signal


and the ISR is executed. ISR transfers the data from the input device to the memory or
memory to output device.

Dynamic Memory Access (DMA)

DMA facilitates transfer of data between the input/output device and the memory
directly without the intervention of the processor.DMA controller takes the control of the
buses and transfers data between the I/O device and the memory

Unit - I 1.20
Paavai Institutions Department of ECE

Figure 1.7: Dynamic Memory Access

Sensors and Transducers:

Embedded systems need to convert real life information into equivalent electrical signals. This
is done using sensors and transducers.

Temperature sensors : Converts the temperature into an equivalent electrical voltage the
output of the sensor is a signal whose voltage level is proportional to the temperature.

Applications: measurement of temperature in air-conditioners, boilers, coffins etc.

Examples; AD22100, AD22103

Light sensors: Converts the light intensity into an equivalent electrical voltage. The output
of the sensor is a signal whose voltage levels proportional to the light incident on the sensor.
The light is sensed through a photodiode and an in-built amplifier amplifies the voltage level.
Applications: Ambient light sensors are included in many laptops and cell phones to
sense the environment lighting conditions, allowing for adjustment of the screen’s backlight
to comfortable levels for the viewer.

Examples: Texas Advanced Optical Solutions (TAOSTSL250R).

Accelerometer : Converts the acceleration into voltage.

The voltage is proportional to the acceleration of a vehicle.


Applications: used for machinery health monitoring of rotating equipment such as pumps,
fans, rollers, compressors and cooling towers.

Examples: ADXL 150/250

Unit - I 1.21
Paavai Institutions Department of ECE

Pressure sensors: Converts the pressure level to voltage level.


Applications: used in blood pressure equipment and to measure altitude of aircraft, ocean depth
etc.

Examples: MPXA 6115A

Video camera and monitor: Video camera converts the real life image or scenery into
electrical signal. This electrical signal is converted back to the image on a monitor.

Bandwidth.

The bandwidth of a signal is the highest significant frequency component present in the
signal. For instance, voice signals have a bandwidth of 4 KHz, i.e. the frequency components
above 4 KHz are insignificant. The analog signal can be converted into digital format in two
stages:

 Sampling
 Quantization.

In sampling, the amplitude levels of the signal are measured at regular intervals. In
quantization, the sampled value is converted into a number.

Nyquist theorem: A signal of bandwidth B has to be sampled with a minimum sampling rate
of 2B so that the signal can be reconstructed without any distortion.

Light Emitting Diodes (LEDs): Widely used output devices.

Applications: used for status display as well as for indications of visual alarms for such
events as supply failure.

Liquid Crystal Display (LCD):

Used to display the status information or to display prompts to the user. TFT (Thin Film
Transistor) displays provide very high resolution display. Another innovation is 3-dimensional
displays in which two LCDs are used to give the 3-dimensional effect. Another type is
Organic light Emitting Diode (OLED) display in which any organic light-emitting polymer is
placed between anode and cathode.

Unit - I 1.22
Paavai Institutions Department of ECE

Serial Peripheral interface (SPI):

Peripheral devices such as memory chips, potentiometers, ADCs and DACs, Real-time clocks
etc. are provided with SPI interface so that they can be interfaced to the processor.
The processor generates the clock and the peripheral uses the clock to synchronize its
acquisition of the data. SPI uses 4 types of signals for interfacing peripherals to the processor
as shown in the figure 1.8.

1. Master Out Slave in (MOSI)


2. Master In Slave Out MISO)
3.Serial Clock (SLCK)
4. Chip Select (CS) for the peripheral.

Figure 1.8: Serial Peripheral Interface


Inter-Integrated Circuit (I2C) bus

Figure 1.9: Inter-Integrated Circuit bus

Unit - I 1.23
Paavai Institutions Department of ECE

The bus is bi-directional and synchronous to a common clock. Micro-controllers with


in-builtI2 C are available with data rates of 100 Kbps (standard mode) and 400 Kbps (fast
mode) are supported. I2C consists of two lines- Serial Clock (SCL) and Serial Data (SDA).
Both lines remain high when not in use. A device using the bus drives the line low. Each
device has a unique address of 7-bits or 10-bits. If 7 bits are used, 128 devices can be connected
to the bus.

 A device can act as a master or slave.


 Transmitting device is the master.

 Receiving device is the slave.

 The same line is used for master transmission and slave response.

 I2C bus is a multi-master bus, more than one device can act as master.

Debug port: Debugging a processor based board is very difficult.

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 and is like a synchronous serial interface.

The standard IEEE 1149.1a-1993 (Standard Test Access Port and Boundary Scan
Architecture) gives the details of the protocols used in JTAG port.

JTAG port consists of 4 signals.

 Test Data Input (TDI)


 Test Data Output (TDO)

 Test Mode Select (TMS)

 Test Clock (TCK)

JTAG port can also be used to download the software onto the embedded system.

Unit - I 1.24
Paavai Institutions Department of ECE

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
 Infrared
 Ethernet
 Wireless interface based on IEEE 802.11 Wireless LAN standard.
 Bluetooth radio interface

Power supply unit

An embedded system operates either through 230 V main supply or through a battery DC-DC
converters convert an unregulated voltage to a constant DC voltage. Two types of DC-DC
converters used in embedded systems.

Linear regulators:

 Need less number of components.


 The output is less than the input voltage.

 Cost is less.

 Low noise.

 Less efficient and wastes more power.

Example: IC LM78xx.

Switching regulators:

 More efficient with less power wastage.

Unit - I 1.25
Paavai Institutions Department of ECE

 More number of components.

 More noisy.

 Occupy more space.

Example: maxim’s MAX 603, 604, 1615, 724 etc

Reducing the power consumption is very important. Some important points are: Use low
power devices. Processors and peripherals such as UART, memory devices to be put into
low power mode when they are not in use. If the hardware contains lot of ICs such as gates,
flip flops etc., the component count can be reduced using PLDs or FPGAs.

1.5 SOFTWARE ARCHITECTURE


The software in an embedded system consists of an operating system and the
application software.

The operating system is optional. If it is not present, you need to write your own
software routines to access the hardware. As embedded systems are constrained for memory,
we cannot use an operating system such as Windows or Unix on them.

Services provided by an operating system: A piece of software is used for the user to interact
with the hardware. This software is the operating system. When the computer is switched on,
first the OS is loaded into the main memory (RAM). When we invoke an application, say,
word processing software, this application is loaded into the RAM.

An OS has to do the following functions:

 Process/Task management
 Memory management

 Input/ Output management including managing the file system.

 Providing services to the applications.

Unit - I 1.26
Paavai Institutions Department of ECE

Providing a user interface so that the user need not be concerned about the underlying

hardware details.

Based on the capabilities, operating systems are divided into different categories:

Single-tasking OS versus Multi-tasking OS: Single-tasking OS, only one task is carried out at

a time. Ex: MS DOS In Multi-tasking OS, the CPU is shared by all the tasks. Multiple task can

be run simultaneously. Ex: Windows, Unix.

Single-user OS versus Multi-user OS: In Single-user OS, only one user can use the system at a

time. Ex: Windows, MS DOS In multi-user system, multiple users can share the system

simultaneously. Ex: Unix

Command-driven OS versus GUI based OS: Operating system working on commands are

said to be command-driven OS.

Ex: MS DOS The OS that can provide a GUI such as in Windows operating systems and
give instructions through mouse clicks. This is the GUI driven OS.
The embedded systems have special requirements as described below:

 Multi-tasking with time constraints


 Small footprint
 Support diskless systems
 Portability
 Scalability
 Reliability

Support for standard API: to achieve portability, IEEE standardized the API called
Portable Operating System Interface (POSIX).

Unit - I 1.27
Paavai Institutions Department of ECE

Architecture of Embedded operating system

The embedded operating systems have to manage the tasks and to make the tasks
communicate with one another.

Key points to develop the embedded software:

1. Identify the task and assigning priorities to each other.

2. Identifying the time - critical tasks.

3. Scheduling the task to complete the entire task to meet its dead line.

4. Strategy for inter-task communication.

5. Keeping track of the time.

Activities of Embedded operating system

Task: The Work done y an embedded system is divided into number of task. Each task
competes for the CPU time independently.

Task scheduling: A mechanism for deciding which task will get the CPU time next has to be
worked out.

Context switching: The CPU interrupts the lowest priority task while the highest priority task
has to run. CPU save the lowest priority task in the stack and execute the highest priority is
called Context switching.

Mutual Exclusion: Resources shared by two or more task is called shared resources (serial
port or printer). Two are more tasks access a shared resources without corrupting the data is
called mutual exclusion.

Inter task communication: Tasks may write some data to a file and another task has to read
that data. This mechanism is known as inter task communication.

Memory Management: The memory of an embedded system is to share by number of tasks.


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 task has to run and the task which is to be wait.

Unit - I 1.28
Paavai Institutions Department of ECE

1.5.1 Software Architecture of an Embedded System

Software in embedded system is divided into system software and Application


software. The API (Application programming interface) is used by the developers to
write the application software.API provides the function call to access the operating system
services:

Figure 1.10 Software architecture of an Embedded System

1. Kernel

The heart of a real-time OS (and the heart of every OS, for that matter) is the kernel. A kernel
is the central core of an operating system, and it takes care of all the OS jobs:

1. Booting

2. Task Scheduling

3. Standard Function Libraries

Unit - I 1.29
Paavai Institutions Department of ECE

• In an embedded system, there is rarely enough memory (if any) to maintain a large
function library. If functions are going to be included, they must be small, and important.
• In an embedded system, frequently the kernel will boot the system; initialize the ports and
the global data items.
• It will start the scheduler and instantiate any hardware timers that need to be started. After
all that, the Kernel basically gets dumped out of memory (except for the library functions, if
any), and the scheduler will start running the child tasks.

2. Device Manager
The I/O device is used to send/receive data from the embedded system. The OS manages
the I/O devices through interrupts and device drivers. Device drivers provide necessary
interface between the application and the hardware.

3. Communication protocol software


The embedded system has communicate interfaces such as Ethernet, USB etc, the upper
layer protocol such as TCP/IP stack need to be integrated with the OS.

4. Libraries
The OS have some C/C++ library files in object code, which can be used through the API
calls.

5. File system
Most of the embedded systems do not have a secondary storage. In such cases ROM is used
to store the program. A small file system can be developed on Flash Memory. Some
embedded system may use a secondary storage just foe booting. (Internet Kiosk may use a
CDROM for initial boot up)

Unit - I 1.30
Paavai Institutions Department of ECE

1.6 COMMUNICATION SOFTWARE

Communication software is used to provide remote access to systems and exchange


files and messages in text, audio and/or video formats between different computers or
user IDs. This includes terminal emulators, file transfer programs, chat and instant messaging
programs, as well as similar functionality integrated within MUDs

TCP/IP

TCP/IP Model is a four-layered structure resting on a common hardware platform. It


was initially developed for DARPA and sometimes called DARPA model. TCP/IP
model has standards that are defined and described in Request for Comment (RFC)
documents. The layers are as following and as in the figure

Figure 1.11: Layers and protocol of TCP/IP model


Physical layer
This layer defines the characteristics of transmission such as data rate and signal
encoding scheme.

Unit - I 1.31
Paavai Institutions Department of ECE

Data link layer


It is used to manage the link. Establishing a link, transferring the data from the upper layers,
and disconnecting the link. In LAN, the data link layer is divided into 2 sub layers: MAC
(Medium Access control) sub layer and LLC (Logical link control) sub layer.

.Internet Layer

This layer is responsible for addressing, packaging, and routing functions. It allows
communication across networks of the same and different types and carries out translations to
deal with dissimilar data addressing schemes. The core protocols of the Internet layer are IP,
ARP, ICMP, and IGMP.
• The Internet Protocol (IP) is a routable protocol responsible for IP addressing, routing, and
the fragmentation and reassembly of packets.
• The Address Resolution Protocol (ARP) is responsible for the resolution of the Internet
layer address to the Network Interface layer address such as a hardware address.
• The Internet Control Message Protocol (ICMP) is responsible for providing diagnostic
functions and reporting errors due to the unsuccessful delivery of IP packets.

Transport Layer

• The Transport layer (also known as the Host-to-Host Transport layer) irresponsible
for providing the Application layer with session and datagram communication services.
• The core protocols of the Transport layer are Transmission Control Protocol (TCP) and
the User Datagram Protocol (UDP).
• One of these two protocols are used by the application layer process, the choice depends on
the application's transmission reliability requirements.
The mechanisms used by the Transport layer to determine whether data has been
correctly delivered are:

• Acknowledgement responses

• Sequencing

• Flow control

Unit - I 1.32
Paavai Institutions Department of ECE

The Transport layer facilitates end-to-end data transfer. It supports multiple


operations simultaneously. The layer is implemented by two protocols: the Transmission
Control Protocol (TCP) and the User Datagram Protocol (UDP). TCP uses packets called
segments, while UDP Uses packets called datagrams. Both TCP and UDP are
encapsulated inside Internet layer datagrams for transmission to the next node.

The Transport layer facilitates two types of communication:

• Connection-oriented (TCP) - A connection must be established at the Transport layer of


both systems before the application can transmit any data.

• Connectionless (UDP) - All systems do not need to establish a connection with the
recipient prior to data exchange. TCP is a more reliable form of data exchange than UDP.

TCP and UDP

• TCP is a reliable, connection-oriented protocol that provides error checking and flow
control through a virtual link that it establishes and finally terminates. TCP is responsible
for the establishment of a TCP connection (TCP handshake), the sequencing and
acknowledgment of packets sent, and the recovery of packets lost during transmission.

• UDP is an unreliable, connectionless protocol that provides data transport with lower
network traffic overheads than TCP. UDP is used when the amount of data to be transferred is
small (such as the data that would fit into a single packet), or when the overhead of
establishing a TCP connection is not desired or when the applications or upper layer
protocols provide reliable delivery. UDP does not error check or offer any flow control;
this is left to the application process.

Application Layer

The Application layer provides applications the ability to access the services of the other
layers and defines the protocols that applications use to exchange data. There are many
Application layer protocols and new protocols are always being developed.

The most widely-known Application layer protocols are those used for the exchange of
user information:

Unit - I 1.33
Paavai Institutions Department of ECE

• The Hypertext Transfer Protocol (HTTP) is used to transfer files that make up the Web
pages of the World Wide Web.

• The File Transfer Protocol (FTP) is used for interactive file transfer.

• The Simple Mail Transfer Protocol (SMTP) is used for the transfer of mail messages and
attachments.

• Telnet, a terminal emulation protocol, is used for logging on remotely to network hosts.
Additionally, the following Application layers protocols help facilitate the use and
management of TCP/IP networks:

• The Domain Name System (DNS) is used to resolve a host name to an IP address.

• The Routing Information Protocol (RIP) is a routing protocol that routers use to
exchange routing information.

• The Simple Network Management Protocol (SNMP) is used between a network


management console and network devices (routers, bridges, intelligent hubs) to collect and
exchange network management information.

Examples of Application layer interfaces for TCP/IP applications are Sockets and
NetBIOS. Sockets provide a standard application programming interface (API) for inter
process communication via TCP/IP. NetBIOS is an industry standard interface for
accessing protocol services such as sessions, datagram’s, and name resolution.

1.7 PROCESS OF GENERATING EXECUTABLE IMAGE

The procedure for creating and executing the application on a desk top computer is given by

• Create the source file.

• Create the executable file.

• Give the command for execution.

• The process is loaded into the RAM by the loader.

• Loader transfer the control to the process and the process executes.

Unit - I 1.34
Paavai Institutions Department of ECE

The process of creating an executable image is given as in the figure 1. 12.

Figure 1.12: Process of creating an executable image

The source file written in C and C++ are converted into object files using the compiler and
the assembly language of the target processor are converted by the assembler. Each binary file
consists of binary code and program data, The binary files have the following information:

1. Name of the source file

2. Size of the file, binary information and data

3. Processor specific binary instructions and data.

4. Symbol table that contains details of variables, their data types and address.
5. Debugging information if the compilation is done with the debug option.
The object file has two standard format

1. COFF (Common object file format): The object files generated by different compilers can

be combined together.

2. Executable and Linking File: The object file is divided into various sections. The linker
combines various object files including the library files used in t he program and creates
an executable image or a singe relocatable object file or a shared library file. The linker
command file contains a number of instructions called linker commands are linker
directives. It gives the information how to combine the object files and the exact locations in
the memory. It also describes the memory map of the embedded system.

Unit - I 1.35
Paavai Institutions Department of ECE

The output of the linker is an executable image that can be transferred to the memory chip of
the target hardware. Executable image is also referred as bootable image, runtime image, and
target image.

Cross Platform Development

The processor on the host system and the target system will b e different, a number of
cross platform development tools are required. These tools are

1. Cross compiler

2. Cross assembler

3. Cross linker

4. Cross debugger

5. Cross compiled libraries

6. Operating system dependent libraries and headers for target processor.

The executable image is transferred to the target hardware by

1. Programming the EEPROM

2. Down loading the image through a communication interface which requires a file
transfer utility and an embedded loader or an embedded monitor on the embedded system.

3. Down loading through JTAG port.

An embedded monitor is used to do the hardware initialization and run the initial boot up code.
The process of cross-platform development is shown as a flowchart in figure

Unit - I 1.36
Paavai Institutions Department of ECE

Figure 1.13: Process of cross-platform Development

Embedded Loader:
• Embedded loader is a program that resides in the ROM. This program gets executed
when power is switched ON.

• It initializes the hardware and execute the boot image.


• The executable image is transferred to the RAM and then the software can be transferred
to EEPROM or FLASH.

Embedded Monitor:
It can be accessed from the host to download the image and debug the software by
setting breakpoints when the power is ON.

Boot sequence:

An embedded system can be booted in one of the following ways

i. Execute from ROM using RAM for data.

Unit - I 1.37
Paavai Institutions Department of ECE

ii. Execute from RAM after loading the image from RAM. iii. Execute from RAM after
downloading from the host.
The process for executing from ROM using RAM for data is

i. On power- on, the CPU always executes the code contained at a specific address in ROM.
ii. The Reset vector is a jump instruction to another portion of the memory where the code that
resides to boot the system is stored.
iii. The executable image contains the data sections. Data sections are both readable and
writable and they are copied to RAM. Stack space is reserved in RAM.

iv. CPU’s Stack pointer is set to point to the beginning of the stack.

BOOT sequence
Once the boot sequence is completed, the target software will start running. It performs
the following:

1. Initialization of the hardware: CPU, Memory, Bus interfaces and devices are initialized.
2.Initialization of the operating system: operating system Kernel objects such as
task, semaphores, memory management services are initialized and stacks for each task are
created.

3. Initialization of the application code.

Figure 1. 14: BOOT Sequence

Unit - I 1.38
Paavai Institutions Department of ECE

1.8 DEVELOPMENT / TESTING TOOLS

1.8.1 Hardware Development And Testing Tools

Digital multiplexer: To measure voltages, currents, and to check the continuity of connections
on the circuits.

Logic Analyzer: Logic analyzer is used to check the timings of the signals. Oscilloscope: To
analyze the time domain waveforms. Storage oscilloscopes can store a portion of the
waveform.

Spectrum Analyzer: To analyze the frequency domain waveforms.

1.8.2 Software Development/ Testing Tools Operating System Development Suite

It contains the API calls to access the OS services. It may run either on a window system
or a unix / linux system.
Cross platform Development tool
Cross compiler generates the object code of the given processor for the source code developed
in a high level language C, C++. The cross compilers provide an integrated Development
Environment (IDE) with editor, compiler, debugger.
ROM Emulator
ROM emulator emulates ROM in the RAM. It can be used to debug the software by setting
the breakpoint in the memory.
EPROM programmer
If the hardware board does not support in- circuit programming and only have the EPROM
for program memory, an EPROM programmer and EPROM eraser are required.
ISS
Instruction set simulator creates a virtual version of the processor on PC.
In-circuit Emulator
ICE is a device that emulates a CPU. Plug in ICE in the place of CPU on the target board on
one side and the other side it is connected host through RS232 or USB port.

Unit - I 1.39
Paavai Institutions Department of ECE

Figure 1.15: In-Circuit Emulator

The debugger is run on the host to debug the code while it is running on the target
hardware. ICE is processor- specific is costly but it is an excellent tool.

Unit - I 1.40
Paavai Institutions Department of ECE

QUESTION BANK
PART-A (2 Marks)

1. Define Embedded Systems and Give any two applications of embedded systems.
2. What is Hard real time system and Soft real time systems.
3. What is the difference between the Harvard model from the Von Neumann model
architecture?
4. Define Real time Operating System.
5. Why do you need a cross compiler.
6. What is the need for standard device driver?
7. Define System On Chip (SoC) with example.
8. Define the following terms 1.Linker 2.Loader 3.Emulator 4.firmware
9. Write short notes about Context Switching.
10. Write short notes on API.
11. What is stand-alone embedded systems and mobile devices
12. What is the need of watchdog timer.
13. What is cross-platform development? List the tools required for cross-platform
development.
14. Differentiate embedded system and desktop system.
15. Differentiate CISC and RISC.
16. Differentiate SPI and I2C.
17. Give the devices name for following embedded system components 1.Sensors and
transducers.2.ADC and DAC.3.Power Supply.
18. Write short notes on Debug Port.
19. Write the advantages of real time clock.
20. Define the following terms 1.Embedded loader 2.Embedded monitor 3.In-circuit
Emulator(ICE)

Unit - I 1.41
Paavai Institutions Department of ECE

PART-B (16Marks)
1. Explain the Hardware architecture of an embedded system.
2. Explain the Software architecture of an embedded system.
3. Explain the TCP/IP protocol suite and also explain application layer protocols in
TCP/IP protocol Stack.
4. Explain how to create an executable image and how to develop in cross-platform and
also explain boot sequence.
5. Explain What are the requirements needed for embedded system design .
6. Explain in detail of recent trends in embedded systems.
7. Write short notes development/testing tools

Unit - I 1.42
Paavai Institutions Department of ECE

Unit - I 1.43

You might also like