You are on page 1of 5

1. What is an embedded system?

There are many definitions for this but the best way to
define it is to describe it in terms of what it is not and with examples
of how it is used.
An embedded system is a microprocessor-based system
that is built to control a function or range of functions and is not
designed to be programmed by the end user in the same way that
a PC is. Yes, a user can make choices concerning functionality but
cannot change the functionality of the system by adding/replacing software. With a PC, this is exactly what a user can do: one
minute the PC is a word processor and the next it s a games
machine simply by changing the software. An embedded system
is designed to perform one particular task albeit with choices and
different options. The last point is important because it differentiates itself from the world of the PC where the end user does
reprogram it whenever a different software package is bought and
run. However, PCs have provided an easily accessible source of
hardware and software for embedded systems and it should be no
surprise that they form the basis of many embedded systems. To
reflect this, a very detailed design example is included at the end
of this book that uses a PC in this way to build a sophisticated data
logging system for a race car.
If this need to control the physical world is so great, what is
so special about embedded systems that has led to the widespread
use of microprocessors? There are several major reasons and these
have increased over the years as the technology has progressed
and developed.
Embedded Systems or Electronics systems
that include an application Specific
Integrated Circuit or a Microcontroller to
perform a specific dedicated application.
Embedded System is pre-programmed to do
a specific function while a general purpose
system could be used to run any program of
your choice. Further, the Embedded
Processor Is only one component of the
electronic system of which it is the part. It is
cooperating with the rest of the components
to achieve the overall function

2. Inside the embedded system


Processor
The main criteria for the processor is: can it provide the
processing power needed to perform the tasks within the system?
This seems obvious but it frequently occurs that the tasks are either
underestimated in terms of their size and/or complexity or that
creeping elegance expands the specification to beyond the processor s capability.
In many cases, these types of problems are compounded by
the performance measurement used to judge the processor. Bench-

marks may not be representative of the type of work that the


system is doing. They may execute completely out of cache memory
and thus give an artificially high performance level which the final
system cannot meet because its software does not fit in the cache.
The software overheads for high level languages, operating systems and interrupts may be higher than expected. These are all
issues that can turn a paper design into failed reality.
While processor performance is essential and forms the first
gating criterion, there are others such as cost
this should be
system cost and not just the cost of the processor in isolation,
power consumption, software tools and component availability
and so on. These topics are discussed in more detail in Chapter 2.
Memory
Memory is an important part of any embedded system
design and is heavily influenced by the software design, and in
turn may dictate how the software is designed, written and
developed. These topics will be addressed in more detail later on
in this book. As a way of introduction, memory essentially performs two functions within an embedded system:
It provides storage for the software that it will run
At a minimum, this will take the form of some non-volatile
memory that retains its contents when power is removed.
This can be on-chip read only memory (ROM) or external
EPROM. The software that it contains might be the complete program or an initialisation routine that obtains the
full software from another source within or outside of the
system. This initialisation routine is often referred to as a
bootstrap program or routine. PC boards that have embedded processors will often start up using software stored in
an onboard EPROM and then wait for the full software to be
downloaded from the PC across the PC expansion bus
It provides storage for data such as program variables and
intermediate results, status information and any other data
that might be created throughout the operation
Software needs some memory to store variables and to
manage software structures such as stacks. The amount of
memory that is needed for variables is frequently less than
that needed for the actual program. With RAM being more
expensive than ROM and non-volatile, many embedded
systems and in particular, microcontrollers, have small
amounts of RAM compared to the ROM that is available for
the program. As a result, the software that is written for
such systems often has to be written to minimise RAM
usage so that it will fit within the memory resources placed
upon the design. This will often mean the use of compilers
that produce ROMable code that does not rely on being
resident in RAM to execute. This is discussed in more detail
in Chapter 3.
Peripherals
An embedded system has to communicate with the outside
world and this is done by peripherals. Input peripherals are
usually associated with sensors that measure the external environment and thus effectively control the output operations that the
embedded system performs. In this way, an embedded system can
be modelled on a three-stage pipeline where data and information

