0% found this document useful (0 votes)
127 views119 pages

EMBEDDED SYSTEM-unit-1

Introduction to embedded systems about pic and arm microcontrollers and basic definitions about it, definitely helps students to learn basic about embedded systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views119 pages

EMBEDDED SYSTEM-unit-1

Introduction to embedded systems about pic and arm microcontrollers and basic definitions about it, definitely helps students to learn basic about embedded systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 119

EE1672

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

• Processor has two essential units:

Control Unit(CU)
Execution Unit(EU)
• Program Flow and data path (CU) Control
Unit—includes a fetch unit for fetching
instructions from the memory.

• Execution Unit (EU) —includes circuits


for arithmetic and logical unit (ALU), and for
instructions for a program control task, say,
data transfer instructions, halt, interrupt, or
jump to another set of instructions or call to
another routine or sleep or reset.
A Processor is in the form of an IC or it
could be in core form in an Application
Specific Integrated Circuit (ASIC) or
System on Chip (SoC).

An embedded processor chip or core can be


one of the following:
1. General Purpose Processor (GPP) :
instruction set designed not specific to the
applications.

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.

Examples: micro controller


embedded micro controller
DSP and media processor
Network processor
IO processor or
domain-specific programmable processor
• A Microcontroller is an integrated chip
(IC) that has a processor, memory and
several other hardware units in it such as
timers, watchdog timer, interrupt controller,
ADC or PWM .
• is an essential component of a control or
communication circuit.

8051, 8051 MX, 68HC11xx, PIC18


Various functional circuits in a microcontroller chip:
Commonly used exemplary microcontrollers in small
scale embedded Systems
3. Single Purpose Processors or additional
processors:
Examples:
• Coprocessors: used for graphic processing,
floating point processing, encrypting,
deciphering, discrete cosine transformation
and inverse transformation on TCP/IP
protocol stacking and networking connecting
functions.
• Accelerator: Java codes accelerator
• Controllers: for peripherals, direct memory
access and buses
4. GPP or ASIP cores integrated into either an
ASIC or VLSI circuit or a Field
Programmable Gate Array (FPGA) core
integrated with processor units in a VLSI
chip.
5. Application Specific system Processor
(ASSP): Support other processing units in the
system and execute specific hardware
processes fast.
6.Multi core processors or multi processors:
Used when single processor is not enough to
meet the deadline.
 Commercial off-the-shelf components(COTs)
1) A Commercial off the Shelf product is one which is
used 'as is'.
2) The COTS components itself may be develop around
a general purpose or domain specific processor or an
ASICs or a PLDs.
3) The major advantage of using COTS is that they are
readily available in the market, are cheap and a
developer can cut down his/her development time to a
great extent.
4)The major drawback of using COTS components in
embedded design is that the manufacturer of the COTS
component may withdraw the product or discontinue
the production of the COTS at any time if rapid change
in technology occurs.
OTHER HARDWARE UNITS IN
EMBEDDED SYSTEM
1. Power source
• A power supply source or charge pump is essential in
every system.
• The systems which do not have power supply of their
own are powered by the use of charge pumps or they
connect to external power supply.
2. Clock Oscillator circuit and Clocking
units:

• the clock controls the time for executing an


instruction.
• also controls the various clocking
requirements of CPU, of system timers, CPU
machine cycles.
• A processor needs a clock oscillator circuit to
establish a reference frequency used for timing
purposes.
3. System timers and Real-Time
Clock(RTC):

• to schedule the various tasks and for real time


programming , an RTC or system clock is
needed.

• A timer circuit is configured as system clock ,


which ticks and generates interrupts
periodically.
4. Reset circuit , Power-up Reset and
Watchdog timer Reset :

• Reset circuit can change the Program


