Chapter 1.
Introduction to Embedded system
1.1 System:
A System is a way of working, organizing or doing one or many tasks, which are performed in a system
according to a fixed plan, program or set of rules.
System is an arrangement in which all its units assemble and work together according to a plan or
program.
For example, A watch is a time-display system. Its components are its hardware, needles and battery. All
the components organize in the watch system in a certain specific way and also follow a set of rules.
1.2 Embedded System:
One of the definitions of embedded systems is as follows:
“An embedded system is a system that has embedded software in computer hardware. The system is
dedicated for either an application(s) or specific part of an application or product or a component of a
large system.”
As per Wayne wolf, embedded system loosely defined as “Any device that includes a programmable
computer but is not itself intended to be a general-purpose computer”. For example a fax machine or a
clock built from a microprocessor.
As per Todd D Morton, “Embedded systems are electronic systems that contain a microprocessor or
microcontroller, but we did not think of them as computers- the computer is hidden or embedded in
the system.”
As per Tim Winhurst, 1) “An embedded system is a system whose principle function is not
computational, but which is controlled by a computer embedded within it. The computer is likely to be a
microcontroller or microprocessor. The embedded implies that it lies inside the overall system, hidden
from view, forming an integral part of greater whole” 2) “An embedded system is a microcontroller-
based, software-driven, reliable, real-time control system, autonomous, or human or network
interactive , operating on diverse physical variables and in diverse environments and sold into a
competitive and cost-conscious market.”
Embedded systems are a combination of hardware and software where software is usually known as
firmware that is embedded into the hardware.
1.3 Characteristics of embedded systems
The main characteristic of embedded systems is that they are task-specific.
Additionally, embedded systems can include the following characteristics:
typically, consist of hardware, software and firmware;
can be embedded in a larger system to perform a specific function, as they are built for
specialized tasks within the system, not various tasks;
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
can be either microprocessor-based or microcontroller-based -- both are integrated
circuits that give the system compute power;
Performs specific tasks: Embedded systems are designed to perform specific tasks or
functions. They are optimized for the particular task they are intended to perform, which
makes them more efficient and reliable.
Low Cost: Embedded systems are typically designed to be cost-effective. This is because
they are often used in large volumes, and the cost per unit must be low to make the product
economically viable.
Time Specific: Embedded systems must operate within a specific time frame. This is
important in applications such as industrial control systems, where timing is critical for safety
and efficiency.
Low Power: Embedded systems are designed to operate with minimal power consumption.
This is important for applications where the system needs to operate for extended periods on
battery power or where power consumption needs to be minimized to reduce operating costs.
High Efficiency: Embedded systems are designed to be highly efficient in terms of
processing power, memory usage, and energy consumption. This ensures that they can
perform their specific task with maximum efficiency and reliability.
Minimal User Interface: Many embedded systems do not require a complex user interface.
They are often designed to operate autonomously or with minimal user intervention.
Highly Stable: Embedded systems are typically designed to be stable and reliable. They are
often used in applications where failure is not an option, such as in medical devices or
aviation.
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
High Reliability: Embedded systems are designed to operate reliably and consistently over
long periods. This is important in applications where downtime can be costly or dangerous.
1.4 Block diagram of embedded system
Generalized block diagram of embedded system is as follows.
In terms of hardware, a basic embedded system would consist of the following elements:
Sensors convert physical sense data into an electrical signal.
Analog-to-digital (A-D) converters change an analog electrical signal into a digital one.
Processors process digital signals and store them in memory.
Digital-to-analog (D-A) converters change the digital data from the processor into analog
data.
Actuators compare actual output to memory-stored output and choose the correct one.
The sensor reads external inputs, the converters make that input readable to the processor, and
the processor turns that information into useful output for the embedded system.
Detailed block diagram is as follow:
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
Processor: The processor is the heart of embedded system. The selection of processor is
based on the following consideration
o Instruction set
o Maximum bits of operation on single arithmetic and logical operation
o Speed
o Algorithms processing and capability
o Types of processor( microprocessor, microcontroller, digital signal processor,
application specific processor, general purpose processor)
Power source: Internal power supply is must.
Clock / oscillator Circuits: The clock ckt is used for CPU, system timers, and CPU machine
cycles clock controls the time for executing an instruction. Clock oscillator may be internal
or external .It should be highly stable.
Real time clock (RTC): It require to maintain scheduling various tasks and for real time
programming RTC also use for driving timers, counters needs in the system.
Resets Ckts and power on reset: Reset process starts executing various instructions from
the starting address. The address is set by the processor in the program counter
Memory: A system embeds either in the internal flash or ROM, PROM or in an external
flash or ROM or PROM of the microcontroller.
1.5 General purpose computer system Vs Embedded system
Category Computer Embedded device
Description combination of hardware and part of an integrated system that is formed
software resources that as a combination of computer hardware
integrate and provide various and software for a specific function
functionalities to the user.
Human Needs Human Interaction to Do not need Human Interaction to perform
Interaction perform tasks. tasks.
Types based on Analog computer, Digital Small Scale Embedded Systems, Medium
architecture computer, Hybrid computer, Scale Embedded Systems, Sophisticated or
Harvard architecture, Von Complex Embedded Systems
Neumann architecture,
Reduced instruction set
computer
Parts It has 2 parts: Hardware and It has 3 parts: Hardware, Firmware, and
Software. Software.
Tasks It can perform many tasks. It performs limited tasks.
Cost to user Expensive Lesser cost
Peripherals Peripherals such as keyboards Peripherals such as Serial Communication
and mice, displays, printers, Interfaces (SCI), Synchronous Serial
Hard disk drives, floppy disk Communication Interfaces, Universal
drives, optical disc drives, etc.
Serial Bus (USB), Multi Media Cards (SD
cards, Compact Flash), etc.
Purpose Can be reprogrammed for a Made only for a specific set of purposes.
new purpose.
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
Power Needs more operational power Needs lesser operational power than a
Consumption than Embedded Devices. Computer.
Complexity More complex devices than Less complex devices than Computers.
Embedded Devices.
Need of Computers may be installed in Embedded Devices only exist inside other
another device other devices but are self- Systems.
sufficient to exist.
Usage More Difficult when used, Easier to use than Computers.
Difficulty compared to an Embedded
System.
User Interfaces It requires more user interface It requires less to no user interface than
than Embedded Devices. Computers.
Time Computers are not time- Embedded Devices are time-specific. The
Specificity specific. They may need to tasks assigned to them need to be
perform tasks that are not performed within a specific time frame.
time-bound and take days to
perform as well.
Size Computers are usually bigger Embedded Devices are smaller in size than
with larger hardware and Computers, with limited hardware.
input-output devices attached
to them.
Developed in 1833 A.D. 1965 A.D.
Developer Charles Babbage Charles Stark Draper
Memory Computers have larger Embedded Devices need less Memory.
Requirement memory requirements due to a
lot of storage of data.
1.6 Real Time Operating systems
An operating system OS is a program that serves as a bridge between the system hardware and
the user. Furthermore, it manages all interactions between system software and hardware.
A real-time operating system (RTOS) is an OS that guarantees real-time applications a
certain capability within a specified deadline. RTOSes are designed for critical systems and
for devices like microcontrollers that are timing-specific. RTOS processing time requirements
are measured in milliseconds. Any delays in responding could have disastrous consequences.
RTOSes also commonly appear in embedded systems, which are a combination of hardware
and software designed for a specific function and may also operate within a larger system.
Often, embedded systems are used in real-time environments and use a real-time operating
system to communicate with the hardware.
RTOSes are designed to handle multiple processes at one time, ensuring that these processes
respond to events within a predictable time limit. Processing in an RTOS occurs within defined
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
time constraints and monitors the priority of tasks. An RTOS is also able to make changes to
task priority. Systems that are event-driven often switch between tasks based on priority.
Some real-time operating systems are created for special applications, while others are more
general purpose. Usually, RTOSes provide the following functionality:
multitasking, where tasks are rapidly switched between to give the impression that
multiple programs are executing concurrently;
process thread prioritization; and
a sufficient number of interrupt levels.
RTOSes are included in the following devices:
air traffic control systems;
anti-lock brakes and air bags;
cameras;
medical systems; and
PCs.
The real-time operating systems can be of 3 types –
1. Hard Real-Time Operating System: These operating systems guarantee that critical tasks
are completed within a range of time.
For example, a robot is hired to weld a car body. If the robot welds too early or too late, the
car cannot be sold, so it is a hard real-time system that requires complete car welding by the
robot hardly on time., scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.
2. Soft real-time operating system: This operating system provides some relaxation in the
time limit.
For example – Multimedia systems, digital audio systems, etc. Explicit, programmer-
defined, and controlled processes are encountered in real-time systems. A separate process is
changed by handling a single external event. The process is activated upon the occurrence of
the related event signaled by an interrupt.
Multitasking operation is accomplished by scheduling processes for execution
independently of each other. Each process is assigned a certain level of priority that
corresponds to the relative importance of the event that it services. The processor is allocated
to the highest-priority processes. This type of schedule, called, priority-based preemptive
scheduling is used by real-time systems.
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
3. Firm Real-time Operating System: RTOS of this type have to follow deadlines as well.
In spite of its small impact, missing a deadline can have unintended consequences,
including a reduction in the quality of the product. Example: Multimedia applications.
1.7 Characteristics of a real-time operating system
Real-time operating systems generally have the following characteristics:
Small footprint. Compared to general OSes, real-time operating systems are lightweight.
High performance. RTOSes are typically fast and responsive.
Determinism. Repeating inputs end in the same output.
Safety and security. Safety-critical and security standards are typically the highest
priority, as RTOSes are frequently used in critical systems.
Priority-based scheduling. Tasks that are assigned a high priority are executed first
followed by lower-priority jobs.
Timing information. RTOSes are responsible for timing and providing application
programming interface
Time Constraints: Time interval allotted for the response of the ongoing program.
Correctness: Real-time systems produce correct result within the given time interval
Concurrency: It can respond to a several number of processes at a time
Stability: Even when the load is very heavy, real-time systems respond in the time
constraint i.e. real-time systems does not delay the result of tasks even when there are
several tasks going on a same time. This brings the stability in real-time systems.
Fault tolerance: Real-time systems must be designed to tolerate and recover from faults or
errors. The system should be able to detect errors and recover from them without affecting
the system’s performance or output.
Scalability: Real-time systems must be scalable, which means that the system must be able
to handle varying workloads and increase or decrease its resources as needed.
Resource management: Real-time systems must manage their resources efficiently,
including processing power, memory, and input/output devices.
1.8 RTOS vs GPOS
Real-Time Operating System General Purpose Operating System
The RTOS always uses priority- Task scheduling in a GPOS isn't necessarily
based scheduling. based on which application or process is the
most important. Threads and processes are
often dispatched using a "fairness" policy.
The time response of the RTOS is The time response of the general-purpose
deterministic. operating system is not deterministic.
A low-priority job in an RTOS A high-priority thread in a GPOS cannot
would be pre-empted by a high- preempt a kernel call.
priority one if required, even
executing a kernel call.
The real-time operating system The GPOS does not optimize the memory
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
optimizes memory resources. resources.
The RTOS is mainly used in the GPOS is mainly used in PC, servers, tablets,
embedded system. and mobile phones.
The real-time operating system has The general-purpose operating system has no
a task deadline. task deadline.
It doesn't have large memory. It has a large memory.
GPOS code is not often modular in RTOS kernel code is intended to be scalable,
nature when it comes to allowing developers to selectively select kernel
development. objects.
RTOS is designed and developed GPOS is designed for a multi-user
for a single-user environment. environment.
Examples: FreeRTOS, Contiki Examples: Linux, Windows, IOS, etc.
source code, etc.
1.9 Microcontrollers for embedded system:
Microprocessors and microcontrollers are widely used in embedded system products. Embedded
system is controlled by its own internal microcontroller. Typically in an embedded system, the
microcontroller’s ROM is burned with a purpose for specific functions needed for the system.
A printer is an example of an embedded system which performs only one task, getting the data
and printing it.
While, Pentium based PC (x86PC) , which can be used for any number of applications such as
word processor, print server, bank teller terminal, network server etc.
An x86 PC contains or connected with several embedded products such as keyboard, mouse,
printer sound card, disk controller and so on.
X86 PC based embedded application:
Although microcontrollers are the preferred choice for many embeedeed system, sometimes a
microcontroller is inadequate for the task. For this reason, in recent years many manufractures of
general purpose microprocessors as given below have targeted their microprocessors for high
end of the embedded market. Manufactures are:
Intel
Freescale Semiconductor( formerly Motorola)
AMD( Advanced Micro Devices, Inc.)_
Power PC (Joint venture between IBM and Freescale)
Arm (Advanced RISC Machine)
Critical needs of embedded systems are:
To decrease power consumption and space: Achieved by using integrating more
functions into the CPU chip.
All the embedded processor based on the x86 and Power PC 6xx has low power consumption in
addition to some form of I/O, COM port, and ROM all on a single chip.
In high end embedded system , more and more functions integrated on the single chip and let
designer decides which feature to use.
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
Currently, because of Linux and Windows standardization, many embedded system use x86
PCs. Using x86 PC, for the high end embedded applications not only saves money but also
shortens development time because a vast library of software already exists for both
platforms.
1.9.1 Choosing criteria for microcontrollers
There are five major 8-bit microcontrollers.
1. Freescale Semiconductor’s ( Formerly Motorola): 68HC08/68HC11
2. Intel’s 8051
3. Atmel’s AVR
4. Zilog’s Z8
5. PIC from Microchip Technology.
Each of above microcontrollers have unique instruction set and register set, therefore they are not
compatible with each other.
There are also 16- bit and 32-bit microcontrollers made by various chip makers available.
Three criteria in choosing microcontrollers are as follows:
1) Meeting the computing needs of the task at hand efficiently and cost affectively
2) Availability of software and hardware development tools
3) Wide availability and reliable sources of microcontroller.
1) Meeting the computing needs of the task at hand efficiently and cost affectively: For
meeting this needs, first we see whether an 8-bit, 16-bit, or 32-bit controllers are sufficient or
not. Along with this other category for computing needs are as follows:
a) Speed: Highest speed supported by microcontroller.
b) Packaging: Comes in DIP (Dual in line package) or QFP( Quad Flat package) or some
other packaging format.
This important in terms of speed, assembling, and prototyping the end product.
c) The amount of RAM and ROM on chip
d) The numbers of I/O pins and timers on the chip
e) Ease of upgrade to higher-performance or lower power consumption versions
f) Costs per units: this is important in terms of the final cost of the product.
2) Availability of software and hardware development tools: Availability of development
tool such as, assembler, a debugger, a code efficient C language compiler, an emulator,
technical support, and both in-house and outside expertise.
3) Wide availability and reliable sources of microcontroller: This criterion helps in
choosing microcontroller by its ready availability in needed quantities both now and in the
future. For example, 8051 family has the largest number of diversified suppliers.
1.10 The overview of AVR family
AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip
Technology in 2016. These are modified Harvard architecture 8-bit RISC single-chip
microcontrollers. AVR was one of the first microcontroller families to use on-chip flash
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
memory for program storage, as opposed to one-time programmable ROM, EPROM,
or EEPROM used by other microcontrollers at the time.
AVR microcontrollers find many applications as embedded systems. They are especially
common in hobbyist and educational embedded applications, popularized by their inclusion in
many of the Arduino line of open hardware development boards.
1.10.1 History
The AVR architecture was conceived by two students at the Norwegian Institute of
Technology (NTH), Alf-Egil Bogen and Vegard Wollan.
Atmel says that the name AVR is not an acronym and does not stand for anything in
particular. However, it is commonly accepted that AVR stands for Alf and Vegard's RISC
processor or Advanced Virtual RISC.
1.10.2 AVR Family Overview
AVR can be classified into four groups:
1. Classic
2. Mega
3. Tiny
4. And special purpose
1. Classic AVR( AT90Sxxxx)
This is original AVR chip, which has been replaced by newer AVR chips.
2. Mega AVR ( ATmegaxxxx)
These are powerful microcontrollers with more than 120 instructions and lots of different
peripheral capabilities which can be used in different design .
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
3. Tiny AVR( ATtinyxxxx)
As name suggests , this group has less instruct tion and smaller packages in comparision to
mega family. You can design systems with low costs and power consumptions using this
family.
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot
4. Special purpose AVR
The ICs of this group can be considered as a subset of other groups, but their special
capabilities are made for designing specific applications such as USB controller, CAN
controller, LCD controller, Zigbee, Ethernet controller , FPGA and advanced PWM .
Prepared by : S G Chudasama, Lecturer (EC) , GP Rajkot