0% found this document useful (0 votes)
59 views72 pages

Microcontroller and Microprocessor Part I

Microcontrollers are single integrated circuits that are used to control specific applications. They contain a CPU, RAM, ROM and input/output components on a single chip. Microcontrollers are embedded in devices to control their features and actions. They are dedicated to running a single program stored in ROM. Examples of microcontrollers include those used in appliances, power tools, automobiles and other embedded systems. Microcontrollers come in 8-bit, 16-bit and 32-bit varieties depending on their data bus width and processing capabilities. They can also be classified based on whether they have external or embedded memory.

Uploaded by

2021308464
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
59 views72 pages

Microcontroller and Microprocessor Part I

Microcontrollers are single integrated circuits that are used to control specific applications. They contain a CPU, RAM, ROM and input/output components on a single chip. Microcontrollers are embedded in devices to control their features and actions. They are dedicated to running a single program stored in ROM. Examples of microcontrollers include those used in appliances, power tools, automobiles and other embedded systems. Microcontrollers come in 8-bit, 16-bit and 32-bit varieties depending on their data bus width and processing capabilities. They can also be classified based on whether they have external or embedded memory.

Uploaded by

2021308464
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 72

Microcontroller and

Microprocessor System
Enmar T. Tuazon
Computer

A programmable machine and


can execute a programmed list of
instructions and respond to new
instructions that it is given.
Computer Architecture

The organization of the components


making up a computer system and
the semantics or meaning of the
operations that guide its function.
Computer Architecture

A specification detailing how a


set of software and hardware
technology standards interact to
form a computer system or
platform.
Categories of Computer Architecture
System Design
This includes all hardware components in the
system, including data processors aside from the
CPU, such as the graphics processing unit and
direct memory access. It also includes memory
controllers, data paths and miscellaneous things
like multiprocessing and virtualization.
Example:
Instruction Set Architecture (ISA)

This is the embedded programming


language of the central processing
unit. It defines the CPU's functions
and capabilities based on what
programming it can perform or
process.
Microarchitecture

Otherwise known as computer


organization, this type of
architecture defines the data paths,
data processing and storage
elements, as well as how they
should be implemented in the ISA.
Example:
Microprocessor
Like any other system, a microprocessor has inputs,
outputs and a process. The inputs and outputs of a
microprocessor are a series of voltages that can be
used to control external devices. The process involves
analyzing the input voltages and using them to ‘decide’
on the required output voltages. The decision is based
on previously entered instructions that are followed
quite blindly, sensible or not.
Microprocessor
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.
Microprocessors Characteristics
Clock Speed
The speed at which the microprocessor executes instructions.
Currently microprocessors have clock speed in the range of 3 GHz,
which is maximum that current technology can attain. Speeds more
than this generate enough heat to damage the chip itself. To overcome
this, manufacturers are using multiple processors working in parallel on
a chip.
Microprocessors Characteristics
Word Size
Number of bits that can be processed by a processor in a single
instruction.
First commercial microprocessor Intel 4004 was a 4-bit processor. It
had 4 input pins and 4 output pins. Number of output pins is always
equal to the number of input pins. Currently most microprocessors use
32-bit or 64-bit architecture.
Microprocessors Characteristics
Instruction Set
A command given to a digital machine to perform an operation on a
piece of data.
Example:
• Data transfer
• Arithmetic operations
• Logical operations
• Control flow
• Input/output and machine control
Microprocessor Components
Arithmetic and Logic Unit
Performs math computations, such as
subtraction, addition, division and Boolean
functions. Boolean functions are a type of logic
used for circuit designs. The ALU also executes
comparisons and logic testing. The processor
transmits signals to the ALU, which interprets the
instructions and performs the calculations.
Example:
Microprocessor Components
Registers
Microprocessors have temporary data holding
places called registers. These memory areas
maintain data, such as computer instructions,
storage addresses, characters and other data.
Some computer instructions may require the use
of certain registers as part of a command.
Example:
Microprocessor Components
Control Unit
Control units (CUs) receive signals from the CPU, which
instructs the control unit to move data from
microprocessor to microprocessor. The control unit also
directs the arithmetic and logic unit. Control units
consist of multiple components, such as decoder, clock
and control logic circuits. Working together, these
devices transmit signals to certain locations on the
microprocessor.
Microprocessor Components
Buses
Microprocessors have a system of buses, which
move data. Buses refer to classifications of wiring
that have specific tasks and functions. The data
bus transfers data between the central processing
unit and random access memory (RAM) -- the
computer's primary memory.
Microprocessor Components
Cache Memory
Some advanced microprocessors have
memory caches, which retain the last data
used by the CPU. Memory caches speed up
the computing process, because the CPU
does not have to go to the slower RAM to
retrieve data.
Example:
A microprocessor is a very small electronic circuit typically 1 ⁄2 inch (12
mm) across. It is easily damaged by moisture or abrasion so to offer it
some protection it is encapsulated in plastic or ceramic.
Example of Microprocessors :
Microcontroller
A microcontroller (sometimes called an MCU or
Microcontroller Unit) is a single Integrated Circuit (IC)
that is typically used for a specific application and
designed to implement certain tasks.
Products and devices that must be automatically
controlled in certain situations, like appliances, power
tools, automobile engine control systems, and
computers are great examples, but microcontrollers
reach much further than just these applications.
History of Microcontroller
• In 1971 two companies, both in the USA, introduced
the world to its future by producing
microprocessors. They were a young company called
Intel and their rival, Texas Instruments.
• It was during 1970 and 1971 when Intel was working
on inventing the world’s first microprocessor,
that Gary Boone of Texas Instruments was working
on quite a similar concept and invented the
microcontroller.
How do they work?