Counter (PC) to a power-up default value.
• A program that is reset and runs on a power-
up can be one of the following:
i) system program that executes from the
beginning.
ii) A system boot-up program
iii) A system initialization program
The Build Process
• The build process for embedding software
consists of the following steps
– Project file consisting of source file and library
files
– Compilation of the project files
– Converting the object file in a form called
to binary image hex-file
Linking all object files and locating onto a
single re-locatable object file

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

2. Internal Bus Width:


◦ ALU gets inputs through internal buses
◦ 32 bit bus to facilitate the availability of arithmetic operations on 32-
bit operands in a single cycle
◦ 32-bit bus – a necessity for signal processing and control system
instructions

3. Program-Counter (PC) bits & Reset value:


◦ Number of PC bits decides maximum possible size of physical memory
that can be accessed by the processor
◦ Reset value tells the designer the initial program address from where
the program runs on a system reset/power up
Features in most processors
4. Stack-Pointer bits & initial reset value
◦ SP values must point to addresses of the words stored
at stack
◦ Software designer defines an initial reset value & sets
the beginning SP accordingly

5. Interrupt Controller
◦ To program the service routine priorities and to
allocate vector addresses

6. Direct Memory Access (DMA) controller with


multiple channels
◦ More number of I/O devices needs to access a multi
byte data set faster, DMA is useful.
PROC E S S O R S E L E C T I O N
Processor specific feature:
1.Should operate at higher clock speed for processing
more instructions per second.
2.High computing performance when there exist
◦ (a) Pipeline(s) and superscalar architectures,
◦ (b) pre-fetch cache unit, caches, and register-files and
MMU and
(c) RISC architecture.
3.Register-windows provides fast context switching in a
multitasking system.
4.Power-efficient embedded system requires a processor
that has auto-shut down feature for its units and
programmability for the disabling use of caches when
the processing need for a function or instruction set is
not constrained by limit or execution time. Uses Stop,
Sleep and Wait instructions, also require special cache
design.
Processor specific feature:

5. Burst mode accesses external memories fast,


reads fast and writes fast.
6. Atomic operation unit provides hardware
solution to shared data problem when
designing embedded software, else special
programming skill and efforts are to be made
when sharing the variables among the multiple
tasks.
7. Big-endian (MSB to lowest address) or Little-
endian (LSB to lowest address)
8. Energy efficient
Direct Memory Access
A DMA is required when a multi-byte data set or
a burst of data or a block of data is to be
transferred between the external device and
system or two systems.
 A device facilitates DMA transfer with a
processing element (single purpose processor)
and that device is called DMAC (DMA
Controller).
 Three modes of DMA operations:
◦ Single transfer at a time and then release of the
hold on the system bus.
◦ Burst transfer at a time and then release of the hold
on the system bus.A burst may be of a few kB.
◦ Bulk transfer and then release of the hold on the
system bus after the transfer is completed.
D M A C - D M A Controller
Data transfer occurs efficiently between
I/O devices and system memory with
the least processor intervention using
DMAC.
DMAC provide memory access to Multiple
channels
◦ Separate set of registers for programming
each channel.
◦ Separate interrupt signals in the case of a
multi- channel DMAC
 Provides DMA action from system
memories and two (or more IO) devices.
D M A Controller with the buses& control signals in
between
Figure shows the buses and control signals between processor, Memory, DMAC
and the data transferring I/O devices.
DMA ControllerExecution
DMA proceeds without the CPU
intervening
◦ Except
(i)at the start for DMAC programming and
initializing and
(ii)at the end.
◦ Whenever a DMA request by external
device is made to the DMAC, the CPU is
requested (using interrupt signal) the DMA
transfer by DMAC at the start to initiate the
DMA and at the end to notify (using
interrupt signal) the end of the DMA by
DMAC.
DMAC is programmed for
 i) read or write ii)Mode of DMA transfer iii)total
number of bytes to be transferred iv)starting memory
address.
 The use of DMA channels for the I/O services in place
