Fundamentals of Microprocessor and Microcontroller: Dr. Farid Farahmand
Fundamentals of Microprocessor and Microcontroller: Dr. Farid Farahmand
Chapter 1
Microprocessor and
Microcontroller
4
Amazon Warehouse
Kiva Robot
5
Microprocessor-Based Systems
• Central Processing Unit (CPU)
• Memory
• Input/Output (I/O) circuitry
• Buses
– Address bus
– Data bus
– Control bus
MPU
GP-
CLK Reg
CPU
CPU
Arithmetic
Register Microprocessor-based System
Logic
Arrays
Unit
Control Unit
Microprocessor-Based System with
Buses: Address, Data, and Control
Microprocessor-based Systems
Microprocessor
n The microprocessor (MPU) is a computing and
logic device that executes binary instructions in a
sequence stored in memory.
n Characteristics:
¨ General purpose central processor unit (CPU)
¨ Binary
¨ Register-based
¨ Clock-driven
¨ Programmable
Microprocessor-based Systems
Microprocessor
n contains: Arithmetic
Register
Logic
Arrays
Unit
Control Unit
ALU performs computing tasks – manipulates the data/ performs numerical and logical
computations
Registers are used for temp. storage
Control unit is used for timing and other controlling functions – contains a program
counter (next instruction’s address and status register)
System software: A group of programs that monitors the functions of the entire system
Remember
Microprocessor-based Systems
Memory
Expensive Cheap
Onetime programmable
Fast/ Slow
Electronically Erasable
PROM
Microprocessor-based
-one transistor and one Systems
Memory Classification
capacitor to store a bit
-Leakage problem, thus
requires refreshing
-Used for dynamic
data/program storage
-Cheap and slow!
-4/6 transistor to
save a single bit
- Volatile
- Fast but
expensive
Expensive Cheap
Onetime programmable
Fast/ Slow
Electronically Erasable
PROM
Erasable ROMs
n Marked Programmed ROM
¨ Programmed by the manufacturer
n Programmable ROM (PROM)
¨ Can be programmed in the field via the programmer
n Erasable Programmable ROM (EPROM)
¨ Uses ultraviolet light to erase (through a quartz window)
¨ OTP refers to one-time programmable
n Electrically Erasable Programmable ROM (EEPROM)
¨ Each program location can be individually erased
¨ Expensive
¨ Requires programmer
n FLASH
¨ Can be programmed in-circuit (in-system)
¨ Easy to erase (no programmer)
¨ Only one section can be erased/written at a time (typically 64 bytes at a time)
Microprocessor-based Systems
I/O Ports
n Address bus
n consists of 16, 20, 24, or 32 parallel signal lines (wires) - unidirectional
n these lines contain the address of the memory location to read or written
n Control bus
¨ consists of 4 to 10 (or more) parallel signal lines
¨ CPU sends signals along these lines to memory and to I/O ports
n examples: Memory Read, Memory Write, I/O Read, I/O Write
n Data bus
¨ consists of 8,16, or 32 parallel signal lines
¨ bi-directional
¨ only one device at a time can have its outputs enabled,
¨ this requires the devices to have three-state output
Remember: 111 1111 1111 = 7FF = 2^11-1 = 2047
2^11=2K=2048
2^11 Requires 11 bits
2K
2K
Registers or bytes of
Registers or bytes of
memory
memory
What?
What? How many bits
How many bits
2K
2K
(2^11 = 2048)
(2^11 = 2048)
Registers or bytes of
Registers or bytes of
memory
memory
FFF
2^11 -1=7FF
Requires 12 bits
Requires 11 bits
For a total of 4095 bytes
Total of 4K bytes of memory: 2^12 (FFF) à 12 bits ; last values 2^12-1 = 4096-1
Example
8 bits
000
001
1G bytes of memory
30 bits!
A0
800
ROM RAM
2K 2K
FFF
D7
8-bit
D0
So what are
microcontrollers?
What is a Microcontroller?
n A microcontroller is a small computer on a
single integrated circuit containing
¨ processor core,
¨ memory,
¨ programmable input/output peripherals
n Used for specific (embedded) applications
Embedded controllers
RISC and CISC architectures are becoming more and more alike.
*Read the LINK on the web site!*
The CISC approach
attempts to minimize the
CISC vs RISC number of instructions per
program, sacrificing the
The Performance Equation
number of cycles per
The following equation is commonly
instruction.
used for expressing a computer's
performance ability:
RISC and CISC architectures are becoming more and more alike.
*Read the LINK on the web site!*
8-bit Controllers…
(Main Players)
n Microchip
¨ RISC architecture (reduced instruction set computer)
What is the
¨ Has sold over 2 billion as of 2002 difference?
¨ Cost effective and rich in peripherals Speed
n Motorola Package
¨ CISC architecture
¨ Has hundreds of instructions
Power
¨ Examples: 68HC05, 68HC08, 68HC11 RAM/ROM
n Intel IO Pins
¨ CISC architecture Software (IDE)/cloud
¨ Has hundreds of instructions
¨ Examples: 8051, 8052
¨ Many difference manufacturers: Philips, Dallas/MAXIM Semiconductor, etc.
n Atmel
¨ RISC architecture (reduced instruction set computer) – with CISC instruction set!
¨ Cost effective and rich in peripherals
¨ Claims to be very code efficient – less memory for the same code!
¨ AVR (Advanced Virtual RISC): TunyAVR, MegAVR, XmegaAVR
n Freescale
n Ziglog (Z8)
A Bit About ARMs
Architecture (Advanced RISC Machine)
n ARM design takes the RISC based computer design
approach – Linux –like architecture
n ARM is a British semiconductor (and software) design
company that designs and licenses ARM processor
cores to semiconductor manufacturers
¨ They just sell the ARM core
¨ Other manufacturers license the core from them and then design
microcontrollers around that core by adding in peripherals and
memory to suit their design goals
n There are different cores for different applications
¨ Cortex-M0/M0+, Cortex-M3, or Cortex-M4.
ARM Processor IP
Applications of ARM-Based
Microcontrollers
Who is using ARM? Check this out!
http://en.wikipedia.org/wiki/List_of_applications_of_ARM_cores
Most Cellphones!
Design Examples …..