AMP Module I & II
AMP Module I & II
Peripherals
Sarju S
Department of Computer Science and
Engineering
Module I
Study of Interfacing ICs - 8255, 8251,
8279
1/25/17
Device
It is flexible, versatile, and economical
It can be used with almost any
microprocessor
4
1/25/17
1/25/17
LOWER
www.lectnote.blogspot.com
Figure 1.1
1/25/17
I/O Mode
Mode 0
Mode 1(Handshake mode)
Mode 2
1/25/17
Block Diagram
1/25/17
WR(Write)
MPU writes into a selected I/O Port or Control
Register
RESET(Reset)
Clears the Control Register&Sets all ports in input
mode
CS, A0, A1
Device select Signals
1/25/17
10
CS
A1
A0
Selected
Port A
Port B
Port C
Control
Register
8255 is not
selected
1/25/17
D6
D5
D4
D3
D2
D1
D0
function
D7=1, bits D6-D0 determine I/O functions
D7=0, Port C operates in BSR mode
11
1/25/17
12
1/25/17
13
1/25/17
Control Word
D7 D6 D5 D4 D3 D2 D1 D0
0/1
BSR Mode
(Bit Set/Reset)
I/O Mode
Mode 0
Mode 1
Simple I/O
for ports A,B
and C
Handshake I/O
for ports A and or
B
Port C bits are
used for
handshake
14
Mode 2
Bidirectional data
bus for Port A
Port B: either in
Mode 0 or 1
Port C bits are used
for handshake
1/25/17
15
1/25/17
1/25/17
1/25/17
18
1/25/17
19
1/25/17
1/25/17
1/25/17
1/25/17
23
1/25/17
Receiver
Receives serial bits from peripheral
Converts serial bits into parallel word
Transfers the parallel word to the MPU
telephone line
1/25/17
25
1/25/17
1/25/17
1/25/17
28
CS
C/D
RD
WR
Function
1/25/17
Data Buffer
29
1/25/17
1/25/17
31
1/25/17
output registers
32
1/25/17
33
1/25/17
1/25/17
1/25/17
36
1/25/17
37
1/25/17
38
1/25/17
1/25/17
1/25/17
has two modes to scan the key matrix and refresh the
display
Encoded Mode
the counter provides binary count that is to be
1/25/17
and Control
Scans for a key closure row wise
The code of key is directly transferred to the
1/25/17
RAM
43
1/25/17
44
1/25/17
1/25/17
1/25/17
47
1/25/17
1/25/17
Module II
Interfacing with 8085 - Interfacing keyboard
Hardware and Software approach
Interfacing seven segment displays Interfacing D/A and A/D converters - Micro
controllers
50
1/25/17
51
1/25/17
Program
Check whether all keys are open
Necessary to avoid misinterpretation if a key is
1/25/17
54
1/25/17
55
1/25/17
56
1/25/17
FLOWCHARTS
Source Program and Interrupt Service Routine
57
1/25/17
Source program:
MVI A, 34H
OUT 81H : Initialize prescaler count
MVI A, 0BH : Load mask pattern to enable RST
7.5
SIM : mask other interrupts
EI
: Enable Interrupt
HERE: JMP HERE : Wait for the interrupt
58
1/25/17
mode
OUT 81H
IN 80H : Get keycode
MVI H, 62H : Initialize memory pointer to point
MOV L, A : 7-Segment code
MVI A, 80H : Initialize 8279 in write display RAM
mode
OUT 81H
MOV A, M : Get the 7 segment code
OUT 80H : Write 7-segment code in display RAM
EI : Enable interrupt
RET : Return to main program
59
1/25/17
Digital-To-Analog(D/A) Converters
60
1/25/17
61
1/25/17
62
12-bit is required.
The 8-bit microprocessor has only 8-bit
data lines.
To transfer 10-bits, the data bus is timeshared by using two output ports: one for
first 8-bit and second for remaining two
bits.
AD7522 is a CMOS 10-bit D/A converter
with an input buffer and a holding register.
The ten bits are loaded into the input
register in two steps using two output
1/25/17
63
1/25/17
64
1/25/17
Analog-To-Digital(A/D)
converter
65
1/25/17
66
1/25/17
67
68
1/25/17
69
1/25/17