You are on page 1of 68

CHAPTER 1

Introduction to embedded systems

Why Study Embedded System,

Contrast between embedded systems and other computer


systems,

Role and purpose of embedded systems

Embedded Micro controllers


What is embedded system

An embedded system is a combination of computer
hardware and software, and perhaps

additional mechanical or other parts, designed to
perform a specific f unction.

A good example is the microwave oven.

Some embedded systems include an operating
system, but many are so specialized that the entire
logic can be implemented as a single program.

This is in direct contrast to the personal computer in
the family room. It too is comprised of computer
hardware and software and mechanical components
(disk drives, for example).

However, a personal computer is general purpose

As shipped, a general-purpose computer is a
blank slate; the manufacturer does not know
what the customer will do with it.
Why embedded systems are
different?

A good place to start is to try to enumerate the
differences between your desktop PC and the
typical embedded system.
1. Embedded systems are dedicated to specific
tasks, whereas PCs are generic computing
platforms.

What will happen if we try to use an embedded
system designed for one application for another
application?

2. Embedded systems are usually cost sensitive.

3. embedded systems have real-time
Cont..

If a task is time critical, it must take place
within a set window of time, or the function
controlled by that task fails.

Examples: Controlling the flight

A time-sensitive task can die gracefully. If the
task should take, for example, 4.5ms but takes,
on average, 6.3ms, then perhaps the ink jet
printer will print two pages per minute instead of
the design goal of three pages per minute.
Cont...
4. if an embedded system is using an operating system
at all, it is most likely using a real-time operating
system (RTOS)
5. The implications of software failure is much more
severe in embedded systems than in desktop
systems.

most embedded systems typically contain some
mechanism, such as a watchdog timer, to bring it back
to life if the software loses control.

6. Embedded systems often have power constraints.

7. Embedded systems often must operate under
extreme environmental conditions.
CONTRAST BETWEEN EMBEDDED SYSTEMS AND
OTHER COMPUTER SYSTEMS,


An embedded product uses a microprocessor (or
microcontroller) to do one task and one task only.

There is only one application software that is typically
burned into ROM.

A PC, in contrast with the embedded system, can be
used for any number of applications:

 It has RAM memory and an operating system that
loads a variety of applications into RAM and lets the
CPU run Them

 A PC contains or is connected to various embedded
products.
ROLE AND PURPOSE OF
EMBEDDED SYSTEMS
 Home

Home security systems,garage door openers,
answering machines, remote controls, video games,
micro wave oven, musical instruments, lighting control,
camera, toys, exercise equipment, etc.

 Office

Telephones, computers, security systems, fax
machines, copier, laser printer, colour printer, etc. .
fig1
Fig 2.
Cont..

Embedded systems are more limited in hardware
and/or software functionality than a personal computer
(PC).

In terms of hardware limitations, this can mean
limitations in processing performance, power
consumption, memory, hardware functionality, and so
forth.

In software, this typically means limitations relative to a
PC—

fewer applications,

no operating system (OS) or a limited OS, and so on..

A PC contains or is connected to various embedded
Products. Each one peripheral has a micro controller
Micro controller VS General purpose Micro
processors

Fig 3
Where are embedded system used?
 Signal processing systems

Real-time video, DVD players, Medical
equipment.

 Distributed control

Network routers, switches, firewalls, mass
transit systems,

 “Small” systems

Mobile phones, pagers, home appliances, toys,
smartcards, sensors, pc keyboard &
mouse,digital cameras etc…


Cell phone working principle
Embedded Operating and Software

Principal role: „Not transformation of data but
interaction with physical world‟

Acquires properties of physical world:

Takes time

 Consumes power

 Does not terminate (unless it fails)

An operating system (OS) is an optional part of an
embedded device‟s system software stack, meaning
that not all embedded systems have one.

Why?

An embedded operating system performs a very
There is a big difference between a standard and an
embedded operating system.

A standard operating system creates an environment
where a user and the computer may interact with one
another to perform a huge variety of tasks.

in contrast to an embedded system, which will only
perform one type of task, and it will often do it without any
user intervention.

While a normal operating system is installed on a multi-
use computer, an embedded system operates other
electronic devices. An embedded operating system is
typically
Cont..
Generally, in order for an embedded system to warrant an
actual operating system it needs at least one of
two things: complexity or interactivity.

A complex system needs to take in information from
multiple sources, perform multiple types of operations or
output different information based on its situation.

The other requirement for an actual operating system is
interactivity.

If a user has to interact with the operation, especially if
the operation is time dependent, it will usually have an
embedded operating system.

any time a user needs to interact with that data a more
complex system is needed.
Embedded OS

Office-style OSes
 PalmOS
 WindowsCE
RTOSes
 VxWorks
 QNX
Linux
Mobile
Etc...
Embedded Software

