Course Title: Embedded systems
Fourth Year
Electronics and Communications Engineering
Course Objectives
The first objective of this course is to present the design,
implementation, and programming of embedded systems. The
second objective is to build some embedded systems for some
applications. The third objective is to provide an understanding
for the practical engineering issues raised by the design,
implementation, and programming of embedded systems.
Course Contents
1. Introduction to Embedded systems
1.1 Definition of embedded systems
1.2 General block diagram of embedded systems
1.3 Characteristics of embedded systems
1.4 Characteristics of sensors, actuators, ADCs, and DACs
2. Architecture of Microcontrollers
2.1 Definition of Microcontrollers
2.2 General architecture of microcontrollers
2.3 Architecture of Atmel AVR ATmega16 microcontroller
2.4 Programmable parallel Input/Output Ports
3. Mechanisms for Interacting the CPU with Input/Output Devices
3.1 Introduction
3.2 Polling Mechanism
3.3 Interrupt Mechanism
3.4 Interrupt System of ATmega16 microcontroller
3.5 Interrupt Execution
4. Structure and Theory of operation of timers
4.1 Introduction
4.2 Structure and theory of operation of N-bit Timers
4.3 Structure of Timer0 of ATmega16 microcontroller
4.4 Modes of operation of timer0
4.4.1 Normal Mode (overflow mode)
4.4.2 CTC mode (clear timer on compare match mode)
4.4.3 Phase correct Pulse width modulation (PWM) mode
4.4.4 Fast PWM mode
5. The ADC system of ATmega16 Microcontroller
5.1 Block diagram for the ADC system
5.2 ADC control and status register A (ADCSRA)
5.3 ADC Multiplexer Selection Register (ADMUX)
5.4 ADC Data Register
6.Timer1 of ATmega16 microcontroller
6.1 Block Diagram of timer1 of ATmega16 Microcontroller
6.2 Timer1 registers
6.3 Modes of operation for Timer1 of ATmega16 MC
7. Serial Communications
7.1 Introduction
7.2 Serial Communication Ports of ATmega16 Microcontroller
7.3 Serial Communication Terminology
7.3.1 Asynchronous versus Synchronous Serial Transmission
7.3.2 Baud Rate
7.3.3 Full Duplex
7.4 The RS-232 Communication Protocol
7.4.1 Serial Data Packet
7.4.2 Parity
7.5 Serial USART
7.5.1 USART Clock and Baud Rate Generator
7.5.2 USART Transmitter
7.5.3 USART Receiver
7.5.4 USART Control and Status Registers
7.5.5 USART Transmitter/Receiver
7.5.6 USART Operation and Programming
1. Introduction to Embedded Systems
1.1 Definition of Embedded Systems
• An embedded system is special-purpose computer which is
designed to control (monitor and direct) the operation of
another system such as a mechanical or electrical system. The
word embedded reflects the fact that the embedded system is
completely encapsulated by the system it controls.
• An Embedded system can also be defined as a microprocessor-
based system or a microcontroller-based system which is
designed to control the operation of another system.
Embedded systems are found in robots, airplanes, drones, cell
phones, digital cameras, portable video games, microwave ovens,
home security systems, washing machines, copiers, printers,
scanners, automated teller machines (ATMs), cars.
1.2 General block diagram of an embedded system
1.3 Characteristics of Embedded Systems
a) Embedded systems are application specific devices, application is known apriori,
the programs are executed repeatedly.
b) Efficiency is important for embedded systems. They are optimized for energy,
code size, execution time, weight, dimensions, and cost.
c) Embedded systems are typically designed to meet real time constrains (embedded
systems must take the necessary action at the right time).
d) Embedded systems interact (sense, manipulate and communicate) with external
world through sensors and actuators.
e) They generally have minimal or no user interface.
Characteristics of Sensors, Actuators, ADCs, and DACs
These four devices are linear devices. That is, the output of
any these devices equals some constant multiplied by the
input (output = K input).
Sensors:
Sensor
Vs
Physical energy
(physical Variable)
Sensors produce output voltage (Vs) proportional to the value of the
physical variable to be monitored or measured.
Vs
Delta Vs
Delta physical Variable
Physical variable
Input/output characteristic of a sensor
Sensor sensitivity (S) = delta Vs / delta physical variable.
Vs = S * (physical Variable)
Actuators:
Physical Variable
Delta physical variable
Delta input voltage
Input Voltage
Input/Output characteristic of an actuator
Actuator Sensitivity (S) = delta physical variable/delta input voltage
Physical Variable (output) = S * (input voltage)
Analog-to-Digital Converters (ADCs)
ADCs are linear devices that convert an analog voltage value into a binary number.
The value of the binary number is proportional to the analog voltage value.
For example, consider a 12-bit ADC with full scale voltage of 5 volts as shown in
the next slide. Then, for analog input voltage of 3V, the output binary value will be
as follows:
Output binary value = (4095 / 5) * 3 = (2458)10 = (100110011010)2
D0
D1
Binary output
12-bit ADC
. .
Analog Input Voltage
with VFS = 5V
.
D11
Block diagram of a 12-bit ADC showing input and outputs
Digital-to-Analog Converters (DACs)
DACs convert binary values to analog values. DACs are linear devices
that give output analog voltage proportional to the value of the input
binary number. For example, consider an 8-bit DAC, as shown in the
next slide, that has maximum output voltage of 5 volts.
Then, for input binary value of 10011101 = (157)10, the analog output
voltage will be:
VO = (5/255) (157) = 3.078 Volts.
D0
D1
8-bit DAC
Binary Input with Analog output Voltage
maximum
. . .
output
voltage of 5V
D7
Inputs and output of an 8-bit DAC