Introduction To Embedded Systems S2024
Introduction To Embedded Systems S2024
Introduction
1
Course Description
2
Course Main Objective(s):
3
Course Learning Outcomes (CLOs)
1 Knowledge and Understanding
1.1 Describe the basics and architecture of an embedded K1
system.
1.2 Describe the basics and architecture of common K1
microcontrollers.
2 Skills:
2.1 Design embedded systems and real-time systems to S1
solve real life engineering problems.
4
- Embedded System Design: A Unified
Hardware/Software Introduction- Frank Vahid and
Tony Givargis, John Wiley & Sons; ISBN: 0471386782.
2002
Required Textbooks
- Microcontroller Theory and Applications with the
PIC18F, M. Rafiquzzaman, Wiley; 2nd edition
(January 11, 2018), ISBN-10 : 1119448417, ISBN-13
: 978-1119448419
- Edward Ashford Lee, Sanjit Arunkumar Seshia `
Introduction to -Embedded Systems - A Cyber-
Physical Systems Approach` Publisher: UC Berkeley
Essential 1st Edition 2013
References - Exploring Arduino “Tools and Techniques for
Materials Engineering Wizardrye” by Jeremy Blum 2019, ISBN
1119405351 Ed John Wiley and Sons.
5
Course Topics
1. Introduction and Overview of Embedded Systems and
MicroControllers
2.
Interfacing: Interrupts - Communication and protocols
3.
Embedded System memory and peripherals
4.
PIC Microcontrollers
5.
Midterm-exam
6.
AVR MicroControllers
7.
Development boards – Arduino
8.
Sensors and Actuators
9.
Real-time Embedded Systems - Operating Systems and Design
10.
Wireless and Internet Embedded Systems: IoT (If time permits)
6
Assessment & Grading Policy
Assessment timing Percentage of Total
No Assessment Activities *
(in week no) Assessment Score
8
Embedded System Definitions
Source: www.computeruser.com/resources/dictionary
9
Introduction to Embedded Systems
➢ An embedded system is designed to run on
its own without human intervention, and may
be required to respond to events in real time.
12
Embedded System’s General Block Diagram
Software
Microcontroller
in some systems
PROCESSOR
MEMORY
Peripherals:
Application-specific logic
• Timers
• A/D and D/A conversion
•I/O Interfacing
EMBEDDED SYSTEM
Main Components of Embedded Systems
• Analog Components
• Sensors, Actuators, Controllers, …
• Digital Components
Hardware
• Processor, Coprocessors
• Memories
• Controllers, Buses
• Application Specific Integrated Circuits (ASIC)
• Converters – A2D, D2A, …
• Software Software
• Application Programs
• Exception Handlers
14
Embedded Systems Processors
15
Types of Embedded Processors
➢ Computational micros (32- or 64-bit datapaths)
• CPU of workstations, PCs, or high-end portable devices (PDAs)
• x86, PA-RISC, PowerPC, SPARC, etc.
➢ Embedded general purpose micros (32-bit datapaths)
• Designed for a wide range of embedded applications
• Often scaled-down version of computational micros
• ARM, PowerPC, MIPS, x86, 68K, etc.
➢ Microcontrollers (4-, 8-, or 16-bit datapaths)
• Integrate processing unit, memory, I/O buses, and peripherals
• Often low-cost, high-volume devices
➢ Domain-specific processors (datapath size varies greatly)
• Designed for a particular application domain
• Digital signal processors, multimedia processors, graphics
processors, network processors, security processors, etc.
Slide credit - Mike Schulte
16
Microcontroller
❑Processor – Instruction Set + memory + accelerators
❑Memory
❖ Non-Volatile
oROM
oEPROM, EEPROM, Flash
❖ Volatile
oRAM (DRAM, SRAM)
❑Peripherals: Timers, A/D, Comparators, ..etc.
❑Interfaces
❖ H/W: Ports
❖ S/W: Device Driver
❖ Parallel, Serial, Analog, Time
❑I/O
• Memory-mapped vs. I/O-instructions (I/O-mapped)
Some Common Characteristics of
Embedded Systems
➢ Single-functioned
• Executes a single program, repeatedly
➢ Tightly-constrained
• Low cost, low power, small, fast, etc.
19
An Embedded System Example
• Digital Camera
Digital camera chip
CCD
lens
gearboxes
❑ Theft prevention with smart
keys
❑ Blind-angle alert systems
address
Program
Memory
data PE
(Processing Element)
address
Data
data
Memory
Von-Neumann Architecture
address
PE
Read/Write (Processing Element)
Memory data
27
Harvard vs Von-Neumann
Harvard: Von Neumann:
• Two memories with two Buses • Content of the memory if organized
allow parallel access to data and all installed memory can be
access and instructions. used.
• Control unit for two buses is • One bus is simpler for the control
more complicated and more unit design
expensive. • Computer with one bus is cheaper.
• Program can’t write itself. • Error in a program can rewrite
• Both memories can use instruction and crash program
different sizes. execution.
• Development of a complicated • Development of the Control Unit is
Control Unit needs more time. cheaper and faster.
• Data and instruction is accessed in
• Free data memory can’t be
the same way.
used for instruction and vice-
versa. • One Bus ( for Data, instruction and
devices) is a bottleneck. 28
Harvard vs Von-Neumann
29
Embedded system functionality aspects
➢ Processing
• Transformation of data
• Implemented using processors
➢ Storage
• Retention of data
• Implemented using memory
➢ Communication
• Transfer of data between processors and memories
• Implemented using buses
• Called interfacing
30
Processing
Microcontrollers vs. Microprocessors
➢ Microprocessor
▪ CPU (on single chip)
➢ Microcontroller
▪ CPU
▪ RAM + ROM
▪ I/O
▪ Timers
▪ Other devises such as Analog-to-digital converter.
31
Overview of Microcontrollers
▪ Benefits
➢Typically low-power/low-cost
➢Easily programmable
▪ Limitations
➢Small storage space (registers, memory)
➢Restricted instruction set
➢Not typically used for high performance
33
Microcontroller Packaging and Appearance
36
Microcontroller choice parameters
• Number of I/O pins (Analog/Digital)
• Amount of program and data memories
• Speed
• Timer Resources
• Interrupt control
• Robustness
• Error recovery – watchdog timers
• Power
• I/O expansion
• Math support.
37
Storage
• What is a memory?
• Artifact that stores bits
• Storage fabric and access logic
• Write-ability
• Manner and speed a memory can be written
• Storage-permanence
• ability of memory to hold stored bits after they
are written
• Many different types of memories
• Flash, SRAM, DRAM, etc.
• Common to compose memories
38
38
Communication
➢ What is a bus?
• An artifact that transfers bits
• Wires, air, or fiber and interface logic
42
Peripherals in Embedded Systems
44
Timers
The timer module, which is strictly speaking a counter
module, is an important part of every microcontroller,
Peripherals in Embedded Systems
46
46
Watchdog Timer
• The watchdog timer, also sometimes called COP
(computer operates properly), is used to monitor
Peripherals in Embedded Systems
high/low times
• Duty cycle: % time high
• Square wave: 50% duty cycle
• Common use: control average
voltage to electric device
• Simpler than DC-DC converter or digital-analog
converter
• Applications: DC motor speed, dimmer lights.
48
48
UART
• UART: Universal Asynchronous
Receiver Transmitter:
Peripherals in Embedded Systems
49
49
LCD
• N rows by M columns
• Controller build into the
LCD module
• Simple microprocessor
interface using ports
• Software controlled
50
50
Keypad
N1
Peripherals in Embedded Systems
N2
N3 k_pressed
N4
M1
M2
M3
M4 4
key_code key_code
keypad controller
51
N=4, M=4
51
52
Peripherals in Embedded Systems
ADC