To be continued..
Embedded Software

Embedded system software is a piece of software that is
embedded in hardware or non-pc device.

It is written specifically for the particular hardware that it
runs on and usually has processing and memory
constraints because of the device‟s limited computing
capabilities.

Examples of embedded software include those found in:

dedicated GPS devices,

 factory robots, some calculators, and

 modern smart watches.

Embedded software is similar to firmware, as they
usually serve the same function.
Cont..

however, firmware is a special type of
embedded software that is written in non-
volatile memory, which cannot easily be
modified- hence the name “firm”- and is used
primarily for running or booting up the device.

In contrast, embedded software is used for the
overall operation of the device.
Embedded software development

Software development is one component of the whole
embedded systems development process.

Embedded systems development from the view point of
software is presented as the classical V-model
according to Easterbrook(2001) and the terminology of
ISO/IEC 12207.

What is V-model and why it is used rather than any other
SDLC models?

Debuggers for modern embedded systems are much
more vital than for general-purpose programming, due to
the more limited accessibility of the embedded CPU
(often no file system, limited display and keyboard, etc.).
Cont..

They must be able to show several concurrent threads of
control, as they interact with each other and with the
underlying hardware.

They must also be able to do so by minimally disrupting
normal operation of the system, since it often has to work
in real time, interacting with its environment.

Both hardware and operating system support are
essential, and the main RTOS vendors, such as
WindRiver, all provide powerful interactive multitask
debuggers.

Hardware support takes the form of breakpoint and watch
point registers, which can be set to interrupt the CPU
when a given address is used for fetching or data
Cont..

The software components of an embedded system are
generally implemented using the traditional design–
code–test–debug cycle,

which is often represented using a V-shaped diagram
to illustrate the fact that every implementation level of
a complex software system must have a
corresponding verification level.

V-Model

Not all components of embedded systems need to be
designed from scratch.

Instead, there are standard components that can be
reused.

These components comprise knowledge from earlier
design efforts and constitute intellectual property
(IP).

IP reuse is one key technique in coping with the
increasing complexity of designs.

The term “IP reuse” frequently denotes the reuse of
hardware.

However, reusing hardware is not enough.
Sangiovanni- Vincentelli pointed out, that

Therefore, the platform- based design methodology
advocated by Sangiovanni- Vincentelli [Sangiovanni-
Vincentelli, 2002] comprises the reuse of hardware and
software IP.

Standard software components that can be reused include

system software components such as:

embedded operating systems (OS) and

 middleware.

The last term denotes software that provides an
intermediate layer between the OS and application
software.
Cont..

We include libraries for communication as a special
case of middleware. Such libraries extend the basic
communication facilities provided by operating
systems.

Also, we consider real-time databases to be a second
class of middleware.

ES software reuse architecture platform
The Difference Between Application software and
Embedded Software

Most consumers are familiar with application software
that provide functionality on a computer.

Embedded software is often less visible, but no less
complicated.

Unlike application software, embedded software has
fixed hardware requirements and capabilities, addition
of third-party hard ware or software is strictly
controlled.

Embedded software needs to include all needed
device drivers at manufacturing time, and

 The device drivers are written for the specific
Embedded Micro controllers


Structure of a basic computer system,

CPU families used in micro controllers,

Basic I/O devices and technologies,

Interrupts and Memories
Internal Organization of Computer

CPU (Central Processing Unit)

 Execute information stored in memory

I/O (Input/output) devices

 Provide a means of communicating with CPU

Memory

 RAM (Random Access Memory) – temporary storage
of programs that computer is running.

The CPU is connected to memory and I/O through
strips of wire called a bus Carries information from
place to place

Address bus
Cont..

CPU structure

1. Address bus

 For a device (memory or I/O) to be recognized
by the CPU, it must be assigned an address

 The address assigned to a given device must
be unique.

 The CPU puts the address on the address
bus, and the decoding circuitry finds the device

2. Data bus

 The CPU either gets data from the device or
sends data to it.

 The more data buses available, the better the
CPU.
Cont..

The more address buses available, the larger the number
of devices that can be addressed

The number of locations with which a CPU can
communicate is always equal to 2 x , where x is the
address lines, regardless of the size of the data bus.

 e.g. a CPU with 24 address lines and 16 data lines can
provide a total of 224 or 16M bytes of addressable
memory.

 Each location can have a maximum of 1 byte of

data, since all general-purpose CPUs are byte
addressable.

 The address bus is unidirectional
CPU’s Relation to RAM and ROM

For the CPU to process information, the data must be
stored in RAM or ROM, which are referred to as primary
memory.

CPU gets information to be processed:

 first from RAM (or ROM).

 if it is not there, then seeks it from a mass storage
device, called secondary memory, and transfers the
information to RAM.
Inside CPU
Registers, ALU PC and Instruction Decoder.

