Es Notes Unit 1
Es Notes Unit 1
Es Notes Unit 1
UNIT – 1
Definition :
• An embedded system is an electronic/electro-mechanical system designed to perform a
specific function and is combination of both hardware and firmware (software). The
program instructions written for embedded systems are referred to as firmware, and are
stored in Read-Only-Memory or Flash memory.
• Every ES is unique, and the hardware as well as software is highly specialized to the
application domain. Embedded systems are designed to do some specific task, rather than
be a general purpose computer for multiple tasks.
2. Reliability
Embedded Systems have to work for thousands of hours without break. This calls for very
reliable hardware and software.
For ex., if the embedded system comes to a halt state due to hardware error, the system
should reset itself without any human intervention.
Reliability is a measure of how much percentage we can rely upon the proper functioning
of the system without failures.
3. Reactive
Embedded systems are in constant interaction with the real world through sensors and
user-defined input devices.
Any changes happening in the Real world (called as an Event) are captured by the
sensors/input devices and the control algorithm reacts in a designed manner to bring the
controlled output variables to the desired level.
Hence the Embedded systems are referred as Reactive systems, as they produce changes
in output in response to the changes in the input.
4. Real-Time Performance
Real Time System operation means the timing behavior of the system should be
deterministic, meaning that the system should respond to requests in a known amount of
time.
In real-time embedded systems, a specific job has to be completed within a specific time.
They have time constrains and they have to work against some deadlines. (Examples of Real
Time Systems – Missiles, flight control systems, nuclear plane safety system)
A Real Time System should not miss any deadlines for tasks (or) operations. For example,
in a nuclear plant safety system, missing a deadline may cause loss of life / damage to
property. Hence in hard real-time embedded systems which are subject to very strict
deadlines for performing specific tasks, the timing analysis is of great importance.
1. Small-scale:
Simple applications where the performance requirements are not time-critical.
Built around low performance and low cost 8 or 16 bit μp/μc.
Example: an electronic toy
2. Medium-scale:
Slightly complex in hardware and firmware requirement.
Built around medium performance and low cost 16 or 32 bit μp/μc.
Usually contain embedded operating system (RTOS) for functioning
Examples: Industrial applications, Monitoring & Control of Manufacturing Equipment
3. Large-scale / complex:
Highly complex hardware & firmware.
Built around 32 or 64 bit RISC μp/μc (or) PLDs (or) SoC (or) multi-core processors.
Response is time-critical.
Examples: Mission critical applications like Aircraft operating and control
Systems, Electric power systems.
4. Mobile devices
Mobile devices such as mobile phones, Personal Digital Assistants(PDA), smart phones
etc. are a special category of embedded systems.
Mobile devices are capable of supporting high data rate services in addition to the
voice services. Accessing internet services such as e-mail, World Wide Web and so on
can be done while a person is on the move. They are capable of handling multimedia
applications.
The limitation of mobile devices – small size, lack of good user interfaces such as full-
fledged keyboard and display, memory constrains, battery life time etc.
program instructions written for embedded systems are referred to as firmware, and are
stored in Read-Only-Memory or Flash memory.
• Every ES is unique, and the hardware as well as software is highly specialized to the
application domain.
• The embedded systems are used in various domains. Within the domain itself, according
to the application, they may have different functionalities. Each embedded system is
designed to serve the purpose of any one or a combination of the following tasks:
For many years, the primary mode of development for real-time embedded software has been the
"host/target" approach. In this approach, the software development is done on host system and it
is to be executed on target system.
Host:
It is a computer system on which all the programming tools run, where the embedded
software is developed, i.e., writing and editing a program, compiling, linking and
debugging are done on Host system.
Compiler, assembler, linker, locator, debugger are used
Unit testing on host system ensures software is working properly
It is also referred as work station
It is programming centric
The host system consists of
High performance processor with cache,
Large RAM and large memory on disk
ROMBIOS (read only memory basic input-output system)
Keyboard and Display monitor
Network connection
Program development kit for a high level language program (or) IDE
Host processor compiler and cross compiler
Cross assembler
Target:
After completion of programming work in host system, it is moved from host system to
target system, i.e., the developed software is loaded in customer target system
It is customer centric.
The target system consists of
Microcontroller/ processors
Communication interfaces
Small amount of memory elements RAM,ROM and
Other integrated on chip peripherals such as timers, ADC, RTC etc…
Every ES is unique, and the hardware as well as software is highly specialized to the
application domain. Embedded systems are designed to do some specific task, rather than be a
general purpose computer for multiple tasks.
Embedded systems are basically designed to regulate a physical variable (or) to manipulate
the state of some devices by sending some signals to the actuators or devices connected to the
output ports of the system, in response to the input signals provided by the end users or
sensors which are connected to the input ports. Hence the embedded systems can be viewed as
a reactive system.
Sensors à are used to sense/detect the changes in the input variables and convert into
electrical signals for any measurements.
The sensors are connected to the input port.
Actuators à are used to converts electrical signals into corresponding physical action.
The actuators are connected at the output port
System core :
Embedded systems are domain and application specific and are built around a central core.
The core of the embedded system falls into any of the following categories:
(i) Microprocessors
(ii) Microcontrollers
(iii)Digital Signal Processors
(iv) Application Specific Integrated Circuits (ASIC)
(v) Complex Programmable Logic Devices (CPLD’s)
(vi) Field Programmable Gate Arrays (FPGA)
Memory :
The memory of the system is responsible for holding the control algorithm and other
important configuration details. Memory for implementing the code may be present on the
processor or may be implemented as a separate chip interfacing the processor. In a controller
based embedded system, the controller may contain internal memory for storing code.
Memory for the program: Non-volatile (Read-only memory, ROM), meaning that it retains its
contents when power is removed.
Memory for data: Known as random-access memory (RAM) and usually volatile.
Non-volatile memory for data : This is used to store data whose value must be retained when
power is removed. It is used to store constant data like serial
number for identification, network addresses etc
Address and data buses: To link these subsystems to transfer data and code.
Clock: To keep the whole system synchronized. It may be generated internally or obtained from
a crystal or external source; modern MCUs offer considerable choice of clocks.
Input and output ports: To provide digital communication with the outside world.
Common peripherals:
Timers:
Most microcontrollers have at least one timer because of the wide range of functions that
they provide. They provide a regular “tick” that can be used to schedule tasks in a
program. Timers are essential to almost any embedded application
Generate fixed-period events
Periodic wakeup
Count edges
Generate delays
Measures time intervals
Replacing delay loops with timer calls allows CPU to sleep, consuming less power
Watchdog timer :
It is an electronic timer, used to detect and recover from computer malfunctions.
The Watchdog Timer (WDT) restarts the system on occurrence of a software problem (or)
if a selected time interval expires. This is a safety feature, which resets the processor if the
program becomes stuck in an infinite loop.
Interrupt Controller :
It manages the interrupts which are generated by external devices connected to the
microcontroller (or) Interrupts requested by most peripheral modules in the core of the
MCU, such as Timer, ADC, Serial UART.. etc.
Analog-to-Digital Converter:
This is very common because so many quantities in the real world vary continuously.
Digital-to-Analog Converter:
This is much less common, because most analog outputs can be simulated using PWM.
An important exception used to be sound, but even here, the use of PWM is growing in
what are called Class-D amplifiers.
processing such as speech coding, speech recognition..etc make use of special kind of digital signal
processors supplied by manufacturers like Analog Devices, Texas Instruments,..etc
Embedded systems are domain and application specific and are built around a central core.
The core of the embedded system falls into any of the following categories:
1. Microprocessors
2. Microcontrollers
3. Digital Signal Processors
4. Application Specific Integrated Circuits (ASIC)
5. Complex Programmable Logic Devices(CPLD’s)
6. Field Programmable Gate Arrays (FPGA)
Microprocessors
Microcontrollers
A microcontroller is an integrated chip that contains CPU, data and program memory
( RAM and ROM), special and general purpose registers, Timers, Interrupt control unit
and dedicated I/O ports.
Since a microcontroller contains all the necessary functional blocks for independent
working, they found greater place in embedded domain.
Microcontrollers are application oriented and used in domain-specific applications.
DSPs are powerful special purpose 8/16/32 bit processors, designed specifically to meet
the computational demands and power constraints of today’s embedded audio, video,
signal processing and communication applications.
DSPs implement algorithms in hardware which speeds up the execution whereas general
purpose processor implement the algorithm in software and the speed of execution
depends primarily on the clock for the processors.
DSP performs large amount of real-time calculations like FFT(Fast Fourier Transform),
DFT(Discrete Fourier Transform), Convolution, SOP(Sum of Products) calculation etc.
Audio video signal processing, telecommunication and multimedia applications are typical
examples where DSPs are employed.
As a single chip, ASIC consumes a very small area in the total system and thereby helps in
the design of smaller systems with high capabilities.
The Program memory /ROM are used to store the firmware in embedded systems.
ROM can only be used to read from, but cannot be written upon.
These memory devices are NON-VOLATILE, which retains its contents even if power is
switched off.
The ROM can store instructions which are required to start computer when power is given
to the computer. This operation is referred to as bootstrap.
The ROM memory is not only used in the computers but also in other electronic devices
like controllers, micro ovens, washing machines etc.
Types of ROM :
(i) Masked ROM (MROM) :
Masked ROM makes use of the hardwired technology for storing data.
It is factory programmed by masking and metallization process at the time of
production itself, according to the data provided by the end user.
The advantage of this is low cost for high volume production. It is good for storing the
embedded firmware for low cost embedded devices.
The limitation with MROM is the inability to modify the device firmware against
firmware updates.
(ii) Programmable Read Only Memory (PROM):
Unlike Masked ROM, Programmable ROM is not pre-programmed by the
manufacturer. The end-user is the responsible for programming these devices.
The Programmable ROM can be modified only once by the user and hence it is called
as One Time Programmable (OTP) memory.
The PROM is manufactured with series of fuses. The chip is programmed by the
programmer wherein some fuses are burnt. The open fuses are read as logic “1”, while
the burned fuses are read as logic “0”.
The limitation of PROM Not useful for development purpose, as the code is subject
to continuous change during the development phase.
(iii) Erasable Programmable Read Only Memory (EPROM) :
The Erasable Programmable ROM is one of the special types of memory modules that
can be programmed any number of times to correct the errors. It can retain its contents
until exposed to ultraviolet light.
The ultraviolet light erases its contents and making it possible to re-program the
memory. To write and erase the EPROM memory chip, we need a special device called
EPROM programmer.
Even though the EPROM chip is flexible in terms of re-programmability, it needs to be
taken out of the circuit board and put in a UV eraser device for 20 to 30 min. So it is a
tedious and time consuming process.
Types of RAM
The Static Random Access Memory module is a type of RAM that retains the data bits in its
memory as long as power is being supplied.
Static RAM stores data in the form of Voltage and they are made up of flip-flops.
In typical implementation, SRAM cell (bit) is realized using 6- MOSFETs. Four of the
transistors are used for building the latch (flip-flop) part of the memory cell and two
transistors are used for controlling the access to the storage cell during read and write
operations.
The Dynamic Random Access Memory is a type of RAM module that stores each bit of
data within a separate capacitor. This is an efficient way to store the data in memory
because it requires less physical space to store the data.
Dynamic RAM stores data in the form of charge.
They are made up of a MOSFET and a capacitor. Each DRAM cell is referred to as a bit.
When the DRAM cell holds a value at active state ‘1’, the charge is at high state. When the
DRAM cell holds a value at inactive state ‘0’, the charge is below a certain level.
The capacitors in DRAM need to be constantly recharged to keep their charge. This is the
reason why DRAM requires more power.
S.No
SRAM DRAM
.
SRAM cell (bit) is realized using DAM cell is realized using a MOSFET
1
6- MOSFETs and a Capacitor
DRAM stores data in the form of
2 SRAM stores data in the form of Voltage
charge
The DRAM need to be refreshed
The SRAM does not need to be refreshed
3 periodically to maintain the charge in
periodically.
the capacitor
4 Consumes less power Consumes more power
The SRAM provides faster access to the Slow in operations due to refresh
5
data requirements
The construction of SRAM is complex due
DRAM is simple to design and
6 to the usage of a large number of
implement
transistors
7 Low storage capacity ( Less dense) High storage capacity
The main steps involved in the design process of embedded systems are as follows:
3. Select the OS
If OS needed we can select,
Real time OS (such as RTLinux,Vx Works, VRTX, pSOS, QNX etc.).
Non-real time OS (such as Windows CE, embedded Windows XP etc).
Embedded Code is typically written in Assembly language, C or C++, but various high-level
programming languages, such as Python and JavaScript, are now also in common use to target
microcontrollers and embedded systems. Ada is used in some military and aviation projects.
Assembly language:
In the early days of embedded systems, programming is performed using assembly
language. This remains an option, but now assembly is used only when it is absolutely
essential.
The assembly language uses 2 or 3 letter ‘mnemonics’ to represent each low-
level machine instruction (or) Op-code.
Assembly code is converted into executable machine code by a program referred to as
an assembler.
To write an assembly language, the programmer must know the instruction set,
architectural features and register set of the processor.
C - programming language:
Many microprocessors and microcontrollers can be programmed in C, and a number of
C cross-compilers exist for that purpose.
C is perhaps the most frequently used language for new embedded system
development.
High level language statements are converted into executable machine codes by
a program referred to as Compiler
Ada :
It was originally developed by the department of defense for real-time operating
systems and embedded systems.
Ada was designed with multiprocessor support and strong compile-time checks to
ensure the quality and integrity of developed system.
Python :
Python compilers are available for some popular microcontrollers.
Pyastra compiles for all Microchip PIC12, PIC14 and PIC16 microcontrollers.
PyMite compiles for "any device in the AVR family that has at least 64 KB program
memory and 4 KB RAM". PyMite also targets (some) ARM microcontrollers.
Notice that these embedded Python compilers typically can only compile a subset of
the Python language for these devices
Others :
Some extremely well-known languages, such as C++ and Java, are rarely used in
embedded systems with advanced microcontrollers, because C++ and Java compilers are
simply unavailable for popular microcontrollers.
.
Programming tools :
Editor
Compiler
Assembler
Linker
Debugger
Locator
Loader
Editor :
It is used for writing assembly mnemonics (or) high level programs like C/C++
It allows entry, addition, deletion, insert, modification of programs.
Creates a source file that stores the edited file.
Compiler :
Compiler is a software program that converts a source code from high level language
(human readable language) into low level language (e.g., assembly language, object code,
or machine code) to create an executable program.
This object file is a file that contains a set of machine-language instructions (Op-codes)
and data resulting from language translation process.
Machine-language instructions are specific to a particular processor.
The compiler that runs on a computer platform and produces code for that same
computer platform is called as native compiler (or) Host compiler.
A Compiler that runs on one computer platform and produces code for another
computer platform is called as Cross-compiler.
Assembler :
An assembler is a software program that converts the source code of assembly language
into machine language. It performs one-to-one translation from assembly language
(Mnemonics) to equivalent machine-language (Op-codes)
An assembler that runs on host but produces binary codes appropriate for some other
target is called Cross-assembler.
Linker :
A linker is a program that takes one (or) more object files generated by compilers and
combines them into a single executable file.
Source code may be contained in more than one file. Hence, it must be combined. The
linker creates a re-locatable version of the program.
Debugger :
Locator :
A Locator is a tool that performs the conversion from re-locatable program to executable
binary image.
The locator assigns physical memory addresses to code and data sections within the
re-locatable program.
The locator produces a binary memory image that can be loaded into the target ROM.
In contrast, on general purpose computers, the operating system assigns the addresses at
load time.
Loader :
It is one of the essential stages in the process of starting a program, as it places programs
into memory and prepares them for execution.
Once loading is complete, the operating system starts the program by passing control to the
loaded program code.