Requirements of Embedded Systems
·
Reliability: Embedded systems have to work without
the need of resetting or rebooting, typical of many desktop systems.(When did u
reboot your referigerator the last time ? ☺) This calls for very reliable
hardware and software. If for example, an embedded system comes to a halt
because of a hardware error, it should be able to reboot itself without the
need of human intervention. Certainly, reliability is critical in any system,
but we are used to rebooting our systems once in a while, thanks to the
unpredictability of operating systems.
·
Cost-effectiveness: If an embedded sytem is designed for a
very special purpose, such as for use in a Nuclear plant, cost may not be the
issue. However, if the embedded system is for the masss market as those in CD
Players, toys, etc.,cost is a major consideration. Hence one common
configuration for embedded systems is the system on a
chip, an application-specific integrated circuit, for which the
CPU was purchased as intellectual property to add to the IC's design. System-on-a-chip (SoC or SOC) is an idea of integrating all components of a computer
system into a single chip. It may contain digital, analog, mixed-signal, and often
radio-frequency functions – all on one chip to reduce hardware components and
the cost.
·
Low
power consumption:
Batteries, rather than a main supply power many embedded systems. In such
cases, power consumption should be minimized to avoid draining of batteries.
Hardware designers must address the issue- by reducing the number of hardware
components, or by designing the processor to revert to low power or ‘Sleep’
mode when there is no function to perform.
·
Efficient
use of processing power:
A wide variety of processors with varying processing powers are available to
embedded systems. Developers must keep processing power, memory, and cost in
mind, while choosing the processor. Processor is the term generally used to
refer to a micro-controller, a micro processor, or a Digital Signal Processor
used in embedded system. The processing power requirement is specified in
million instructions per second (MIPS). The MIPS requirement for the
application has to be estimated first and given this estimate, developer can
choose the processor. With the availability of many processors with the same
capabilities, choosing a processor has become a tough task now-a-days.
·
Efficient use of memory: Most embedded sytems do not have secondary storage such
as hard disk. The memory chips available on the embedded system are only ROM to
hold the program and RAM to hold the data. Depending on the functionality, the
developer may determie the program size and data size. Cost of memory is going
down, but one dollar can make a difference, particularly with regard to
consumer items. As most embedded systems do not have secondary storage, FLASH
memory is used to store the program, including OS. Micro-controllers and DSPs
come with onboard generally is low and the execution generally is fast.
·
Appropriate
execution time: The embedded systems in which very strict
deadlines are followed are called realtime systems. In real-time embedded
systems, certain tasks must be completed in specified time. It is said that: “A
late answer is a wrong answer”. Hence special operating systems called
real-time operating systems are used. An operation within a larger dynamic
system is called a real-time
operation if the combined reaction- and operation-time of a task is shorter
than the maximum delay that is allowed, in view of circumstances outside the
operation. The task must also occur before the system to be controlled becomes
unstable. A real-time operation is not necessarily fast, as slow systems can
allow slow real-time operations. There is often confusion between fast real
time systems & slow real time systems. Typically, any system that works
with subsecond response times can be classified as ‘fast’ real time systems.
The other systems that can take a second or more time to respond can be
classified as ‘slow’ realtime systems. This applies for all types of
dynamically changing systems. A typical example could be a computer-controlled
braking system in a car. If the driver can stop a car before it hits a wall,
the operation was in real-time; if the car hits the wall it was not. The
realtime systems may be hard realtime or soft realtime.
1.
Hard
Realtime Systems: A
realtime system where missing a deadline could cause drastic results that could
lead to loss of life and/or property is called a hard realtime system. Eg: Fighter jets, biomedical instruments.
2.
Soft
Realtime Systems: A
realtime system where a few missed deadlines may not cause any significant
inconvenience to the user is known as a soft realtime system.
Eg: Television, Music players.
For ensuring the realtime operation of embedded
systems, watchdog timers are used. A watchdog
timer is a computer hardware timing device that triggers a system reset
if the main program, due to some fault condition, such as a hang, neglects to
regularly service the watchdog (writing a 'service pulse' to it). The intention
is to bring the system back from the hung state into normal operation. Watchdog
timers may be more complex, attempting to save debug information onto a
persistent medium; i.e. information useful for debugging the problem that
caused the fault. In this case a second, simpler, watchdog timer ensures that
if the first watchdog timer does not report completion of its information
saving task within a certain amount of time, the system will reset with or
without the information saved. Watchdog timers may also trigger control systems
to move into a safety state, such as turning off motors, high-voltage
electrical outputs, and other potentially dangerous subsystems until the fault is
cleared.
Hardware Architecture of Embedded
Systems
An embedded system is built around a
processor. CPU does the necessary computations based on the input it receives
from various external devices. The functionality of the CPU in an embedded system is same as
the functionality of the CPU in a desktop, except that the CPU in an embedded
system is less powerful. The processor has limited internal memory, and if this
internal memory is not sufficient for a given application, external memory
devices are used. There are many different CPU
architectures used in embedded designs such as ARM, MIPS, Coldfire/68k,
PowerPC,
X86, PIC, 8051, etc. This in
contrast to the desktop computer
market, which is limited to just a few competing architectures, mainly the Intel/AMD x86, and the Apple/Motorola/IBM PowerPC,
used in the Apple Macintosh. With the growing acceptance of
Java in this field, there is a tendency to
even further eliminate the dependency on specific CPU/hardware (and OS)
requirements. The electronics usually uses either a microprocessor or a
microcontroller. Some large or old systems use general-purpose mainframe
computers or minicomputers. Standard PC/104 is a typical base for embedded and
ruggedized system design.
The hardware also uses any
components that facilitates the user – application interaction such as keypad,
LCD display,etc. The figure below shows a general architecture of embedded
systems.
Figure: (Refer next page)
FUNCTIONAL
BLOCKS OF HARDWARE ARCHITECTURE
·
Processor: The processor used in embedded systems
can be of 3 types-
1)
Microcontroller
2) Microprocessor
3) Digital Signal Processor
·
Memory: Memory used in embedded systems can be
either external or internal. Internal memory of a processor is very limited.
For small applications, if this memory is sufficient,there is no need to use
external memory.
·
Latches
and buffers: Processor
based systems need to drive external devices such as LED displays, relays, etc.
The processor does not interact directly with these devices. Flipflop logic
chips are used to drive the external devices. these chips hold the prcessor o/p
data to be sent to external devices
·
Crystal: CPU needs a clock source and a crystal
oscillator generates the clock. We need to choose the crystal based on clock
frequency of the processor.
·
Reset
circuitary: It is
generally built into the hardware to take care of any unforseen problems. This
circuit handles software hangups, power failures, etc. periodically; the
processor sends a status signal to this circuit. If this signal isnot received,
it is an indication that something is wrong with the processor, which is then
reset by this circuit.
·
Chip
select logic circuit: In
the processor based system, many digital chips share the common bus. To carry
out the transaction with particular chip, processor must be able to uniquely
identify the chip. The processor performs this identification through a signal
called chip select signal.The chip select signal is available to all devices
connected to bus and it is of either high or low logic level. we can generate
chip select signals through a decoder/demultiplexer chip.
·
ADC
and DAC: Embedded systems receive their input from
external world in form of analog signals. The processor however takes only
digital signals, a series of ones and zeroes, represented by voltage levels.
Therefore an analog signal has to be converted to digital signal. This
conversion is done using an ADC and the reverse action of conversion of digital
signal to analog is done by a DAC.
Applications of Embedded Systems
Embedded systems are
extensively used in control systems in manufacturing industry, such as chemical
plants, food plants, etc. Most of the measurement instruments are embedded
systems. Domotics is the
application of computer and robot technologies to domestic appliances. It is a
portmanteau word formed from domus (Latin, meaning house) and robotics.
There is an increasing trend to network home appliances together, and combine
their controls and key functions. For instance, energy distribution can be
managed more evenly so that when the washing machine is on, the oven can get
into a delayed start mode, or vice versa. To understand the applications of
embedded systems, the applications are divided into following market segments:
·
Consumer
Electronics
·
Control
systems
·
Industrial
automation
·
Biomedical
systems
·
Field
instrumentation
·
Data
Communication
·
Networked
information appliances
·
Telecommunication
·
Wireless
Communication
Programming of Embedded Systems
The code for embedded system application can be written in
one of the following languages
·
Assembly language
·
C &
C++ language
·
Java
When should I use assembly language?
If you are using
different processor for each new application then assembly language is the most
suitable because you will not need compiler since Assembly language has one to
one correspondence with the instruction
set of the Processor. Assembly language is preferred over C because of
execution time requirement.
When should I use C language?
If
we are using the same processor and similar hardware configuration for each new
embedded application then we should use C language for software development.
We will create compiler for C
language for the target system and then use C language so that the coding time
in future projects may be minimized. We can also use processor specific C
compiler available from different vendors instead of writing your own compiler.
E.g. Turbo C, ANSI C, Borland C
Why Java is so popular today?
Java develops
embedded system software which is platform independent i.e. the code generated
(Called Bytecode ) can be run on any processor in the world. Java provides following features
because of which we should use java in embedded system application development.
- Portability
- Software reuse
- Simplicity
- Safety and security
- Availability of developers
- Longevity
Advantages & Disadvantages of Embedded Systems
As the saying goes “Every coin has two
sides”, similarly embedded system is not without its pros and cons.
Advantages
·
Automation in almost all fields is possible.
·
Bright career options for embedded system
programmers.
·
Reliable & stable
·
Runs on wide range of processors
Disadvantages
·
Designing an Embedded System is very complex.
·
Real-time performance can be obtained through
the addition of real-time software modules but an error in code can impact the
entire system's reliability by crashing the operating system.
·
Debugging & testing is tough because of
absence of i/p & o/p devices.
Conclusion
References
URLs
Books
Embedded
Realtime systems Programming – Sriram Iyer
Programming
for Embedded Systems – Vikas Gupta & Others
No comments:
Post a Comment