A system must have at least one input,


one output and must do something, i.e. it
must contain a process. Often there are
many inputs and outputs. Some of the
outputs are required and some are waste
products.
First microcontroller implemented in a four-function calculator
A microcontroller is a computer. All computers , whether we are talking
about a personal desktop computer or a large mainframe computer or
a microcontroller have several things in common:
• All computers have a CPU (central processing unit)
that executes programs. If you are sitting at a desktop
computer right now reading this presentation the CPU
in that machine is executing a program that
implements the Web browser that is displaying this
page.
• The CPU loads the program from somewhere. On your
desktop machine, the browser program is loaded from
the hard disk.
• The computer has some RAM(random-access
memory) where it can store "variables.“
• And the computer has some input and output devices
so it can talk to people. On your desktop machine,
the keyboard and mouse are input devices and
the monitor and printer are output devices. A hard
disk is an I/O device -- it handles both input and
output.
Characteristics of a Microcontroller
• Microcontrollers are "embedded" inside some other device (often a
consumer product) so that they can control the features or actions of
the product. Another name for a microcontroller, therefore, is
"embedded controller."
• Microcontrollers are dedicated to one task and run one specific
program. The program is stored in ROM (read-only memory) and
generally does not change.
• Microcontrollers are often low-power devices. A desktop computer is
almost always plugged into a wall socket and might consume 50 watts
of electricity. A battery-operated microcontroller might consume 50
milliwatts.
Examples of Microcontrollers:
Difference between a MCU and Logic chip
• MCU – Microcontroller has a CPU, in addition
with a fixed amount of RAM, ROM and other
peripherals all embedded on a single chip.

• Logic Chip - is an IC which has only the CPU


