Professional Documents
Culture Documents
ECEG4202-Embedded Systems
1
Course Syllabus
Introduction
Embedded Microcontrollers
Study of 8051 microcontroller
Embedded Programs
Real-Time Operating Systems
Low-power Computing
Reliable System Design
Embedded Systems 2
Chapter One
Introduction
3
Embedded System (1/2)
Embedded Systems 4
Embedded System (2/2)
Actuators Compressor
Display
Human interface
Embedded
System
Embedded Systems 6
Example: Car
Embedded Systems 7
Embedded System Components
Embedded Systems 8
Why we study Embedded Systems?
(1/2)
Embedded Systems 9
Why we study Embedded Systems? (2/2)
Embedded Systems 10
Application of Embedded System (1/2)
Embedded Systems 11
Application of Embedded System (2/2)
Embedded Systems 12
Role of Embedded Systems (1/2)
Data Collection/Storage/Representation
Embedded system designed for the purpose of data collection
performs acquisition of data from the external world.
Data collection is usually done for storage, analysis, manipulation
and transmission.
Data can be analog or digital.
Example: Digital Camera
Embedded Systems 13
Role of Embedded Systems (2/2)
Data communication
Embedded data communication systems are deployed in
applications from complex satellite communication to simple home
networking systems.
The transmission of data is achieved either by a wire-line medium or
by a wire-less medium.
Example : Network hubs, routers and switches
Data signal processing
Embedded systems with signal processing functionalities are
employed in applications demanding signal processing like speech
coding, audio video codec, transmission applications etc.
Example: Digital hearing aid.
Embedded Systems 14
Embedded Systems Vs General purpose computers
(1/2)
Embedded Systems 15
Embedded Systems Vs General purpose computers
(2/2)
Properties Embedded System General purpose
computer
Hardware Special purpose hardware. Generic hardware.
OS Embedded OS / Real-time OS General purpose OS
Applications Execute specific set of Execute a variety of
applications that are known at applications
design-time.
Embedded Systems 16
Characteristics of Embedded Systems (1/3)
Dedicated systems
An embedded system usually performs a specialized operation and
does the same repeatedly.
Reactive systems
Continually reacts to changes in the systems environment (using
User-interface and/or sensors).
Real-time systems
Must finish operations by deadlines.
Hard real time: missing deadline could result in a catastrophe. Eg.
Pacemaker system
Soft real time: missing deadline results in unhappiness. Eg. Washing
machine, Printers
Embedded Systems 17
Characteristics of Embedded Systems (2/3)
Safety-critical
Must not endanger human life and the
environment.
Tightly constrained: All computing systems
have constraints on design metrics, but those
on an embedded system can be especially
tight.
Power: critical in battery powered devices.
Size: fit on a single chip.
Cost: should consider unit cost and
NRE(Non-Recurring Engineering) cost.
Reliability: R(t) = probability of a system working
Embedded Systems
correctly at time t provided that it was working at t
18
Characteristics of Embedded Systems (3/3)
Embedded Systems 19
Chapter Two
Embedded
Microcontrollers
20
The basic computer system
CPU
System
interconnect
ion
I/O Memory
Embedded Systems 21
Structure of a basic computer system
INPUT OUTPUT
CPU UNIT UNIT
Control
unit
ALU
System Bus
Registers
RAM ROM
MEMORY
Embedded Systems 22
Components of a basic computer system
Embedded Systems 23
Memory
Embedded Systems 24
ROM
Embedded Systems 25
ROM
Embedded Systems 26
ROM
Embedded Systems 27
RAM
Embedded Systems 29
System Bus
Embedded Systems 30
Inside the CPU
IR PC
ALU
Embedded Systems 32
Fetching an instruction
Embedded Systems 33
Bus Activity for Fetch Cycle
Embedded Systems 34
Input/output Devices
Embedded Systems 35
Microprocessor and Microcontroller
Embedded Systems 36
Microcontroller
It is composed by:
Microprocessor (CPU),
ROM (for the program),
RAM (for the data)
Peripheral devices (to make easier the interfacing
and implementation of the desired functionalities)
MPU = CPU
MCU = MPU + Peripherals + Memory
Peripherals = Ports + Clock + Timers + ADC + DAC + LCD
Drivers + Other
Memory = SRAM + EPROM + EEPROM
Embedded Systems 37
Microprocessors vs. Microcontrollers
Embedded Systems 38
Microprocessors vs. Microcontrollers
Microprocessor Microcontroller
assimilates the function of a CPU can be considered as a small
on single IC. computer which has a
processor and some other
components
used in designing general used in automatically
purpose systems controlled devices
components of personal generally used in embedded
computers systems
High computational capacity low computational capacity
has to be connected externally to The IC of a microcontroller has
some other components like memory integrated on it along
Memory (RAM and ROM) and I/ O with some other components
ports. like I / O devices and timers.
High cost Low cost
High power consumption Low power consumption
Embedded Systems 39
Types of microcontrollers
Embedded Systems 40
Microcontroller Architecture
Embedded Systems 41
Embedded memory Vs External Memory
Microcontroller
Embedded Systems 42
Instruction Set Architecture
Embedded Systems 43
RISC vs CISC
RISC:
has simple instructions which often take only one or a few clock
cycles to execute.
has comparatively small and fixed code size with.
few instructions and few addressing modes.
execution of instructions is very fast.
CISC:
complex microcoded instructions which take many clock cycles to
execute.
has a large and variable code size.
many powerful instructions and addressing modes.
execution of instructions is slower than RISC.
Embedded Systems 44
CPU families used in microcontrollers
Embedded Systems 45
Timers and Counters
Embedded Systems 46
Interrupts
Embedded Systems 47
Interrupts v/s Polling
Embedded Systems 48
Interrupts
Embedded Systems 50
Software Interrupts
Embedded Systems 51
Interrupt Service Routine (ISR)
Embedded Systems 52
Steps to Execute an Interrupt
Embedded Systems 53
Steps to Execute an Interrupt
The microcontroller gets the address of the ISR from the interrupt
vector table and jumps to it.
It starts to execute the ISR until it reaches the last instruction of
the subroutine which is RETI (return from interrupt).
Upon executing the RETI instruction, the microcontroller returns to
the location where it was interrupted.
First, it gets the program counter (PC) address from the stack by
popping the top bytes of the stack into the PC.
Then, it start to execute from that address.
Embedded Systems 54
Interrupt
Program
time t
Embedded Systems 55
Interrupt
Program Program
time t
Embedded Systems 56
9
fahr= (cent * ) +32
5
Interrupt
Program
mov R1, cent mul R1, 9 div R1, 5 add R1, 32 mov fahr, R1
time t
Embedded Systems 57
Interrupt
Program Program
mov R1, cent mul R1, 9
Interrupt Service Routine
mov R1, 0x90 mov sensor, R1 ret
time t
Embedded Systems 58
Interrupt
Program Program
Save Restore mul R1, 9
mov R1, cent Interrupt
Context Context
Service
Routine
time t
Embedded Systems 59
Interrupt
Program Program
Save Restore mul R1, 9
mov R1, cent Interrupt
Context Context
eg push R1 Service
eg pop R1
Routine
time t
Embedded Systems 60