Escolar Documentos
Profissional Documentos
Cultura Documentos
EE323-Microprocessor Interfacing
Program: CE (Fall 2016)
Lecture: 1
Reference Books:
Grading Policy:
Project
Quizzes (Announced + Surprise)
Mid-Term Exam
Final-Term Exam
Quizzes:
15%
15%
25%
45%
Attendance:
Office Hours:
2:30 to 3:30 PM
Note:
Course Outline
Learning Outcomes
Introduction To Microprocessors
Outline
Microprocessors
Inside The Computer
CPU
Busses
Storage Devices
Registers
ALU
Program Counter
Instruction Decoder
Internal Working Of A Computer
Microprocessor
Memory
A Typical Computer
11
CPU
12
Address bus
Busses
Control bus
Data bus
The CPU either gets data from the device or sends data to it
13
Busses Contd
The average size of data buses in CPUs varies between 8 and 64-bit
14
Busses Contd
e.g; a CPU with 24 address lines and 16 data lines can provide a total
of 224 or 16M bytes of addressable memory
Storage Devices
17
Registers
In general, the more and bigger the registers, the better the CPU
Registers can be 8, 16, 32 or 64-bit
More Registers => Better CPU
Logic functions
19
Instruction Decoder
21
Microcontrolloer
Microwave oven
Modern automobiles (at least 1 to 6 microcontrollers)
TV
VCR
Camcorder
Digital Cameras and so on
22
Microcontroller Contd
Microcontrollers are embedded inside some
other device
A PC plugged into a wall socket might
consume 50 Watts, while battery powered
microcontroller might consume as low as 50
milliwatts
It can control a device by sending signals to
different components inside the device.
e.g; a TV
23
Microcontroller has
CPU (microprocessor)
RAM
ROM
I/O ports
Timer
ADC and other peripherals (added by some manufacturers)
24
Microcoprocessor VS Microcontroller
Contd
25
Microcoprocessor VS Microcontroller
Contd
General-purpose microprocessors
Must add RAM, ROM, I/O ports, and timers externally to make
them functional
Makes the system bulkier and much more expensive
Have the advantage of versatility on the amount of RAM, ROM,
and I/O ports
Microcontroller
A PC, in contrast with the embedded system, can be used for any number
of applications
A PC contains or is connected to various embedded products like
keyboard, printer, modem, mouse etc.
Each one peripheral has a microcontroller inside it that performs only one task
27
Embedded Processor OR
Microcontroller
28
Embedded Processors
30
Choosing a Microcontoller
31
Lecture: 2
32
33
Criteria Contd
Compilers
Assemblers
Debuggers
Emulator
Technical support etc
Atmel
Philips/Signetics
AMD
Infineon (formerly Siemens)
Matra
Dallas Semiconductor/Maxim
34
35
Hardware Of Microcontrollers
8051 Family
8751 microcontroller
UV-EPROM
Versions Contd
OTP (One Time Programmable) version of 8051
A total of 40 pins
32 function as I/O port lines
24 of these lines are dual purpose (26 on 8032
and 8052)
Each can operate as I/O or as a control line or
part of the address or data bus
8051 Pinouts
Port 0
Port Functions
Port 1
P1.0 and P1.1 are used either as I/O lines or as external inputs to a
third timer
Port 3
ALE is the pin that latches the address into external register
during first half of a memory cycle
Its on pin 9
This input is master reset for 8051 and terminates
all activities when pressed
If set active high for at least two machine cycles,
8051s internal registers get loaded with
appropriate values for an orderly system start up
Program counter is set to all zeros
RST is low during normal operation
Power Connections
Memory Organization
Internal Memory
On Chip ROM
On Chip RAM
Register Banks
8 registers/bank
MOV A, 05H
E.g; if there is a carry out of bit 7 during add ,or set if there is a borrow into bit 7
during subtraction
ADD A, #1 {while; A= 11111111}
Accumulator is left with 00H after add operation and sets the carry flag to 1
00000001
+ 00001001
00001010
=> AC = 1
RS0 and RS1 bit in PSW determine the active bank register
Cleared after system reset or change by software as needed
System reset activates bank 0 (address 00-07H) by default
PSW.4 (RS1)
0
0
1
1
PSW.3 (RS0)
0
1
0
1
Active Bank
0 (00-07H)
1 (08-0FH)
2 (10-17H)
3 (18-1FH)
B Register
Stack Pointer
Data Pointer
Port Registers
8051 has four ports; P0, P1, P2 and P3 at 80H, 90H, A0H
and B0H respectively
P0, P2 and P3 are not available for I/O when external
memory is connected or during interrupts or serial port
communications
P1.2 to P1.7 are always available as general purpose I/O
lines
All ports are bit addressable
CLR P1.7 and CLR 97H are same instructions
Timer Registers
e.g; SMOD bit doubles the baud rate (or data rate)
The last instruction of a program can activate IDL to take microcontroller into
idle mode in order to save power
Clock signal is Gated off to CPU
External Memory