inside them.
Types of Microcontrollers
Classification According to Number of Bits
In 8-bit microcontroller, the point when the internal bus is 8-bit then
the ALU is performs the arithmetic and logic operations.
Microcontrollers have a data bus width which describes the amount of
data the MCU can process at a time. For example, an 8-bit
microcontroller can process 8 bits at one time. Popular data bus widths
include 8-bit, 16-bit and 32-bit MCUs.The examples of 8-bit
microcontrollers are Intel 8031/8051, PIC1x and Motorola MC68HC11
families.
Example of 8 bit microcontroller
Microchip PIC16F877A-I/P, 8bit PIC Microcontroller, PIC16F, 20MHz,
14.3 kB, 256 B Flash, 40-Pin PDIP
Example of 8 bit microcontroller
Microchip ATMEGA328P-AUR, 8bit AVR Microcontroller, ATmega,
20MHz, 32 kB Flash, 32-Pin TQFP
The 16-bit microcontroller performs greater precision and performance as
compared to 8-bit. For example 8 bit microcontrollers can only use 8 bits,
resulting in a final range of 0×00 – 0xFF (0-255) for every cycle. In contrast,
16 bit microcontrollers with its 16 bit data width has a range of 0×0000 –
0xFFFF (0-65535) for every cycle. A longer timer most extreme worth can
likely prove to be useful in certain applications and circuits.

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. Some examples
are Intel/Atmel 251 family, PIC3x.
According to Memory/Devices
• External Memory Microcontroller
When an embedded system has a microcontroller unit that has not all the
functional blocks available on a chip. External memory devices are available
in various sizes, so it is easy to add memory to accommodate an increase in
code size

• Embedded Memory Microcontroller


When an embedded system has a microcontroller unit that has all the
functional blocks available on a chip is called an embedded microcontroller.
Internal memory is typically the most cost effective memory type, but it is
also the least flexible.
According to Instruction Set
Complex Instruction Set Computer (CISC) - complex
microcoded instructions which take many clock cycles
to execute. A complex instruction set computer is a
computer where single instructions can perform
numerous low-level operations like a load from
memory, an arithmetic operation, and a memory store
or are accomplished by multi-step processes or
addressing modes in single instructions, as its name
propose “Complex Instruction Set ”.
Reduced Instruction Set Computer (RISC) - simple,
hard-wired instructions which often take only one
or a few clock cycles to execute.
A reduced instruction set computer is a computer
which only uses simple commands that can be
divided into several instructions which achieve
low-level operation within a single CLK cycle, as
its name propose “Reduced Instruction Set ”
According to Memory Architecture
• Harvard Memory Architecture Microcontroller- The point
when a microcontroller unit has a dissimilar memory address
space for the program and data memory.
• Princeton Memory Architecture Microcontroller
(Von Neuman) – The point when a microcontroller has a
common memory address for the program memory and data
memory.
Princeton Architecture Harvard Architecture
VON NEUMANN ARCHITECTURE HARVARD ARCHITECTURE

It is ancient computer architecture based on stored It is modern computer architecture based on Harvard Mark
program computer concept. I relay based model.

Same physical memory address is used for instructions and Separate physical memory address is used for instructions
data. and data.

Separate buses are used for transferring data and


There is common bus for data and instruction transfer.
instruction.

Two clock cycles are required to execute single instruction. An instruction is executed in a single cycle.

It is cheaper in cost. It is costly than van neumann architecture.

CPU can not access instructions and read/write at the CPU can access instructions and read/write at the same
same time. time.

It is used in personal computers and small computers. It is used in micro controllers and signal processing.
Components of a Microcontroller
Types of Microcontrollers
Microcontroller 8051
8051 is an 8-bit family of microcontroller developed by Intel in
the year 1981. This is one of the most popular family of
microcontroller being used all across the world. This
microcontroller was also referred as “system on a chip”
because it has 128 bytes of RAM, 4Kbytes of ROM, 2 Timers, 1
Serial port, and four ports on a single chip. The CPU can work
for only 8bits of data at a time because 8051 is an 8-bit
processor.
Memory Architecture of 8051
• The memory of 8051 is divided into two parts. They are
Program Memory and Data Memory. Program Memory
stores the program being executed whereas Data Memory
temporarily stores the data and the results.
• The 8051 has been in use in a wide number of devices,
mainly because it is easy to integrate into a device.
Microcontrollers are mainly used in energy management,
touch screen, automobiles, and medical devices.
Renesas Microcontroller
Renesas is latest automotive microcontroller family that
offers high performance feature with exceptionally low
power consumption over a wide and versatile extend of
items. This microcontroller offers rich functional
security and embedded safety characteristics required
for new and advanced automotive applications. The
core structure of microcontroller CPU support high
reliability and high performance requirements
The full form of the RENESAS microcontroller is “Renaissance
Semiconductor for Advanced Solutions”. These microcontrollers offer
the best performance to microprocessors as well as microcontrollers to
have good performance features along with its very-low power
utilization as well as solid packaging.
The main features of RENESAS RL78, as well as RX family-based
microcontrollers, include the following.
• The architecture used in this microcontroller is CISC Harvard
architecture which gives high performance.
• The family of RL78 is accessible in 8-bit as well as 16bit
microcontrollers whereas the RX family is a 32-bit microcontroller.
• The RL78 family microcontroller is a low-power microcontroller
whereas the RX family provides high efficiency as well as
performance.
Pin Description
AVR Microcontroller
AVR microcontroller is developed by Alf-Egil Bogen and
Vegard Wollan from Atmel Corporation. The AVR
microcontrollers are modified harvard RISC architecture
with separate memories for data and program and
speed of AVR is high when compare to 8051 and PIC.
The AVR is stands for Alf-Egil Bogen and Vegard
Wollan’s RISC processor.
Difference between 8051 and AVR Controllers