of processor interrupt driven ISRs provides an efficient
method when the device has to transfer large amount
of data by I/O. This is because a DMA transfer uses the
periods when the system buses are free.
MEMORY DEVICES
A simple credit-debit transaction card
may require just 2kB of memory.
◦ On other hand, smart card for secure
transactions (cryptographic functions)
require 32kB of memory.
A memory- a data byte, or a word, or a
double word, or a quad word may be
accessed from all addressable locations
with a similar process and there is would
be equal access time for a read or for a
write operation.
Memory Management
 Memory is the important resource, there is a
constant interaction and communication between
the processor.
 Semiconductor memory is the primary memory
 Hard disk is the secondary memory
 All programs run with the data and code in the RAM
VIRTUAL MEMORY
 Virtual memory is a concept by which the application is
made to believe that it has much more memory than in
physically available.
 Enlarged Address space which is also a virtual address
space.
ROM :Uses, Forms & Variants
Non-Volatility is an important asset useful
to embed codes & data in a system.

ROM embeds software/application logic


circuit in either forms – Masked ROM,
PROM & EPROM.

During
runtime programming EEPROM/Flash
memory is used.
Masked ROM

One time masking charge – very high


Therefore, system manufacturer will
place order & manufacturing foundry
will accept the order for a minimum
of 1000 pieces.

ROM is a cost effective solution to a


bulk user.
EPROM, EEPROM and OTP
ROM
 EPROM:
◦ It is an ultraviolet ray erasable & device
programmable.
◦ Erasing means restoring 1 at each bit.
 EEPROM:
◦ Electrically Erasable and Programmable Read
Only Memory
 Flash Memory:
◦ Form of EEPROM, in which sector of bytes
can be erased in a flash.
 PROM:
◦ Once written is not erasable.
◦ OTP (One Time device Programmer)
RAM – Random Access Memory
A system designer considers RAM devices of EIGHT
forms.
1. S R A M – Static RAM,
2. D R A M – Dynamic RAM,
3. N V R A M – Non Volatile RAM,
4. E D O R A M – Extended Data Output RAM,
5. S D R A M – Synchronous DRAM,
6. R D R A M – Rambus DRAM,
7. Parameterized distributed RAM and
8. Parameterized Block RAM.
USES:
 Stores variables during a program run & stores stack.
 Stores input & output buffers.
◦ Eg: Speech & Image
BASIS FOR COMPARISON SRAM DRAM

Speed Faster Slower


Size Small Large
Cost Expensive Cheap

Used in Cache memory Main memory


Density Less dense Highly dense
Construction Complex and uses Simple and uses capacitors
transistors and latches. and very few transistors.

Single block of memory 6 transistors Only one transistor.


requires
Charge leakage property Not present Present hence require power
refresh circuitry

Power consumption Low High


1. SRAM: commonly used for designing
caches & in embedded systems and
microcontrollers.
2. DRAM: mostly used in high performance
computers / high memory density
systems.
3. EDORAM: used for system having buses
with clock rates up to 100MHz.
4. SDRAM: synchronizes read operations &
keeps next word ready, used for
processor speed of 1GHz.
5. RDRAM: accesses in burst (four
successive words in a single fetch), thus
performance 1GHz speed.
6. Parameterized distributed RAM:
distributes in various system sub-units
- IO buffers & transceiver sub-units.
Distribution provides buffering of
memory at subunits & facilitates
faster inputs from IO devices.

7. Parameterized Block RAM: used when


specific block of RAM is dedicated to
sub- unit (eg: MAC unit), used when
access by the system / IO / Internal
bus is slow compared to processing
speed of sub-unit.
Summary of Memory
 Masked ROM/EPROM/Flash stores embedded
software (ROM image). Masked ROM is for bulk
manufacturing.
 EPROM / EEPROM is used for testing & design
stages.
 EEPROM is used to store the results during
program runtime (erased byte-by-byte and
written during system run).

 Flash
is useful when a processed image /voice
/data/system configuration has to be stored.

 RAM is mostly used in SRAM form


