Professional Documents
Culture Documents
Murali, AP/CSE
Memory interfacing:
•For this, both the memory and the microprocessor requires some
signals to read from and write to registers.
IO Interfacing
-Various communication devices like the keyboard, mouse, printer,
etc. needs to interface with the microprocessor by using latches
and buffers.
295
I/O interfacing:
-Because the address space for I/O is isolated from that for
main memory, this is sometimes referred to as isolated I/O.
328
Control Register:
INTEL 8255
Peripheral Interface.
301
8255
303
305
306
Control Logic
CS signal is the master Chip Select
A0 and A1 specify one of the two I/O Ports
CS A1 A0 Selected
0 0 0 Port A
0 0 1 Port B
0 1 0 Port C
0 1 1 Control
Register
1 X X 8255 is not
selected
313
314
317
interrupt capability
PC5 – IBFA – indicating Input Buffer Full and, set to 1 when port A
contains data that not been sent to CPU and set to 0 when port A
doesn’t contain data
PC6, PC7 – send control signals to device or read status from device.
When D3 in CWR 0, it will send control signals and when D3 is 1 it reads
status
PC7 – OBFA – indicating Output Buffer Full. 0 when port A has data to
send from buffer
PC6 – ACKA – device set 0 (as acknowledgement) when receive the data
from port A
PC4 and PC5 – serves same as PC6 and PC7 under port c as input
PC4 – STBA – 0 to this pin makes PA0 to PA7 strobe into Port A
PC5 – IBFA – indicating Input Buffer Full and, set to 1 when port A
contains data that not been sent to CPU and set to 0 when port A
doesn’t contain data
PC6 - ACKA - 0 when the device is ready to accept data from PA0 – PA7
PC7 – OBFA – 0 when port A is filled with data and 1 when data are taken
by device.
321
Write a program to initialize 8255 in the configuration
below.(assume address of the CW register as 23H).
(1) Port A: output with handshake
(2) Port B: input with handshake
(3) Port CL: output (4)Port CU: input
Solution:
1 0 1 0 1 1 1 0 = AEH
Program:
MOV AH,AEH ; LOAD CONTROL WORD
322
Solution:
1 0 0 0 0 0 0 0 = 80H
When the busy signal goes down after conversion, the strobe
signal send through PC4 which makes the digital data sending
to port A.
IN0 to IN7 – input lines for sending analog signal using three
address lines A, B, C
Vref (+) and Vref (-) – used to set the positive and negative
voltage references of analog signal
Uses:
•To switch over between programs by generating interrupt at
particular time
Modes of 8254
-To read the Counter, which is selected with the A1, A0 inputs,
the CLK input of the selected Counter must be inhibited by
using either the GATE input or external logic.
Status Register
Display Design:
8279
Data Buffer Register – to store the data from the data bus
SL3-SL0: Scan line outputs that scans both the keyboard and
displays.
Prepared by Mr. S. Murali, AP/CSE, VCET
Prepared by Mr. S. Murali, AP/CSE
8279
377
375
Keyboard section
Display section
Scan section
378
378
380
381
382
383
384
385
a) Keyboard Display Mode Set : The format of the command word to select different
modes of operation of 8279 is given below with its bit definitions.
D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 D D K K K
386
SENSOR MATRIX
SENSOR MATRIX
387
B) Programmable clock :
0 0 1 P P P P P
c) Read FIFO / Sensor RAM : The format of this command is given 388
below.
D7 D6 D5 D4 D3 D2 D1 D0
0 1 0 AI X A A A
389
D7 D6 D5 D4 D3 D2 D1 D0
0 1 1 AI A A A A
390
391
D7 D6 D5 D4 D3 D2 D1 D0
1 1 0 CD2 CD1 CD0 CF CA
392
E- Error mode
X- don’t care
-Data bus buffer, Read/Write logic and Control logic interface with the main
microprocessor
ICW3
Modes of 8259
• For transferring data without disturbing CPU and thus to save cycles of
CPU
•DMA requests the CPU for bus access using local bus request input i.e.
HOLD in minimum mode.
DMA Controller
•In maximum mode of the microprocessor RQ/GT pin is used as bus
request input.
•On receiving the HLDA signal (in minimum mode) or RQ/GT signal (in
maximum mode) from the CPU, the requesting devices gets the access
of the bus
DMA Controller
DMA works in 4 modes
• Single mode – suitable for transferring one byte in one clock cycles and
if transferred completed then DMS becomes idle till the cycle ends.
DMA Controller
Mask Flag – indicates which channel is using for transfer the data
•Base Address Register – stores the starting address of the block which
needs to be transferred.
•Base byte count register – store the total bytes needs to be transferred
•Current byte count register – stores the bytes that are transferring
currently