Chapter-1A: Introduction To Microcontroller
Chapter-1A: Introduction To Microcontroller
INTRODUCTION TO MICROCONTROLLER
Fundamentals of
microcontroller/microprocessor
EETe 3032
1
By Zemenu T. /2022
Outlines
1.Introduction
2.A Brief History of Microprocessor and microcontroller
3.Microprocessors and Microcontroller comparison
4.Structure of a basic computer system,
5. The microcontroller architecture
6. CPU families used in microcontrollers,
7.Types of Memories
8.Memory organization, Registers and Clock concept
2
Introduction
Circumstances that we find ourselves in today in the field of microcontrollers had
their beginnings in the development of technology of integrated circuits. This
development has made it possible to store hundreds of thousands of transistors into
one chip. That was a prerequisite for production of microprocessors, and the first
computers were made by adding external peripherals such as memory, input-output
lines, timers and other. Further increasing of the volume of the package resulted in
creation of integrated circuits. These integrated circuits contained both processor
and peripherals. That is how the first chip containing a microcomputer, or what
would later be known as a microcontroller came about.
3
What is a Microcontroller?
A Microcontroller is a VLSI IC that contains a CPU (Processor) along with some other
peripherals like Memory (RAM and ROM), I/O Ports, Timers/Counters, Communication
Interface, ADC, etc. The following image shows the basic components of a
Microcontroller. As all the components (and a few other components) are integrated on
a single chip (Integrated Circuit – IC), a Microcontroller can be considered as a
Microcomputer (or a Computer on – chip).
4
CPU (Central Processing Unit)
It is the heart of the Microcontroller that mainly comprises of an Arithmetic Logic Unit
(ALU) and a Control Unit (CU) and other important components. The CPU is the
primary device in communicating with peripheral devices like Memory, Input and
Output.
ALU or Arithmetic Logic Unit, as the name suggests, performs the Arithmetical and
Logical Operations. CU or Control Unit is responsible for timing of the communication
process between the CPU and its peripherals
5
Microprocessor
Microprocessor is the brain of computer, which does all the work. It is a computer
processor that incorporates all the functions of CPU (Central Processing Unit) on a
single IC (Integrated Circuit) or at the most a few ICs. Microprocessors were first
introduced in early 1970s. 4004 was the first general purpose microprocessor used by
Intel in building personal computers. Arrival of low cost general purpose microprocessors
has been instrumental in development of modern society the way it has.
6
Microcontrollers Vs Microprocessors
In order to make Microprocessor work or build a system around it, we need to interface
the peripherals separately.
8
The following table highlights the differences between a microprocessor and a
microcontroller −
Microprocessor Microcontroller
Microprocessors are multitasking in nature. Can Single task oriented. For example, a washing
perform multiple tasks at a time. For example, on machine is designed for washing clothes only.
computer we can play music while writing text in text
editor.
RAM, ROM, I/O Ports, and Timers can be added RAM, ROM, I/O Ports, and Timers cannot be added
externally and can vary in numbers. externally. These components are to be embedded
together on a chip and are fixed in numbers.
Designers can decide the number of memory or I/O Fixed number for memory or I/O makes a
ports needed. microcontroller ideal for a limited but specific task.
External support of external memory and I/O ports Microcontrollers are lightweight and cheaper than a
makes a microprocessor-based system heavier and microprocessor.
costlier.
External devices require more space and their power A microcontroller-based system consumes less
9
consumption is higher. power and takes less space.
Basic Structure of Computer
A computer system is basically a machine that simplifies complicated tasks. It should
maximize performance and reduce costs as well as power consumption. All types of
computers follow a same basic logical structure and perform the following five basic
operations for converting raw input data into information useful to their users.
Following diagram shows the basic structure of Computer:
Input Unit
This unit contains devices with the help of which we enter data into computer. This unit
makes link between user and computer. The input devices translate the information into
10
the form understandable by computer.
CPU (Central Processing Unit)
CPU is considered as the brain of the computer. CPU performs all types of data
processing operations. It stores data, intermediate results and instructions(program). It
controls the operation of all parts of computer.
CPU itself has following three components
•ALU(Arithmetic Logic Unit)
•Memory Unit
•Control Unit
Output Unit
Output unit consists of devices with the help of which we get the information from
computer. This unit is a link between computer and users. Output devices translate the
11
computer’s output into the form understandable by users.
S.No. Operation Description
The process of entering data and instructions into the
1 Take Input
computer system
Saving data and instructions so that they are available for
2 Store Data
processing as and when required.
Performing arithmetic, and logical operations on data in
3 Processing Data
order to convert them into useful information.
The process of producing useful information or results for
4 Output Information
the user, such as a printed report or visual display.
Control the Directs the manner and sequence in which all of the
5
workflow above operations are performed.
12
Development/Classification of microcontrollers
13
Development/Classification of microcontrollers (Contd.)
15
Microcontroller basics
Information organization
- Categorized as either instructions or data
-Instructions (or machine instructions) are explicit commands that
• Govern the transfer of information within a microcontroller as well as between
the microcontroller and its I/O devices.
•Specify the arithmetic and logic operations to be performed.
•Programs
- A list of instructions that performs a task is called a program.
- Usually the program is stored in memory.
- The program fetches the instructions from memory, one after another, and performs
the desired operations.
- The microcontroller is completely controlled by the stored program, except for
possible interruption by an operator or by I/O devices connected to the machine.
- Data are numbers and encoded characters that are used as operands by the
instructions.
16
Internal Structure of a Microcontroller
At times, a microcontroller can have external memory also (if there is no internal
memory or external memory interface is required). Early microcontrollers were
manufactured using bipolar or NMOS technologies. Most modern microcontrollers are
manufactured with CMOS technology, which leads to reduction in size and power loss.
Current drawn by the IC is also reduced considerably from 10mA to a few micro
Amperes in sleep mode (for a microcontroller running typically at a clock speed of
20MHz).
17
Internal Structure of a Microcontroller (Cont’d)
18
Bus Structure
Bus - a group of parallel wires that transfer information from one part of
the computer to another.
Control Bus
synchronizes the actions of all of the devices attached to the system bus.
Address Bus
passes the addresses of instructions and data between the CPU and memory
(or I/O).
Data Bus
transfers instructions and data between the CPU and memory (or I/O).
19
Block diagram of a microcontroller system
20
21
Types of Computer Architecture
22
Von Neumann Architecture
Von Neumann Architecture or Princeton Architecture is a Computer Architecture, where
the Program i.e. the Instructions and the Data are stored in a single memory.
Since the Instruction Memory and the Data Memory are the same, the Processor or CPU
cannot access both Instructions and Data at the same time as they use a single bus.
This type of architecture has severe limitations to the performance of the system as it
creates a bottleneck while accessing the memory.
23
Harvard Architecture
Harvard Architecture, in contrast to Von Neumann Architecture, uses separate
memory for Instruction (Program) and Data. Since the Instruction Memory and Data
Memory are separate in a Harvard Architecture, their signal paths i.e. buses are also
different and hence, the CPU can access both Instructions and Data at the same time.
Almost all Microcontrollers, including 8051 Microcontroller implement Harvard
Architecture.
24
CISC and RISC
CISC is a Complex Instruction Set Computer. It is a computer that can address a large number of
instructions. In the early 1980s, computer designers recommended that computers should use fewer
instructions with simple constructs so that they can be executed much faster within the CPU without
having to use memory. Such computers are classified as Reduced Instruction Set Computer or RISC.
CISC vs RISC
CISC RISC
27
Program Memory Types
3. OTP EPROM: One time programmable (OTP) EPROM based microcontrollers do not
have any glass window for UV erasing. These can be programmed only once. This type
of packaging results in microcontroller that have the cost 10% of the microcontrollers
with UV erase facility (i.e., 1/10th cost).
I/O Registers:
31
Organization of Data Memory (Contd.)
Hardware interface registers (I/O Space)
32
33