CPE 413/L
Introduction to
Embedded Systems
Engr. Godofredo L. Jipus Jr.
“There are people who make things
happen, there are people who watch
things happen, and there are people
who wonder what happened.”
Jim Lovell, Apollo 13 mission commander
Watch 75%
Wonder 20%
Make 5% Engr. Godofredo L. Jipus Jr
How is this course organized?
Introduction Microcontrollers Peripherals Project
Development
01 02 03
Embedded Embedded Embedded
Table Of Systems
Definition
Systems
Characteristics
Systems
Applications
Contents 04 05 06
Embedded Embedded Embedded
Introduction to Embedded Systems
Systems Hardware Systems
Design Constrains
07
Embedded
Systems Market
What are
Embedded Systems?
Special purpose computer
custom built to serve a
Embedded specific purpose.
Systems
General
Purpose
we use everyday
Computers
They serve more than one specific purpose.
Like Gaming, Music, Movies, etc.
Special
Purpose
Computers
They serve one specific purpose.
vs
General
vs General Purpose Computers
Special
Purpose
are sometimes an "overkill
are expensive
Computers can't do everything
The word embedded reflects the fact that
these systems are usually an integral part of
a larger system, known as the embedding
system. Multiple embedded systems can co-
exist in an embedding system.
Embedded Embedded Systems are Application-
specific systems which contain hardware
Systems and software tailored for a particular task
and are generally part of a larger system.
Historically, the term embedded systems
was used to describe any non-PC-related
system, but in time, the definition has grown
to include any system that is dedicated to a
particular functionality.
Embedded
Embedded
Systems
Systems
Embedded
Systems
Classification
Embedded Embedded
Standalone Embedded
Networked
Subsystems
Systems Systems Systems
Systems Systems
- placed inside something bigger
- part of a larger system
-independently useless
Embedded
Subsystems
- can perform its function independently
- components and techniques used to build
these belong to the same class as the
"subsystem" class of embedded systems
Standalone and hence are viewed as embedded
Embedded systems too
Systems
- A group of physically separate electronic
devices that perform a collective function
Networked
Embedded
Systems
Internet
of
Things
01 02 03
Embedded Embedded Embedded
Table Of Systems
Definition
Systems
Characteristics
Systems
Applications
Contents 04 05 06
Embedded Embedded Embedded
Introduction to Embedded Systems
Systems Hardware Systems
Design Constrains
07
Embedded
Systems Market
Reliability
Efficiency
Tightly-constrained
Processing(speed)
Memory(Data)
Storage(Code Size)
Real time objectives
It needs to be fast and
efficient(Response Time)
It needs to be predictable (execution
time known ahead, and almost constant)
Power limited(battery
operated devices)
Cost
Size
The developer has to deal
with all of these constraints:
Development should take into
consideration code efficiency and
code foot print.
Debugging tools are “closer to the
metal”
Special attention to power
consumption in some cases.
Single-
functionality
Complex
functionality
Safety-critical
Maintainability
Interactive
System
Strong association
between the HW
and SW
01 02 03
Embedded Embedded Embedded
Table Of Systems
Definition
Systems
Characteristics
Systems
Applications
Contents 04 05 06
Embedded Embedded Embedded
Introduction to Embedded Systems
Systems Hardware Systems
Design Constrains
07
Embedded
Systems Market
Exercise
Choose two Embedded Systems
and list the main functionalities of
each one.
Automotive
Automotive
Electronics represents 40% of total cost of a car.
90% of new car features require software.
ECUs are used in different functions of the car :
Engine Control Lighting Control
Transmission Control Airbag Control
Fuel Efficiency Control Telemetric Control
Electric Power Steering Mirror Control
Speed Control Security System Control
Brake Control Windshield Blades Control
Suspension System Control Entertainment
Battery Management Human-machine interface (HMI)
Seat Control And a lot more …..
Door Control
Electric Windows Control
Phones and Tablets
Contains mainly three types of
processors:
Communication Processor(s)
Wifi
GSM/3G/LTE
Bluetooth/NFC
Audio/Graphics Processor(s)
Audio Processing
Graphics and Video Processing
Application Processor
Android
Windows Phone
iOS
Telecommunication systems
Networking Devices
Robotics
Image Processing
Electronic Devices
Appliances
Aircraft Control
Military
01 02 03
Embedded Embedded Embedded
Table Of Systems
Definition
Systems
Characteristics
Systems
Applications
Contents 04 05 06
Embedded Embedded Embedded
Introduction to Embedded Systems
Systems Hardware Systems
Design Constrains
07
Embedded
Systems Market
Software characteristics
Advantages
Highly configurable
Trade off Shorter development cycle
between Easier in versions updates
Cheaper
Software & Disadvantages
Hardware Constrained with processor
speed which may satisfy real
time application and may not.
Hardware characteristics
Advantages
Better performance in high
Trade off speed real time application
between
Disadvantages
Longer development cycle
Software & Customized for specific
application, not updatable
Hardware (unchangeable)
Design and build the target
hardware
Develop the software
Hardware/ independently
Software
Partitioning Integrate them and hope it works
In complicated systems functional blocks
could be:
Level I: external discrete hardware
Hardware/ component on board
Software Level II: hardware integrated with
CPU on chip system on
chip (SOC)
Partitioning Level III: done by software running
on CPU
Modeling via any modeling
language (System C or even
Matlab)
HW/SW partitioning (Determine
which blocks must be H/W &
which may be S/W)
Embedded Global Design of the S/W part
Systems Unit Design of the S/W part
Coding
Design Steps Unit Testing
Integration Testing
Verification and Validation
Maintaining
Find an implementation that can
perform the computation such that
the requirements are satisfied
Embedded Embedded systems perform
computations (software) that are
Systems subject to physical constraints
(hardware)
Design Execution on a physical platform:
processor speed, power, storage,
Challenges reliability
Computer science separates
computation from physical
constraints
Performance(overall speed
execution time and throughput)
Functionality and user interface
Manufacturing cost
Design Power consumption
Goals Safety
Other requirements. (physical size,
etc. )
01 02 03
Embedded Embedded Embedded
Table Of Systems
Definition
Systems
Characteristics
Systems
Applications
Contents 04 05 06
Embedded Embedded Embedded
Introduction to Embedded Systems
Systems Hardware Systems
Design Constrains
07
Embedded
Systems Market
General Purpose Processor
CPU = ALU + Registers + Control
unit
32 or 64-bit data path
Modern Processors have:
Advanced cache logic.
Processing Built-in math co-processor
Engines capable of performing fast
floating-point operations(FPU)
A built-in memory management
unit (MMU) to provide memory
protection and virtual memory for
multitasking-capable.
Interfaces to support a variety of
external peripheral devices
because Microprocessor alone is
useless.
Complex in design because these
processors provide a full scale of
features and a wide spectrum of
functionalities
These processors result in large
power consumption, heat
production, and large size.
Processing Intel X86, Intel Pentium , AMD,
PowerPC and SPARC
Engines
Embedded General Purpose Processor
16/32-bit data path
Designed for a wide range of
applications (consumer and
communication)
Limited functionality depending on
the application
Processing Not Flashable the program
memory is external and have CASH
Engines memory and MMU.
Usually integrated into larger
dedicated systems in a SOC
(System on Chip), also called core-
based ASIC
Have main peripherals Like Timers,
Ethernet, USB and GPIO
ARM has seized the lion’s share of
the market.
Digital Signal Processor
Like microprocessor but focus on
very efficient execution of
arithmetic operations.
Digital signal processing
algorithms typically require a large
number of mathematical
Processing operations to be performed
quickly and repeatedly on a series
of data samples. Signals (perhaps
Engines from audio or video sensors) are
constantly converted from analog
to digital, manipulated digitally by
DSP processor, and then converted
back to analog form.
Digital Signal Processor
Used widely in digital signal
processing in communication
systems such as Cell phones,
Image and video processing
Even though DSPs are incredibly
fast and powerful embedded
Processing processors,
TI (Texas Instruments), Motorola
Engines TI has been the dominant player in
the DSP market for several years
Digital Signal Processor
Processing
Engines
Microcontrollers
Microcontroller = CPU + Memory + Peripherals
Microcontrollers are often referred to as single
chip devices or single chip computers in a
small size that its resources are more limited
than those of a desktop personal computer
Processing Included memories (RAM, ROM), I/O Ports,
buses and peripherals depending on the
Engines application designed for (ADC, Timers, USART,
I2C , SPI and ..)
The workhorse of industrial electronics
Designed for standalone operation
Include a processing unit of 8-bit, 16-bit or 32-
bit
System on Board
Processing
Engines
System on chip(SOC)
Processing
Engines
System on chip(SOC)
A SOC has multiple functional units on one
piece of silicon, Integrating all components of
a computer or othe electronic systems into a
single integrated circuit (chip)
Due to advancements in silicon technologies,
it is possible to add more functionalities to the
Processing processor system on chip like Co-processors,
Memories, Internal I/O devices and Interrupt
Engines
circuit
For example, a system-on-a-chip for a sound-
detecting device might include an audio
receiver, an analog-to-digital converter ( ADC
), a microprocessor, memory, and the
input/output logic control for a user all on a
single micro-chip
Typically application is in the area of
embedded systems
Advanced Embedded Systems
Network of embedded micro-controllers on
board
Many micro-controllers on one / many
board(s) communicate together through
specific bus protocol like LIN bus and CAN
bus in automotive applications
Processing
Engines
Advanced Embedded Systems
Multi-Core system on chip like mobile handset
which has one chip contains:
Processing
DSP Processor for graphics and image
processing
Engines Embedded Processors like: ARM
Custom hardware for Wi-Fi, Bluetooth and
LTE(4G Network)
Custom peripherals for board interface:
GPS
Touchscreen interface
Memory card interface
Advanced Embedded Systems
Processing
Engines
01 02 03
Embedded Embedded Embedded
Table Of Systems
Definition
Systems
Characteristics
Systems
Applications
Contents 04 05 06
Embedded Embedded Embedded
Introduction to Embedded Systems
Systems Hardware Systems
Design Constrains
07
Embedded
Systems Market
Micro-controller
Basically a microcontroller can be described
as a computer on a chip. a single chip
containing a CPU, non-volatile memory (ROM),
volatile memory(RAM), a timer and an I/O
control unit
Micro-processor A microcontroller apart from the above
mentioned components usually also include
vs serial communication capabilities, interrupt
controls and analog I/O capabilities
Micro-controller Used for a few dedicated functions
determined by the system designer
Many IC’s into one IC
Micro-processor
vs
Micro-controller
Microcontrollers don’t work alone in the circuit
it must interfaces with other on chip devices
like Sensors, Switches, Leds, LCD, Keypad and
DC Motor
Microcontroller can accept inputs from some
Micro-processor components and provide outputs to other
components within any given system
vs Differences in requirements, make the
Micro-controller manufacturers produce different
microcontrollers with different memory sizes,
number of I/O lines and number of integrated
peripheral devices. Other wise they are all
similar to use.
Just a CPU has to add externally memory,
clock, input/output interfaces, timer and all
other needed peripheral. This is the reason a
microprocessor has so many pins
The difference between a microcontroller and
Micro-processor a microprocessor is that the microprocessor is
a general purpose computer while a
vs microcontroller is a computer dedicated to
one or just a few tasks
Micro-controller
Micro-processor
vs
Micro-controller
01 02 03
Embedded Embedded Embedded
Table Of Systems
Definition
Systems
Characteristics
Systems
Applications
Contents 04 05 06
Embedded Embedded Embedded
Introduction to Embedded Systems
Systems Hardware Systems
Design Constrains
07
Embedded
Systems Market
Central processing unit (CPU)
Memory units
Input and Output ports (GPIO or DIO)
Timers
Micro-controller Watch dog timer
Main Buses
Components Interrupt circuit
In the following slides we will try to understand the
different components in any microcontroller then
map these information to AVR microcontrollers
Micro-controller
Main
Components
The central processing unit (CPU) does all the
computing: it fetches, decodes and executes
program instructions and directs the flow of data
to and from memory. The CPU performs the
calculations required by program instructions and
places the results of these calculations, if required
Cental into memory space.
The unit which monitors and controls all processes
Processing Unit inside the microcontroller. It consists of several
smaller units.
(CPU)
Example Assembly Instruction for AVR CPU
Cental
Processing Unit
(CPU)
The most important units inside CPU are:
Arithmetic Logic Unit (ALU)
Instruction Decoder (Control Unit)
Cental Accumulator Register
Processing Unit Register File
(CPU) SFR Registers
Arithmetic Logic Unit
Part of the CPU is responsible for performing
calculations and execution for Arithmetic,
Logic and Shift instructions.
Cental Arithmetic instructions include:
Processing Unit Addition
Subtraction
(CPU) Shifting operations
Logic instructions include:
AND
OR
XOR
NOT operations
Instruction Decoder (Control Unit)
Cental
Processing Unit
(CPU)
Accumulator Register
Is an SFR closely related to the operation of the ALU.
It is a kind of working desk used for storing all data
upon which some operations should be performed
(addition , shift, Subtraction, etc.)
Cental
Processing Unit
(CPU)
Register File
A number of registers grouped together
n data bits and k address bits
We can read two registers at once by supplying
AA, BA and WR = 0
We can write at a register using the DA and D
Cental inputs and setting WR = 1
Processing Unit
(CPU)
Register File in AVR CPU
AVR CPU contains 32 registers R0 to R31
Cental
Processing Unit
(CPU)
SFR Registers
The numbers and names of registers vary
drastically among microcontrollers. However
there are certain registers which are common to
most of microcontrollers, although the names
may vary.
Cental
Processing Unit Instruction Register (IR)
Register which contains the instruction after
(CPU) getting it from program memory (Fetch stage)
The ATmega16 contains 16 Kbytes On-chip
In-System Reprogrammable Flash EEPROM
memory for program storage. Since Most AVR
instructions are 16 bits wide, the Flash is
organized as 8K × 16. so The ATmega16
Instruction Register is 16 bits wide
Program Counter(PC)
Perhaps the most important CPU register is
the program counter(PC)
The PC holds the address of the next instruction
in program memory space, which the CPU will
Cental process. As each instruction is fetched and
processed by the ALU, the CPU increments the
Processing Unit PC and there by steps Through the program
stored in the program memory space
(CPU) The ATmega16 contains 16 Kbytes On-chip
In-System Reprogrammable Flash EEPROM
memory for program storage. Since most AVR
instructions are 16 wide, the Flash is organized
as 8K × 16. so The ATmega16 Program Counter
(PC) is 13 bits
Stack Pointer(SP)
The stack pointer is basically a register that
holds either "the memory address of the last
location on that stack where data was stored"
or "the memory address of the next available
location on the stack to store data.“ last case
Cental is more common in CPU architectures.
Processing Unit The Stack is implemented as growing from
higher memory locations to lower memory
(CPU) locations. This implies that a Stack PUSH
command decreases the Stack Pointer and a
Stack POP command increases the Stack
Pointer(and may be vice versa for some
processors)