MUCLecture 2022 41025606
MUCLecture 2022 41025606
Lecture 1:
Introduction to Microcontroller
Embedded Systems
An embedded system is a smart system that consists of both hardware and
software designed to perform a set of tasks.
Microprocessor
Microprocessors are the core of any modern computer: they are single chip
processing units responsible for computing each operation stored in the
program.
Microcontroller
A microcontroller is a small and low-cost microcomputer, which is designed
to perform the specific tasks of embedded systems.
Note:
We use the word “peripheral” to describe the hardware modules that
help a microcontroller to interact with the external system.
1
Microcontroller Design Dr. Shayma Akram Yousif
2
Microcontroller Design Dr. Shayma Akram Yousif
Microcontroller Components
Types of Memory
Three types of memories are commonly used in modern microcontrollers.
1. Random Access Memory (RAM)
2. Electrically Erasable Programmable Read-Only Memory
(EEPROM)
3. Flash Memory
Flash Memory
- Flash Memory is also non-volatile memory.
3
Microcontroller Design Dr. Shayma Akram Yousif
Control Unit
a control unit controls the operations of all parts of the computer but it
does not carry out any data processing operations. Some main
functions of the control unit are listed below:
1. Arithmetic Section
2. Logic Section
Registers
▪ Registers are temporary storage areas within a CPU. They are used
to store the information about the program flow, program status,
instruction results, and the hardware configuration.
▪ This is the single main reason why CPU prefers registers over the
memory for operations involving immediate data access.
4
Microcontroller Design Dr. Shayma Akram Yousif
Clock
You need a Clock Signal which can synchronize each activity of the CPU
with a rising or falling edge. Moreover, the frequency of the clock
signal will specify the execution period for each instruction. Higher the
frequency, lower the execution time.
I/O Ports
• I/O Ports provide the user input data from input devices to the CPU.
Bus
▪ The bus will establish a communication link between different
components.
▪ There are three kinds of buses which are mostly used in
microcontrollers:
Types of Microcontroller
There are different types of Microcontrollers available and are classified
based on Bus-width, Memory, Insutruction Set, Architecture, and
Manufacturer.
5
Microcontroller Design Dr. Shayma Akram Yousif
▪ In an 8-bit microcontroller, the point when the internal bus is 8-bit then
the ALU performs the arithmetic and logic operations.
▪ The 16-bit microcontroller performs greater precision and
performance as compared to the 8-bit.
▪ The 32-bit microcontroller uses the 32-bit instructions to perform the
arithmetic and logic operations. These are used in automatically
controlled devices including implantable medical devices, engine
control systems, office machines, appliances, and other types of
embedded systems.
• External Memory
In the case of external memory microcontrollers, memory is not
interfaced within the microcontroller. Rather, the user needs
to connect an external memory to store instructions/data.
• Embedded Memory
For embedded memory microcontrollers, memory
is embedded inside the microcontroller.
6
Microcontroller Design Dr. Shayma Akram Yousif
Based on instruction set, microcontrollers are classified into two types i.e
CISC-CISC and RISC-RISC.
7
Microcontroller Design Dr. Shayma Akram Yousif
There is only one bus required for accessing data and fetching instructions.
Thus, both operations cannot be done at the same time and they must be
scheduled. This is why von Neumann architecture based microcontroller
takes two machine cycles to complete an instruction. Since it uses a single
bus system, its design is simple and production is very low compared to
Harvard architecture.
8
Microcontroller Design Dr. Shayma Akram Yousif
8051 Microcontroller
9
Microcontroller Design Dr. Shayma Akram Yousif
AVR Microcontroller
ADC takes Analog inputs and converts them to digital values. These digital
values are then fed into CPU for further processing.
Microcontroller Applications
• Baby Monitors
• Fire Detection
• Internet of Things
• Home Automation
• Light Sensing
• LED Control
• Low-Cost Wearables
• Medical Equipment
• Sub-Marines
• Ships
• Aerospace System
• and many more…
10