Registers

The CPU uses registers to store information
temporarily

 Values to be processed

 Address of value to be fetched from memory.

In general, the more and bigger the registers, the
better the CPU.

 Registers can be 8-, 16-, 32-, or 64-bit

 The disadvantage of more and bigger registers is the
increased cost of such a CPU
ALU (arithmetic/logic unit)

Performs arithmetic functions such as add, subtract,
multiply, and divide, and logic functions such as AND,
OR, and NOT.

Program counter

Points to the address of the next instruction to be
executed.

 As each instruction is executed, the program counter
is incremented to point to the address of the next
instruction to be executed.

Instruction decoder

Interprets the instruction fetched into the CPU.

CPU Families Used in Microcontroller

System-on-a-chip (SoC) processors are especially
attractive for embedded systems.

The SoC processor is comprised of a CPU core with
built-in peripheral modules, such as:

 a programmable general-purpose timer,

 programmable interrupt controller,

 DMA controller, and possibly Ethernet interfaces.

Such a self-contained design allows SOC embedded
processors to be used to build a variety of embedded
applications without needing additional external
peripheral devices, again reducing the overall cost and
size of the final product.
1. DSP:-

Typically a Texas Instruments- C28x Series, C54xx or
C64xx or

Analog Devices SHARC or TigerSHARC,

Motorola 5600xx.

for example, the embedded digital signal processor
(DSP) used in cell phones.

Real-time voice communication involves digital
signal processing and cannot tolerate delays.

why DSPs, instead of general-purpose
processors, are chosen for cell phone designs.

.
2. Media processor:-

TI DSP TMS320DM310 or Trimedia Phillips Media
Processor 1x00 series for Processing Streaming and
Data Networks and Image, Video and Speech: PNX
1300, PNX 1500 (2002).

3. GPP or ASIP core(s):-

GPP or ASIP Integrated into either an Application
Specific Integrated Circuit (ASIC), or a Very Large
Scale Integrated Circuit (VLSI) circuit or a FPGA core
integrated with processor unit(s) in a VLSI (ASIC) chip.
4. Application Specific System Processor
(ASSP)

Typically a set top box processor or mpeg
video-processor or network application
processor or mobile application processor.

Single purpose processor or Application
Specific Instruction processor:

a) Floating point Coprocessor

b) CCD Pixel coprocessor and image

c) codec in digital camera

d) Graphic processor

e) Speech processor

f) Adaptive filtering processor
6. Multi core processors or multiprocessor system
using GPPs.

Examples:

 Multiprocessor system for Real time
performance in a video-conference system,

 Embedded firewall cum router,

 High-end cell phone,
Basic I/O devices and Technologies


Input/output (I/O) components on a board are
responsible for moving information into and out of the
board to I/O devices connected to an embedded
system.

Board I/O can consist of input components, which
only bring information from an input device to the
master processor; output components, which take
information out of the master processor to an output
device; or components that do both.

I/O Architecture

Any electromechanical system, both embedded and
non- embedded, whether conventional or
unconventional, can be connected to an embedded
board and act as an I/O device.

Output devices receive data from board I/O
components and display that data in some manner,
such as printing it to paper, to a disk, or to a screen or
a blinking LED light for a person to see.

An input device such as a mouse, keyboard, or
remote control transmits data to board I/O
components.

Some I/O devices can do both, such as a networking
device that can transmit data to and from the internet,
for instance.

An I/O device can be connected to an embedded board
via a wired or wireless data transmission medium such
as a keyboard or remote control, or can be located on
the embedded board itself, such as an LED.

Because I/O devices are so varied, ranging from simple
circuits to other complete embedded systems, board I/O
components can fall under one or more of several
different categories, the most common including:

1. Networking and communications I/O (the physical
layer of the OSI model.

2. Input (keyboard, mouse, remote control, vocal, etc.)
3. Graphics and output I/O (touch screen, CRT, printers,
LEDs, etc.)

4. Storage I/O (optical disk controllers, magnetic disk
5. Debugging I/O (JTAG, serial port, parallel port, etc.)
6. Real time and miscellaneous I/O (timers/counters,
analog-to-digital converters and digital-to-analog
converters, key switches, and so on.

In short, board I/O can be as simple as a basic
electronic circuit that connects the master processor
directly to an I/O device, such as a master processor’s
I/O port to a clock or LED located on the board, to
more complex I/O subsystem circuitry that includes
several units,

I/O hardware is typically made up of all or some
combination of six main logical units:

1. The transmission medium, a wireless or wired
medium connecting the I/O device to the embedded
board for data communication and exchanges.

2. Communication port, what the transmission medium
connects to on the board or, if a wireless system, what
receives the wireless signal.

3. A communication interface, which manages data
communication between master CPU and I/O device
or I/O controller, and is responsible for encoding data
and decoding data to and from the logical level of an
IC and the logical level of the I/O port. This interface
can be integrated into the master processor, or can be
a separate IC

4. An I/O controller, a slave processor that
manages the I/O device

5. I/O buses, the connection between the board
I/O and master processor.

6. The master processor integrated I/O

Managing Data: Serial vs. Parallel I/OParallel
I/O

Managing Data: Serial vs. Parallel
I/O

Serial I/O:-

To transfer to a device located many meters
away, the serial method is used

The data is sent one bit at a time.

Board I/O that can transmit and receive data in
serial is made up of components in which data
(characters) are stored, transferred and
received one bit at a time.

Serial I/O hardware is typically made up of
some combination of the six main logical units

Data can be transmitted between two devices in one of
three directions:

in a one-way direction(simplex),

in both directions but at separate times because they
share the same transmission line(half Duplex), and

in both directions simultaneously(Full Duplex).
Assignment I

Serail I/O: Networking and Communication
RS232. Serial synchrounous traansmission
system model.

MotoMotorola/Freescale MPC823 FADS
Board :RS-232 System Model(Both)

1. Motorola/Freescale MPC823 FADS Board:
Ethernet System Model.

2. Net Silicon ARM7 (6127001) Development
Board: Ethernet System Model.
Interfacing I/O Components

I/O hardware is made up of all or some combination of:

integrated master processor I/O,

I/O controllers, a communications interface,

a communication port,

I/O buses, and

a transmission medium.

All of these components are interfaced (connected),
and communication mechanisms implemented via
hardware, software, or both to allow for successful
integration and function.
Sample I/O Subsystem
Interfacing I/O device with
Embedded Board

For off-board I/O devices, such as keyboards, mice,
LCDs, printers, and so on, a transmission medium is
used to interconnect the I/O device to an embedded
board via a communication port.

Aside from the I/O schemes implemented on the board
(serial versus parallel), whether the medium is
wireless (Figure 19b) or wired (Figure 19a), also
impacts the overall scheme used to interface the I/O
device to the embedded board.
Interfacing I/O device and Embedded board though
Wired Transmission Media
Interfacing I/O device and Embedded board though
Wired Transmission Media
Cont..

As shown in Figure 19a, with a wired transmission
medium between the I/O device and embedded board,
it is just a matter of plugging in a cable, with the right
connector head, to the embedded board.

.This cable then transmits data over its internal
wires.

Given an I/O device, such as the remote control in
Figure 19b, transmitting data over a wireless medium,
understanding how this interfaces to the embedded
board means understanding the nature of infrared
wireless communication,

.since there are no separate ports for transmitting
data versus control signals.
Interfacing I/O Controller with
Master CPU

In a subsystem that contains an I/O controller to
manage the I/O device, the design of the interface
between the I/O controller and master CPU—via a
communications interface.

There are some requirements to do this:

1. An ability of the master CPU to initialize and monitor
the I/O Controller.

2. A way for the master processor to request I/O.

3. A way for the I/O device to contact the master CPU.

4. Some mechanism for both to exchange data.

go through it
Interrupts
An interrupt is any service request that causes the CPU to
stop its current execution stream & to execute an
instruction stream that services the interrupt.

When the CPU finishes servicing the interrupt, it returns


to the original execution stream at the point where it left
out.

Interrupt driven I/O can be used for interfacing with on


chip peripherals.

An interrupts-handling mechanism must exist in
each system to handle interrupts from various
processes in the system: for example, to
transfer data from a keyboard or a printer.

Important points regarding the interrupts and
their handling by programming are as follows:
Interrupt cont..

Interrupt cont..

Memory (Read for more detail)
Interfacing I/O Devices to the
memory,processor and OS

Exercises

How is a user I/O request transformed into a
device command and communicated to the
device?

 E.g., file read/write, mouse movement,
keyboard stroke

 How is data actually transferred to or from a
memory location?

 What is the role of the operating system?
Interfacing I/O Controller with
Master CPU

In a subsystem that contains an I/O controller to
manage the I/O device, the design of the interface
between the I/O controller and master CPU—via a
communications interface.

There are some requirements to do this:

1. An ability of the master CPU to initialize and monitor
the I/O Controller.

2. A way for the master processor to request I/O.

3. A way for the I/O device to contact the master CPU.

4. Some mechanism for both to exchange data.

go through it
Interfacing I/O Controller with
Master CPU

In a subsystem that contains an I/O controller to
manage the I/O device, the design of the interface
between the I/O controller and master CPU—via a
communications interface.

There are some requirements to do this:

1. An ability of the master CPU to initialize and monitor
the I/O Controller.

2. A way for the master processor to request I/O.

3. A way for the I/O device to contact the master CPU.

4. Some mechanism for both to exchange data.

go through it

You might also like