Memory Selection for an Embedded
System
 Once Software designer’s coding is over and the
ROM image file is ready, a hardware designer is faced
with the questions, of what type of memory and what
size of each should be used.
 CASE STUDIES:
1. Automatic chocolate vending machine or real
time robotic control system.
2. Data Acquisition Systems
3. Multi-port network transceivers, Fast switches,
Routers, or Multi-channel Fast Encryption and
decryption System
4. Voice processor or video processing or Mobile
Phone system
5. Digital Camera or Video recorder system.
 Functions,
Processes, Data and Stacks at the
Various Segments of Memory:
◦ Program routines & processes can have different
segments.
◦ A pointer address, points to the start of memory
block storing a segment and an offset value is
used to retrieve for a memory address within
that segment.
 Segment wise memory allocation in four
segments:
Code, Data, Stack and Extra
(for examples, image, String)
A segment can have partitions of
fixed sizes called PAGES.
◦ Figure shows different segment types
required by software designer.

Each Segment has a starting


and ending memory address.
Each Segment has a pointer
and an offset address.
Using offset, code /
data is retrieved from
a segment
Different Data Structures/Sets at
Various Memory Blocks

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.

For Circular Queue, when back attempts


To exceed end, back becomes equal to start.
4) Table – two dimensional array (matrix)
three pointers – table base, column index, destination index
pointer

5) Hash Table – collection of pairs of key &


corresponding value.
data set allocated with a memory block - Look-up-
table
6) List – a data structure with number of memory
blocks, one for each element.
each list-element stores pointer to next element
last element points to NULL
A list is for non-consecutively located objects
at the memory.
The Memory Maps
Fig (a) -
Princeton and
Fig (b) - Harvard
Memory
Organizations
The Memory Maps
 Memory areas needed in the case of
Princeton and Harvard architecture are
different and as shown
◦ Vectors and pointers, variables, program
segments and memory blocks for data and
stacks have same addresses in the program –
PRINCETON memory architecture.
◦ Program segments and memory blocks for data
and stacks have separate sets of addresses in
Harvard architecture. Control signals and read-
write instructions are also separate.
 Designer
must remember that if main
memory is of Harvard architecture,
program memory map will be separate.
Memory Map
  Map to show the program and data
allocation of the addresses to ROM, RAM,
EEPROM or Flash in the system

Fig: Memory map for


an exemplary
embedded system,
smart card needing
2 kB memory
Watch Dog Timer (WDT)

A Watch Dog Timer is an additional timer that does


a monitoring job resets the system.
“Self- Reliant System”
 A watchdog timer (WDT) is a timer that monitors
microcontroller (MCU) programs to see if they are out of
control or have stopped operating. It acts as a “watchdog”
watching over MCU operation.
 Software getting stuck in infinite loop.
 Dead lock
 Noise Voltage in some pin leads to – Wrong triggering
Watch Dog Timer – it can be loaded with a count which
decrements down to zero.
8051 doesn't have inbuilt WDT but PIC ,ARM
microcontrollers have WDT.
Reset by WDT is called as “Soft Reset or Warm Boot”.
One application of WDT is in a mobile phone when the
display is turned off in case no GUI interaction takes place
within a specified time interval. This saves power.
 The watchdog timer communicates with the MCU at a set
interval. If the MCU does not output a signal, outputs too
many signals or outputs signals that differ from a
predetermined pattern, the timer determines that the
MCU is malfunctioning and sends a reset signal to the
MCU.
 The WDT uses a number of methods (modes) to detect
MCU faults and the type of faults it detects varies with the
mode. The following is a description of WDT operation
and features by mode.
 Time-out mode
 In this mode, the watchdog timer determines the MCU is
malfunctioning and outputs a reset signal if it does not
receive a signal from the MCU within the set interval.
 The time-out mode is a major WDT monitoring mode
