EMBEDDED SYSTEM-unit-1
EMBEDDED SYSTEM-unit-1
SYLLABUS
UNIT I INTRODUCTION TO EMBEDDED SYSTEMS 9
Introduction to Embedded Systems –Building blocks of Embedded System, Structural units in
Embedded processor, selection of processor & memory devices- DMA – Memory management methods-
Timer and Counting devices, Watchdog Timer, Oscillator and Reset Circuits-Real Time Clock.
Introduction to a brief study on a typical embedded processor.
UNIT II INTRODUCTION TO EMBEDDED PROCESSORS 9
Introduction to PIC 16F877A microcontroller: architecture and pin diagram, Overview of instruction sets
and addressing modes. Introduction to ARM processor: Architecture and pin diagram of CORTEX
processor. Micro-c and Keil compilers for programming using embedded C coding.
UNIT III EMBEDDED NETWORKING 9
Embedded Networking: Introduction, I/O Device Ports & Buses– Serial Bus communication protocols-
RS232 standard – RS422 – RS 485- Inter Integrated Circuits (I2C), Serial Peripheral Interface (SPI), CAN
Bus, – USB- Wi-Fi- Bluetooth- Zigbee - need for Device Drivers.
UNIT IV RTOS BASED EMBEDDED SYSTEM DESIGN 9
Introduction to basic concepts of RTOS- Task, process & threads, interrupt routines in RTOS,
Multiprocessing and Multitasking, Pre-emptive and non-pre-emptive scheduling, Task communication
shared memory, message passing-, Inter process Communication – synchronization between processes-
semaphores, Mailbox, pipes, priority inversion, priority inheritance-Polling and interrupt handling
mechanism Overview and comparison of commercial RTOS:VX works- μC/OS-II
UNIT V EMBEDDED SYSTEM APPLICATION AND DEVELOPMENT 9
Case Study of Washing Machine- Automotive Application- Smart card System Application-ATM machine
–Digital camera .
TEXT BOOKS:
1. Peckol, “Embedded system Design”, John Wiley & Sons,2010
2. Lyla B Das,” Embedded Systems-An Integrated Approach”, Pearson, 2013
3. Shibu. K.V, “Introduction to Embedded Systems”, 2e, Mc graw Hill, 2017.
4. Embedded Systems Fundamentals with Arm Cortex M Based Microcontrollers: A
Practical Approach Paperback – 1 March 2017.
5. PIC microcontroller and Embedded systems Using Assembly and C for PIC18,second
edition,2021.
REFERENCES :
1. Raj Kamal, ‘Embedded System-Architecture, Programming, Design’, Mc Graw Hill,
2013.
2. C.R.Sarma, “Embedded Systems Engineering”, University Press (India) Pvt. Ltd, 2013.
3. Tammy Noergaard, “Embedded Systems Architecture”, Elsevier, 2006.
4. Han-Way Huang, “Embedded system Design Using C8051”, Cengage Learning, 2009.
5. Rajib Mall “Real-Time systems Theory and Practice” Pearson Education, 2007.
SYSTEM?
A way of working, organizing or performing one or
many tasks according to a fixed set of rules,program or
plan. Also an arrangement in which all units assemble
and work together according to a program or plan.
Or
It can accept some input, analyze and then it should
give the output that the system is meant for or it
should drive the next piece of machine connected to it.
Embedded system?
“An embedded system is a system that has software
embedded into computer-hardware, which makes a
system dedicated for an application (s) or specific part
of an application or product or part of a larger system.”
“An embedded system is one that has a dedicated
purpose software embedded in a computer hardware.”
“It is a dedicated computer based system for an
application(s) or product. It may be an independent
system or a part of large system. Its software usually
embeds into a ROM (Read Only Memory) or flash.”
“It is any device that includes a programmable
computer but is not itself intended to be a general
purpose computer.”
“Embedded Systems are the electronic systems that
contain a microprocessor or a microcontroller, but we
do not think of them as computers– the computer is
hidden or embedded in the system.”
What a Embedded System
Is???
4
Examples
Air conditioner- Temperature is a process variable
which is controlled.
Pace Maker- Heart beat is a process variable which is
to be controlled.
Washing machine
Automatic Braking in CARS
Mobile phones, Oven, ATMs, etc.
Examples Embedded System
5
Few more examples
Difference between Computer and
Embedded System
A computer is a system that has the following
or more components.
A microprocessor
A large memory comprising the following
two kinds:
(a) Primary memory (semiconductor
memories - RAM, ROM and fast accessible
caches)
(b) Secondary memory [(magnetic memory
located in hard disks, diskettes and cartridge
tapes, optical memory in CD-ROM or memory
stick (in mobile computer)] using which different user
programs can load into the primary memory and can
be run.
I/O units such as touch screen, modem, fax
cum modem etc.
Input units such as keyboard, mouse, digitizer,
scanner, etc.
Output units like LCD screen, video monitor,
printer, etc.
Networking units like Ethernet card, front-end
processor-based server, bus drivers, etc.
Operating system (OS).
General purpose user interfaces and application
software,mostly in secondary memory
Now consider Embedded system
1. Embeds hardware to give computer like functionalities
2. Embeds main application software generally into flash
or ROM and the application software performs
concurrently the number of tasks.
3. The final stage software is also called as ROM image,
because just as an image is unique sequence and
arrangement of pixels, embedded software is also a unique
placement and arrangement of bytes of instructions and
data.
4. By changing this image, the same hardware platform
will work differently and can be used for entirely different
applications or for new upgrades of the same system.
5. Embeds a real time operating system ( RTOS), which
supervises the application software tasks running on
the hardware and organizes the accesses to system
resources according to priorities and timing
constraints of tasks in the system.
Embedded System RTOS
Enables execution of concurrent processes or threads
or tasks
Provides a mechanism to let the processor run each
process as per scheduling and to do context-switch
between the various processes (threads or tasks)
RTOS sets the rules during execution of application
processes to enable finishing of a process within the
assigned time interval and with assigned priority.
The first recognised embedded system is the Apollo
Guidance Computer(AGC) developed by MIT lab.
AGC was designed on 4K words of ROM & 256 words
of RAM.
The clock frequency of first microchip used in AGC
was 1.024 MHz.
The computing unit of AGC consists of 11 instructions
and 16 bit word logic.
It used 5000 ICs.
The UI of AGC is known DSKY(display/keyboard)
which resembles a calculator type keypad with array of
numerals.
• The first mass-produced embedded system was
guidance computer for the Minuteman-I missile in
1961.
In the year 1971 Intel introduced the world's first
microprocessor chip called the 4004, was designed for
use in business calculators. It was produced by the
Japanese company Busicom.
CLASSIFICATION OF EMBEDDED
SYSTEM
The classification of embedded system is based on
following criteria's:
On generation .
On complexity & performance
On deterministic behaviour
On triggering
On generation
1. First generation(1G):
• Built around 8bit microprocessor & microcontroller.
• Simple in hardware circuit & firmware developed.
Examples: Digital telephone keypads.
2. Second generation(2G):
• Built around 16-bit µp & 8-bit µc.
• They are more complex & powerful than 1G µp & µc.
Examples: SCADA systems .
3. Third generation(3G):
• Built around 32-bit µp & 16-bit µc.
• Concepts like Digital Signal Processors(DSPs),
Application Specific Integrated Circuits(ASICs)
evolved. Examples: Robotics, Media, etc.
4. Fourth generation:
• Built around 64-bit µp & 32-bit µc.
• The concept of System on Chips (SoC), Multicore
Processors evolved.
• Highly complex & very powerful. Examples: Smart
Phones.
On complexity & performance
1. Small-scale:
• Simple in application need.
• Performance not time-critical.
• Built around low performance & low cost 8 or 16 bit
µp/µc. Example: an electronic toy
2. Medium-scale:
• Slightly complex in hardware & firmware
requirement.
• Built around medium performance & low cost 16 or 32
bit µp/µc.
• Usually contain operating system. Examples:
Industrial machines.
3. Large-scale:
Highly complex hardware & firmware.
Built around 32 or 64 bit RISC µp/µc or PLDs or
Multicore Processors.
Response is time-critical. Examples: Mission critical
applications.
On deterministic behaviour
This classification is applicable for “Real Time”
systems.
The task execution behaviour for an embedded system
may be deterministic or non-deterministic.
Based on execution behaviour Real Time embedded
systems are divided into Hard and Soft.
On triggering
Embedded systems which are “Reactive” in nature can
be based on triggering.
Reactive systems can be: 1) Event triggered 2) Time
triggered.
CHARACTERISTIC OF EMBEDDED
SYSTEM
Single Functioned (i.e. Dedicated Function )
Example: Air conditioner
Tightly constraint(i.e. manufacturing cost, size,
performance, power)
Real Time and Reactive(i.e. Ready to accept input at
any time and to process it.) It is logical correctness of
the operation in deterministic deadline.
Complex Algorithms(i.e. to perform operations that
are complex in nature.
e.g. Digital camera)
User interface(i.e. to have simple user interface.
e.g. ATM
Multirate (i.e. to control and drive certain operation at
one rate and certain operation at other rate. E.g.
Digital camera which shoots video and take still
pictures.)
Constraints of an Embedded System
Design
Available system-memory
Available processor speed
• Limited power dissipation when running the system
continuously in cycles of the system start, wait for
event, wake-up and run, sleep and stop. Performance
• Size
• Non-recurring design cost, and manufacturing costs.
Challenges in ES design
•Processor is the heart of embedded system
Control Unit(CU)
Execution Unit(EU)
• Program Flow and data path (CU) Control
Unit—includes a fetch unit for fetching
instructions from the memory.
example: Microprocessor
• A microprocessor is a dependent unit and it
requires the combination of other hardware like
memory, timer unit, and interrupt controller, etc.
for proper functioning.
• Developers of microprocessors.
1. Intel – Intel 4004 – November 1971(4-bit).
2. Intel – Intel 4040.
3. Intel – Intel 8008 – April 1972.
4. Intel – Intel 8080 – April 1974(8-bit).
5. Motorola – Motorola 6800.
6. Intel – Intel 8085 – 1976.
7. Zilog - Z80 – July 1976.
• Architectures used for processor design are
Harvard or Von Neumann.
Comparison between Harvard and
Von- Neumann Architecture
Comparison between RISC and
CISC Processor
Little and Big endian
2. Application Specific Instruction-set
Processor (ASIP): is a processor with
instruction set designed for specific
applications on a VLSI chip.
15
The Build
Process
16
Design Process in Embedded System
• Concepts used during Design process
– Abstraction
– Hardware and Software Architectures
– Extra Functional Properties
– System Related family of Designs
– Modular Design
– Mapping
– User Interfaces Design
– Refinements
17
Design Process in Embedded System
• Software Design Process
18
Design Process in Embedded
System
• Design Metrics
– Power Dissipation – Prototype Development
– Performance Time
– Process Deadlines – Time to Market
– User Interfaces – System and User Safety
– Size – Maintenance
– Engineering Cost
– Manufacturing
Cost
– Flexibility
19
Abstraction of Steps in Design
Process
20
Organisation of various structural units of Processor
Units shown with dashed boundary are present in the high performance processors only
Structural Units in a Processor
Structural Unit Functions
MAR – Memory • holds address of byte/word to be fetched from external
Address Register memory.
• processor issues the address of instruction or data to MAR
before it initiates fetch cycle.
MDR – Memory Data •holds a byte/word fetched (to be sent) from (to) an
Register external memory / IO address.
System Buses
1.Internal Bus •internally connects all the structural units inside the
processor (width – 8,18, 32, 48 or 64 bits)
2.Address Bus •external bus that carries address from MAR to memory as
well as to IO devices & other units of system.
3.Data Bus •external bus that carries, during read/write operation, the
bytes
4.Control Bus for instruction/data from/to an address. (determined by
MAR)
•external set of signals to carry control signal to
processor/memory/device
BIU – Bus Interface Unit • interface unit between processor’s internal units &
external buses
IR – Instruction Register •sequentially takes instruction codes (opcode) to
execution unit of processor.
ID – Instruction Decoder • decodes the instruction received at the IR & passes
it to processor CU.
CU – Control Unit •controls all the bus activities & unit functions
needed for processing.
ARS – Application Register •set of on-chip registers used during processing of
Set instruction of an application program or
•a register window
•a subset of registers with each subset storing static
variables of a software routine
•a register file associated to a unit (ALU/FPLU)
ALU – Arithmetic Logic Unit •unit to execute arithmetic/logical instruction
according to current instruction present at IR.
PC – Program Counter •generates an instruction cycle by sending the address
defined by it to memory through MAR
•auto increments as the instructions are fetched
regularly & sequentially
•called as instruction pointer in 80x86 processors
SP – Stack Pointer • pointer for an address which corresponds to a stack top in
memory.
IQ – Instruction •queue of instructions so that IR does not have to wait for
Queue next instruction
PFCU – Pre-fetch •unit that controls the fetching of data into I- & D- caches
Control Unit in advance from memory units.
•improve performance by fetching instructions and data in
advance for processing.
I- Cache – •sequentially stores (like instruction queue) instructions in
Instruction Cache FIFO mode.
•lets the processor execute instructions at greater speed
using PFCU.
D- Cache – • stores pre-fetch data from external memory.
Data Cache • stores both key and value together at a location.
• also stores write-through data when configured.
BT- Cache – Branch •facilitate ready availability of the next instruction-set
Target Cache when a branch instruction like JUMP/LOOP/CALL is
encountered.
MMU – Memory •manages the memories such that the instructions and data
Management Unit are readily available for processing.
SRS – System •set of registers used while processing the instructions of
Register Set the supervisory system program.
FLPU – Floating Point •separate unit from ALU for floating point
Processing Set processing which is essential in processing
mathematical function fast in a
microprocessor/DSP
FRS – Floating point Register •register set dedicated for storing floating point
Set numbers in a standard format and used by FLPU
for its data & stack.
MAC – Multiply and • units for multiplying coefficients of a series and
Accumulate unit accumulating these during computations.
AOU – Atomic Operation •it lets a user/compiler instructions when broken
Unit into a number of processor instructions called
atomic operations, finish before an interrupt of a
process occurs.
•it prevents problems from arising out of shared
data between various routines and tasks.
Features in most Processors
1. Instruction Cycle Time:
◦ It’s the time taken by a processor to execute a simple
instruction( ˜1µs for 8051- ˜1.6ns for MPC604 )
◦ System designer uses as an indicator to match the processor
speed with application
5. Interrupt Controller
◦ To program the service routine priorities and to
allocate vector addresses
During
runtime programming EEPROM/Flash
memory is used.
Masked ROM
Flash
is useful when a processed image /voice
/data/system configuration has to be stored.
1) Stacks –
•allotted memory
block, from which
data is read (LIFO)
•Return addresses on
the nested calls,
•Sets of LIFO (Last In
First Out) retrievable
data,
•Saved Contexts of
the tasks as the
stacks
2) Arrays – One dimensional or multidimensional
data can be retrieved from any
element address.
3) Queues – Sets of FIFO (First In First Out)
retrievable data;Two pointer (Front/Head &
Back/Tail)
Circular Queue (Example- a Printer Buffer);
bounded memory block, on exceeding limit reset to
start.
PIPE / Block Queue (Example- a network stack)
common memory block allotted for a queue with
source & destination.