Lecture-2
Microprocessor Historical Background
Microcontrollers –
Embedded Systems
• An embedded system is a special-purpose computer system
designed to perform one or a few dedicated functions often
with real-time
• An integrated device which consists of multiple devices
– Microprocessor (MPU)
– Memory
– I/O (Input/Output) ports
• Often has its own dedicated software
Microprocessor-Based Systems
• Central Processing Unit (CPU)
• Memory
• Input/Output (I/O) circuitry
• Buses
– Address bus
– Data bus
– Control bus
MPU
CLK Reg
CPU
CPU
Ahritmetic
Register Microprocessor-based System
Logic
Arrays
Unit
Control Unit
Important aste pare
Microprocessor-Based System with Buses:
Address, Data, and Control
Microprocessor-based Systems
Microprocessor
• The microprocessor (MPU) is a computing and logic
device that executes binary instructions in a
sequence stored in memory.
• Characteristics:
– General purpose central processor unit (CPU)
– Binary
– Register-based
– Clock-driven
– Programmable
Microprocessor-based Systems
Microprocessor
• the “brains” of the computer
Arithmetic
Register
– its job is to fetch instructions, decode them, andLogic
then execute them
Arrays
– 8/16/32/etc –bit (how it moves the data Unit
• contains:
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
Microprocessor-based Systems
Memory
◼ Memory is a group of registers
◼ 16 register – address: 0-15 – in binary: 0-1111;
Address lines: A0-A3
◼ Serves two major purposes
❑ storing the binary codes for the sequence of
instructions specified by programs (program)
❑ storing binary data that the computer needs to
execute instructions (data)
Microprocessor-based Systems
Memory Types
– R/W: Read/Write Memory; also called RAM
• It is volatile (losses information as power is removed)
• Write means the processor can store information
• Read means the processor can receive information from
the memory
• Acts like a Blackboard!
– ROM: Read-Only memory;
• It is typically non-volatile (permanent) – can be erasable
• It is similar to a Page from your textbook
Microprocessor-based Systems
Memory Classification
Basic Technologies:
Semiconductor
Magnetic
Optical
(or combination)
Expensive Cheap
Onetime programmable
Fast/ Slow
Electronically Erasable
PROM
Microprocessor-based Systems
Memory Classification
-one transistor and one
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
• Marked Programmed ROM
– Programmed by the manufacturer
• Programmable ROM (PROM)
– Can be programmed in the field via the programmer
• Erasable Programmable ROM (EPROM)
– Uses ultraviolet light to erase (through a quartz window)
– OTP refers to one-time programmable
• Electrically Erasable Programmable ROM (EEPROM)
– Each program location can be individually erased
– Expensive
– Requires programmer
• 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
• The way the computer communicates with the
outside world devices
• I/O ports are connected to Peripherals
– Peripherals are I/O devices
• Input devices
• Output devices
– Examples
• Printers and modems,
• keyboard and mouse
• scanner
• Universal Serial Bus (USB)
Microprocessor-based
Systems – With BUS
Microprocessor-based
Systems - BUS
• The three components – MPU, memory, and I/O – are connected by a group of
wires called the BUS
• Address bus
◼ consists of 16, 20, 24, or 32 parallel signal lines (wires) - unidirectional
◼ these lines contain the address of the memory location to read or written
• 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
• examples: Memory Read, Memory Write, I/O Read, I/O Write
• 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
Expanded Microprocessor-Based System
1. Note the directions of
busses
2. What is the width of
the address bus?
3. What is the value of
the Address bus to
access the first register
of the R/W M?
You must know how to
draw it! Remember: 111 1111 1111 = 2^11=2K
Embedded controllers
• Used to control smart machines
• Examples: printers, auto braking systems
• Also called microcontrollers or microcontroller
units (MCU)
Embedded controllers
Software Characteristics
• No operating systems
• Execute a single program, tailored exactly to the
controller hardware
• Assembly language (vs. High-level language)
– Not transportable, machine specific
– Programmer need to know CPU architecture
– Speed
– Program size
– Uniqueness
Microcontroller Unit (MCU)
Block Diagram
• An integrated electronic computing and logic device that
includes three major components on a single chip
– Microprocessor
– Memory
– I/O ports
• Includes support devices
– Timers
– A/D converter
– Serial I/O
– Parallel Slave Port
• All components connected by common communication lines
called the system bus.
Memory Design a memeory unit whwre you
• A semiconductor
storage device
consisting of registers
that store binary bits
• Two major categories
– Read/Write Memory
(R/WM)
– Read-only-Memory
(ROM)
Storing Bits in Memory
• We can store in different memory types
– EEPROM, FLASH, RAM, etc.
• In an 8-bit RAM
– Each byte is stored in a single memory
register
– Each word is stored in two memory
locations (registers)
– DATA 0x1234
• 0x12→REG11 (High-order byte)
– 0001 0010
• 0x34→REG10 (Low-order byte)
– 0011 0100
What if1000
Remember -8→111 we want to store
(in two’s -8?
complement)
MPU-Based Time
and Temperature System
MCU-Based Time
and Temperature System