input into the first stage of the pipeline, the second stage processes
it before the third stage outputs data.
If this model is then applied to a motor controller, the inputs
would be the motor s actual speed and power consumption, and
the speed required by the operator. The outputs would be a pulse
width modulated waveform that controls the power to the motor
and hence the speed and an output to a control panel showing the
current speed. The middle stage would be the software that
processed the inputs and adjusts the outputs to achieve the required engine speed. The main types of peripherals that are used
include:
Binary outputs
These are simple external pins whose logic state can be
controlled by the processor to either be a logic zero (off) or
a logic one (on). They can be used individually or grouped
together to create parallel ports where a group of bits can be
input or output simultaneously.
Serial outputs
These are interfaces that send or receive data using one or
two pins in a serial mode. They are less complex to connect
but are more complicated to program. A parallel port looks
very similar to a memory location and is easier to visualise
and thus use. A serial port has to have data loaded into a
register and then a start command issued. The data may
also be augmented with additional information as required
by the protocol.
Analogue values
While processors operate in the digital domain, the natural
world does not and tends to orientate to analogue values.
As a result, interfaces between the system and the external
environment need to be converted from analogue to digital
and vice versa.
Displays
Displays are becoming important and can vary from simple
LEDs and seven segment displays to small alpha-numeric
LCD panels.
Time derived outputs
Timers and counters are probably the most commonly used
functions within an embedded system.

Software
The software components within an embedded system
often encompasses the technology that adds value to the system
and defines what it does and how well it does it. The software can
consist of several different components:
Initialisation and configuration
Operating system or run-time environment
The applications software itself
Error handling
Debug and maintenance support.

Algorithms
Algorithms are the key constituents of the software that
makes an embedded system behave in the way that it does. They
can range from mathematical processing through to models of the

external environment which are used to interpret information


from external sensors and thus generate control signals. With the
digital technology in use today such as MP3 and DVD players, the
algorithms that digitally encode the analogue data are defined by
standards bodies.
While this standardisation could mean that the importance
of selecting an algorithm is far less than it might be thought, the
reality is far different. The focus on getting the right implementation is important since, for example, it may allow the same function to be executed on cheaper hardware. As most embedded
systems are designed to be commercially successful, this selection
process is very important. Defining and implementing the correct
algorithm is a critical operation and is described through several
examples in this book

3. Microcontroller
Microcontrollers can be considered as self-contained systems with a processor, memory and peripherals so that in many
cases all that is needed to use them within an embedded system is
to add software. The processors are usually based on 8 bit stackbased architectures such as the MC6800 family. There are 4 bit
versions available such as the National COP series which further
reduce the processing power and reduce cost even further. These
are limited in their functionality but their low cost has meant that
they are used in many obscure applications. Microcontrollers are
usually available in several forms:
Devices for prototyping or low volume production runs
These devices use non-volatile memory to allow the software to be downloaded and returned in the device. UV
erasable EPROM used to be the favourite but EEPROM is
also gaining favour. Some microcontrollers used a special
package with a piggyback socket on top of the package to
allow an external EPROM to be plugged in for prototyping.
This memory technology replaces the ROM on the chip
allowing software to be downloaded and debugged. The
device can be reprogrammed as needed until the software
reaches its final release version.
The use of non-volatile memory also makes these devices
suitable for low volume production runs or where the
software may need customisation and thus preventing
moving to a ROMed version.
These devices are sometimes referred to as umbrella devices with a single device capable of providing prototyping
support for a range of other controllers in the family.
Devices for low to medium volume production runs
In the mid-1980s, a derivative of the prototype device
appeared on the market called the one time programmable
or OTP. These devices use EPROM instead of the ROM but
instead of using the ceramic package with a window to
allow the device to be erased, it was packaged in a cheaper
plastic pack and thus was only capable of programming a
single time
hence the name. These devices are cheaper
than the prototype versions but still have the programming
disadvantage. However, their lower cost has made them a
suitable alternative to producing a ROM device. For low to
medium production quantities, they are cost effective and

offer the ability to customise software as necessary.


A Microcontoller is a device where CPU
and limited associated resources such as
memory, I/O are integration on the same
single chip. Because of this integrated on a
single chip, the reliability of a microcontroller is far superior to an equivalent
system designed using CPU, memory, I/O
interface chip on a PCB. But it has
limitation in terms of program memory,
data memory and I/O interfaces.
Manufacturers of I/O controllers (Intel,
Motorola, Atmel, Scenix, SGS Thomson,
Hitachi, Zilog etc).
Provide facilities for expansion of resource
requirement for memory. But it is always
advisable to use the Microcontroller in its
single chip mode of operation rather than in
the expanded mode. These Microcontrollers
are available in sizes of 4 bit, 8 bit, 16 bit
and 32 bit from various manufacturers.

You might also like