or method, but it sometimes fails to detect MCU
faults.
In Time-out mode, the WDT will not detect an MCU
fault if the MCU inputs multiple signals (= double
pulse) in the set period.
 A window mode watchdog timer may be more suitable
for applications such as automotive devices that
require greater safety.
 Devices that require a high degree of safety, may
require a Q&A mode WDT. However, unlike the
window and the timeout modes, this mode relies on
data communication between the MCU and WDT,
which makes operation more complex.
Is external WDT necessary?
 What applications require WDTs?
 MCUs are used in all sorts of electronic devices, but
whether a WDT is required or not depends on the “level of
safety demanded by or deemed necessary for a specific
application.”
 Automotive devices are devices where MCU failure or
malfunction could lead to life-threatening accidents. In
water heaters and kitchen stoves, MCU failure or
malfunction poses a fire risk.
 In systems that impact human life or in applications
where malfunction of electronic control can cause
serious accidents, an external WDT is required to
ensure sufficient redundancy.
Real Time Clock (RTC)
 Real Time clock is a clock that causes occurrences of regular
interval interrupts on its each tick(time out).
 Interface with MP and MC and works even in the absence of
power
 Once started never reloaded with another value.
 Responsible for keeping track of the time.
 Used in a system to save the current time and date, to
initiate return of control to the system after the preset
system clock periods.
 System needs a clock which refers for REAL TIME.
 There are specialized ICs for keeping time which can be programmed to
count time in terms of second, minutes and hours.For example ARM
Microcontrollers have On-Chip,Real Time Clock (RTC).
RTC vs Internal Timers
 Used for synchronizing the operations of the OS
kernel
 Can Interrupt OS kernel by asserting interrupt line of
MP and MC to which RTC is connected.
 OS identifies interms of IRQ number generated by the
interrupt controller
 Then System time, date updating can be done.
Embedded tools







Compiler
 A software program that converts source code
that written in high level programming language into
low level language.

 A Native-compiler runs on a computer platform


and produces code for that same computer platform.

 A Cross-compiler runs on one computer platform


and produces code for another computer platform.
Assembler
 An Assembler is software program that
converts source code written in assembly
language into machine language.

 The input to the Assembler must be


assembly language

 An Assembler that runs on Host but produces


binary instruction appropriate for Target is called
Cross-Assembler.
Locator assign
memory
A linker or link editor is a program that takes one or
more objects generated by compilers and assembles
them into a single executable program or a library
that can later be linked to in itself.
All of the object files resulting from compiling
must be combined in a special way before the
program can be executed.
A Locator is the tool that performs the
conversion from relocatable program to
executable binary image.
It will produce an output file that contains a
binary image that can be loaded into the target
ROM.
You will have to provide information about
the memory on the target board as input to
the locator.
The locator uses this information to assign
physical memory addresses to each of the
code and data sections.
A debugger or debugging tool is a computer
program that is used to test and debug other programs.
The code to be examined might alternatively be
running on an instruction set simulator .
When the program crashes, the debugger shows the
actual position in the original code if it is a source-level
debugger.
If it is a low-level debugger or a machine-language
debugger it shows that line in the program.
Emulator
An emulator is a piece of Hardware/Software
that enables one computer system to run programs
that are written for another computer system.
For example there is a Comodore 64 emulator
for the iPhone which allow you to run games
that written for the iPhone.
An emulator is used on the target processor
(the processor for which the program is being
written).
Emulator Emulator
Hardware software
Simulator is a piece of Hardware/Software
that simulates another system.
for example a flight simulator allows you to
experience what it is like to fly an aircraft, a driving
simulator to experience driving etc..
Simulator tests the program on the
development processor(the processor on which
we are working).
Simulator Simulator
Hardware Software
Profiler
A Software Program that gathers information
about a program during execution.

It is used to know which areas of code to


optimize Speed and Memory.

Profiler may show time elapsed in each function


and its descendants
END OF UNIT-I

You might also like