• 8051s are 8-bit controllers based on CISC architecture, AVRs are 8-bit
controllers based on RISC architecture
• 8051 consumes more power than an AVR microcontroller
• In 8051, we can program easily than the AVR microcontroller
• The speed of AVR is more than the 8051 microcontroller
Pin Description
PIC Microcontroller
PIC is a peripheral interface controller, developed
by general instrument’s microelectronics, in the year of
1993. It is controlled by the software. They could be
programmed to complete many task and control a
generation line and many more. PIC microcontrollers
are finding their way into new applications like smart
phones, audio accessories, video gaming peripherals
and advanced medical devices.
Pin Configuration
Advantages

•It is a RISC design


•Its code is extremely efficient, allowing the
PIC to run with typically less program
memory than its larger competitors
•It is a low cost, high clock speed
Comparison
8051 PIC AVR

Bus width 8-bit for standard core 8/16/32-bit 8/32-bit

UART, USART, SPI, I2C,


Communication PIC, UART, USART, LIN, (special purpose AVR
UART, USART,SPI,I2C
Protocols CAN, Ethernet, SPI, I2S support CAN, USB,
Ethernet)

12 Clock/instruction 1 clock/ instruction


Speed 4 Clock/instruction cycle
cycle cycle

Memory ROM, SRAM, FLASH SRAM, FLASH Flash, SRAM, EEPROM

ISA CLSC Some feature of RISC RISC


Memory Von Neumann
Harvard architecture Modified
Architecture architecture

Power Consumption Average Low Low

Tiny, Atmega,
PIC16,PIC17, PIC18,
Families 8051 variants Xmega, special
PIC24, PIC32
purpose AVR

Community Vast Very Good Very Good

NXP, Atmel, Silicon


Manufacturer Labs, Dallas, Cyprus, Microchip Average Atmel
Infineon, etc.
Cost (as
compared to
Very Low Average Average
features
provide)

Known for its Cheap,


Other Feature Cheap
Standard effective

Popular PIC18fXX8, Atmega8, 16,


AT89C51,
Microcontrolle PIC16f88X, 32, Arduino
P89v51, etc.
rs PIC32MXX Community
Advantages of Microcontroller
• Dependable
• Reusable
• Energy-efficient
• Cost-effective
• It requires less time to operate
Advantages of Microcontroller
• These are flexible & very small
• Because of their high integration, its size & cost of the system can be
decreased.
• Interfacing of the microcontroller is easy with additional ROM, RAM &
I/O ports.
• Many tasks can be performed, so the human effect can be reduced.
• It is simple to use, troubleshooting & maintaining the system is
simple.
• It works like a microcomputer without any digital parts
Disadvantages of Microcontroller
• Programming Complexity
• Electrostatic Sensitivity
• Interfacing with high-power devices cannot
possible.
• Its structure is more complex as compared with
microprocessors.
• Generally, it is used in microdevices
Disadvantages of Microcontroller
• It is generally used in micro equipment
• The microcontroller cannot interface a higher power device
directly
• It only performed a limited number of executions
simultaneously

You might also like