CPE109 Module 1
CPE109 Module 1
1960
Apollo Guidance Computer was
developed by Charles Stark
Draper at MIT
• A customizable operating
system for embedded
applications
1999
The first embedded Linux
system appeared called the
uCsimm which runs an
embedded microcontroller OS
called uClinux.
2013
The embedded market reached
$140 Billion
Future
By 2030, Analysts are projecting
an Embedded market larger
than $140 Billion
OVERVIEW
What is Embedded System?
◦ A microcontroller based system which is designed to perform a
specific task.
◦ Can be an independent system or a part of a large system
OVERVIEW
What is Microcontroller?
◦ A single-chip VLSI unit which is also called microcomputer
◦ It contains all the memory and I/O interfaces needed
What is Microprocessor?
◦ A single chip semiconductor device
◦ Contains a program counter, an ALU, a stack pointer, working register and a clock
timing circuit
◦ Also includes ROM and RAM, memory decoder and many serial and parallel
ports
Embedded System components
Memory
Types of Embedded Systems
Advantages of Embedded System
Covers a wide variety of environments Useful for mass production
◦C
◦ C++
◦ Assembly
Microcontrollers RELEVANT
◦ ATMega328P TOOLS
◦ ATTiny84
In-Circuit Programmer/ In-System
Programmer/ In-Circuit Serial Programmer
◦ Arduino
Performance Safety
STANDARDS
Efficiency Security
AND
ENGINEERING
CONSTRAINTS
Reliability Usability
Robustness
CHARACTERISTICS OF EMBEDDED SYSTEM
BASIC SOFTWARE TECHNIQUES FOR EMBEDDED
APPLICATIONS
CHARACTERISTICS OF
EMBEDDED SYSTEM
1. Single-functioned
◦ Performs a specialized operation
◦ Simple
◦ Low cost
◦ Less complex
2. Tightly Constrained
Examples:
◦ Personal Computer
Failure to meet deadline results in ◦ Audio and Video
degraded performance
Systems
Timing is critical
Hard Real-
Failure to meet deadline can result in
Time Systems
disaster
4. Perform Specific Task
◦ Total focus of the processor is to perform a single dedicated task
5. User Interface
◦ Used by user to interact with the system
◦ Touchscreen or LCD
6. Processors in Embedded Systems
On-Chip
Packaging Cost Performance
Features
Size
7. Ready-Made Boards
◦ Arduino Board
◦ Raspberry Pi
◦ Banana Pi
◦ Intel Galileo
◦ Beaglebone
BASIC SOFTWARE TECHNIQUES FOR
EMBEDDED APPLICATIONS
Embedded Software
2. Compiler
Object code is in low level
programming language therefore
it is understandable by computer
Converts an assembly
language code into machine
language
3. Assembler
All mnemonics and data is
converted to op codes and
bits
Used to debug code
4. Debugger
Tests for errors and bugs
◦ Combines one or more object
code files and library files 5. Linker
together in executable program
Pre-written program that is ready
to use and provides specific
functionality
6. Libraries
File written in C or C++ and can
be used by different programs
and users
Helps to see how the code will
work in real time
7. Simulator
Input values can be changed to
see corresponding outputs
Integrated
Development
Environment (IDE)
• MPLAB and
PICKIT
• Arduino Software
• MATLAB
• LabVIEW
• Visual Studio
MPLAB
◦ is a proprietary freeware integrated development
environment for the development of embedded
applications on PIC and dsPIC microcontrollers, and
is developed by Microchip Technology.
Each character is
headed by a beginning There may be gaps or
bit and concluded spaces in between
with one or more end characters.
bits.
Emails
Forums
Examples of
Letters
Asynchronous
Transmission
Radios
Televisions
Synchronous
Transmission
• Data moves in a
completely paired
approach, in the
form of chunks or
frames
Characteristics of Synchronous Transmission
Video conferencing
Examples of
synchronous
Telephonic conversations Transmission
Face-to-face interactions
PERIODIC INTERRUPTS,
WAVEFORM GENERATION,
TIME MEASUREMENT
A signal to the
processor emitted
by hardware or
software
INTERRUPTS indicating an
event that needs
immediate
attention.
Low level programming concept
Irreplaceable
ORIGIN OF INTERRUPTS
Normal view of a computer program: sequence of
instructions executed serially, jumps are allowed.
This view isn’t good enough for the real world.
Programs for embedded systems usually service
real-life demands.
Real-life demands don’t wait for anything.
Consider a typical embedded system program: it
usually consists of an infinite loop, called the
“program loop”.
In each iteration, the program checks whether
events have occurred, gives suitable responses and
performs periodic tasks.
This model is sufficient if processor is extremely
fast with respect to real world.
We need a method to handle
events the moment they occur, and
not after some delayed time.
Interrupt The microcontroller gets the address of the ISR from the
interrupt vector table and jumps to it. It starts to execute the
interrupt service subroutine, which is RETI (return from
interrupt).
OVERFLOW interrupt
Suppose a timer of maximum value n has a
time period t (also called as clock period).
PWM (Phase
Suppose desired output is x% of 5V. If,
Width for a time period t, the output is 5V for
x% time and is 0 for the remaining time,
then average voltage is x% of 5V.
Modulation)
Mode If this time period is extremely small
and the process is repeated
continuously, then output behaves as
analog value.
PWM (Phase Width Modulation)
Mode
If clock time period is t and maximum timer value
PWM (Phase 1.
is n:
Timer cycle time period = (𝑛 + 1) × 𝑡
Width 2. Frequency = 1 /(𝑛+1)×𝑡
3. Duty cycle = 𝑂𝐶𝑅+1 /𝑛+1 × 100%
Modulation) 4. Output voltage = (𝑂𝐶𝑅+1/ 𝑛+1 ) × 5𝑉