Ec8691 Unit Iii - PPT
Ec8691 Unit Iii - PPT
Ec8691 Unit Iii - PPT
MICROCONTROLLERS
U Vinothkumar
Asst Prof
Dept of ECE
Dr.N.G.P.Institute of Technology
Coimbatore.
UNIT III - I/O INTERFACING (9Hrs)
2
Memory mapped I/O:
3
Difference Between Memory mapped I/O and I/O mapped I/O
4
8255 (PPI)
Parallel Communication Interface
5
8255 – Parallel Communication Interface
5. It has three 8-bit ports : Port A, Port B, and Port C, which are
6
Features cont……
6. PA and PCU are called Group A ports and PB and PCL are called
Group B ports. (i.e. port c is divided in to two, 4 bit ports PCU
and PCL)
7. Each port has an unique address, and data can be read from or
written to a port.
10. Bit set/reset mode allows setting and resetting of individual bits
of Port C.
7
Features cont……
12. All I/O pins of 8255 has 2.5 mA DC driving capacity (i.e. sourcing
current of 2.5 mA).
8
9
Data Bus Buffer:
It is also called as tri-state bi-directional buffer
Output data from the CPU to the ports or control register, and
input data to the CPU from the ports or status register are all
passed through the buffer.
10
Read / Write Control Logic: Cont…..
The input pins for the control logic section are A1-A0, RD, WR,
CS.
11
Group A and Group B Controls: Cont…..
Port B : This has an 8-bit data I/O latch/ buffer and an 8-bit
data input buffer. It can be programmed in mode 0 and mode 1.
Port C : This has one 8-bit unlatched input buffer and an 8-bit
output latch/buffer. Port C can be splitted into two parts and each
can be used as control signals for ports A and B in the handshake
mode. It can be programmed for bit set/reset operation.
12
Pin Diagram of 8255
13
Pin Diagram: cont……
RD (Read): When this signal is low, CPU can read the data in the
ports or status word, through the data bus buffer.
WR (Write): When this signal is low, CPU can write data on the
ports or in the control register, through the data bus buffer.
CS (Chip select): This is an active low signal which enables the data
transfer operation between 8086 and 8255.
14
Pin Diagram: cont……
15
OPERATING MODES OF 8255
16
Bit Set-Reset (BSR) Mode:
The BSR word can also be used for enabling or disabling interrupt
signals generated by Port C when the Pin Diagram of 8255
Microprocessor is programmed for Mode 1 or 2 operation.
17
I/O Modes:
18
I/O Modes:
The control words for both modes are loaded into the same
control register, with bit D7 used for specifying whether the word
loaded into the control register is a I/O mode or Bit Set-Reset
mode.
19
Cont…
20
Cont…
Mode 1 which supports handshaking has following features.
• Two ports (A and B) function as 8-bit I/O ports. They, can be
configured either as input or output ports.
• Each port uses three lines from Port C as handshake signals.
• The remaining two lines of Port C can be used for simple I/O
functions.
• Input and output data are latched.
• Interrupt logic is supported.
21
Cont…
STB (Strobe Input) : This is an active low input signal which
indicates CPU that the data to be read is already sent on the port
lines of 8255 port.
IBF (Input Buffer Full) : This is an active high output signal which
indicates to the input device that the input buffer is full and it is
not ready to accept next byte from the input device.
22
Cont…
23
Cont…
Mode 1 Output Control Signals :
OBF (Output Buffer Full) : This is an active low output signal, which
indicates the output device that data is available on the output port.
ACK (Acknowledge Input): This is an active low input signal, which
indicates 8255 that the data from port A or Port B has been accepted.
INTR (Interrupt Request) : This is an active high output signal
generated by 8255 A ‘high’ on this output can be used to interrupt the
CPU when an output device has accepted data transmitted by the
CPU.
INTE (Interrupt Enable) : It is used to enable or disable INTR
(Interrupt Request) signal. If INTE flip flop is set, the interrupt
request is generated depending on the status of ACK and OBF signals.
If INTE flip flop is reset, the interrupt request is not generated,
allowing masking facility for the interrupt.
24
Cont…
Mode 2 (Bi-directional I/O data transfer):
This mode allows bi-directional data transfer (transmission and
reception) over a single 8-bit data bus using handshaking signals.
The remaining lines of Port C i.e. PC0-PC2 can be used for simple
I/O functions.
25
Cont…
26
8251 (USART)
Serial Communication Interface
27
8251 – Serial Communication Interface
Features of 8251 (USART):
1. The Intel 8251A is an universal synchronous and asynchronous
receiver and transmitter.
2. It supports standard synchronous and asynchronous protocol with
5 to 8 Bit character format.
3. It has built in baud rate generator.
4. It allows full duplex transmission and reception.
5. It provides double buffering of data both in the transmission
section and in the receiver section.
6. It provides error detection logic, which detects parity, overrun and
framing errors.
7. It has Modem Control Logic, which supports basic data set control
signals.
28
Cont…
10. It is fabricated in 28 pin DIP package and its all inputs and
outputs are TTL compatible.
29
BLOCK DIAGRAM OF 8251
30
Cont…
Data Bus Buffer :
This tri-state, bi-directional, 8-bit buffer is used to interface Block
Diagram of 8251 Microcontroller to the system data bus. Along with
the data, control word, command words and status information are
also transferred through the Data Bus Buffer.
31
Cont…
Transmit Buffer :
The transmit buffer accepts parallel data from the CPU, adds the
appropriate framing information, serializes it, and transmits it on the
TxD pin on the falling edge of TxC.
It has two registers : A buffer register to hold eight bits and an
output register to convert eight bits into a stream of serial bits. The
CPU writes a byte in the buffer register, Which is transferred to the
output register when it is empty. The output register then transmits
serial data on the TxD pin.
In the asynchronous mode the transmitter always adds START bit;
depending on how the unit is programmed, it also adds an optional
even or odd parity bit, and either 1, 1 1/2, or 2 STOP bits.
In synchronous mode no extra bits (other than parity, if enable) are
generated by the transmitter.
32
Cont…
Transmit Control :
It manages all activities associated with the transmission of serial
data. It accepts and issues signals both externally and internally to
accomplish this function.
TxRDY (Transmit Ready ) : This output signal indicates CPU that
buffer register is empty and the USART is ready to accept a data
character. It can be used as an interrupt to the system or, for polled
operation, the CPU can ‘check TxRDY using the status read operation.
This signal is reset when a data byte is loaded into the buffer
register.
TxE (Transmitter Empty) : This is an output signal. A high on this
line indicates that the output buffer is empty. In the synchronous
mode, if the CPU has failed to load a new character in time, TxE will
go high momentarily as SYN characters are loaded into the
transmitter to fill the gap in transmission.
33
Cont…
TxC (Transmitter Clock) : This clock controls the rate at which
characters are transmitted by USART. In the synchronous mode TxC
is equivalent to the ‘baud rate, and is supplied by the modem. In
asynchronous mode TxC is 1, 16, or 64 times the baud rate. The
clock division is programmable. It can be programmed by writing
proper mode word in the mode set register.
Receiver Buffer:
The receiver accepts serial data on the RxD line, converts this serial
data to parallel format, checks for bits or characters that are unique
to the communication technique and sends an “assembled” character
to the CPU.
34
Cont…
When 8251 is in the asynchronous mode and it is ready to accept a
character, it looks for a low level on the RxD line. When it receives
the low level, it assumes that it is a START bit and enables an
internal counter, At a count equivalent to one-half of a bit time, the
RxD line is sampled again.
If the line is still low, a valid START bit is detected and the 8251A
proceeds to assemble the character. After successful reception of a
START bit the 8251A receives data, parity and STOP bits, and then
transfers the data on the receiver input register. The data is then
transferred into the receiver buffer register.
35
Cont…
Receiver Control:
It manages all receiver-related activities. Along with data reception,
it does false start bit detection, parity error detection, framing error
detection, sync detection and break detection.
RxRDY (Receiver Ready) : This is an output signal. It goes high
(active), when the USART has a character in the buffer register and
is ready to transfer it to the CPU. This line can be used either to
indicate the status in the status register or to interrupt the CPU. This
signal is reset when a data byte from receiver buffer is read by the
CPU.
RxC (Receiver Clock) :
This clock controls the rate at which the character is to be received
by USART in the synchronous mode. RxC is equivalent to the baud
rate, and is supplied by the modem.
36
Cont…
In asynchronous mode RxC is 1, 16, or 64 times the baud rate. The
clock division is programmable. It can be programmed by writing
proper mode word in the mode set register.
37
Pin Diagram of 8251 (USART)
38
Cont….
Data Bus (D0-D7) : Bi-directional, tri-state, 8-bit Data Bus. This pin
allow transfer of bytes between the CPU and the 8251.
RESET : A high on this input forces the 8251 into an “Idle” mode.
The device will remain at “Idle” until a new set of control words is
written into 8251.
39
Cont…
40
Cont…
Modem Control Signals:
The Pin Diagram of 8251 Microcontroller has a set of control inputs
and outputs that can be used to simplify the interface to almost any
modem.
DSR (Data Set Ready) : This input signal is used to test modem
conditions such as Data Set Ready.
41
Cont…
Transmitter Signals:
TxD : Transmit data : This output signal outputs a composite serial
stream of data on the falling edge of TxC.
42
Cont…
Receiver Signals:
RxD (Receiver data) : This input receives a composite serial
stream of data on the rising edge of RxC.
RxC (Receiver Clock) :This clock input controls the rate at which
the character is to be received.
In asynchronous mode this pin goes high if receiver line stays low for
more than 2 character times. It then indicates a break in the data
stream.
43
D/A and A/D Interface
44
ADC (Analog to Digital Converter)
45
ADC 0808/0809
46
Cont….
Pin Diagram of ADC 0808/0809:
47
Cont….
Operation of ADC0808:
ADC 0808/0809 has eight input channels.
They are able to convert only positive analog input voltages to their
digital equivalents.
This chip do not contain any internal sample & hold circuit.
48
Cont….
The address of the desired channel is sent to the multiplexer
address inputs through port pins.
After another 2.5 μs, the start of conversion (SOC) signal must be
sent high and then low to start the conversion process.
49
Cont….
50
Cont….
51
Cont….
8255 Control Word: D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 1 1 0 0 0 = 98H
Program:
MOV AL,98H ; Initialize 8255, send AL to control word (CWR)
OUT CWR, AL
MOV AL, 02H ; Select I/P2 as analog I/P
OUT Port B, AL ; Port B as output
MOV AL, 00H ; Give start of conversion pulse to the ADC
OUT Port C, AL
MOV AL, 01H
OUT Port C, AL
MOV AL, 00H
OUT Port C, AL
WAIT: IN AL, Port C ; check for EOC by reading Port C upper &
RCL ; rotating AL content through carry.
JNC WAIT
IN AL, Port A ; if EOC, read digital equivalent in AL
MOV BX,1100 ; Initialize the memory location to store data
MOV [BX],AL ; Store the data
HLT ; stop.
52
Cont….
53
DAC (Digital to Analog Converter)
54
DAC 1408/0808
Features of DAC0808:
• 8 bit parallel digital data input
• Fast settling time (typical value): 150 ns
• Relative accuracy at ±0.19% maximum error
• Full scale current match: ±1 LSB
• Non-inverting digital inputs are TTL and CMOS compatible
• High speed multiplying input slew rate: 8 mA/μs
• Power supply voltage range: ±4.5V to ±18V
• Low power consumption: 33 mW@ ±5V
• Maximum Power dissipation: 1000 mW
• Operating temperature range: 0ºC to +75ºC
55
DAC – 1408/0808 Cont…
56
Cont…
57
Cont…
58
Cont…
59
Cont…
8255 Control Word: D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 0 0 0 0 0 = 80H
Program (Triangular Wave):
OUT CWR, AL
START: MOV AL, 00H ; Start rising ramp from 0v by sending 00H to DAC
JNZ BACK
MOV AL, FFH ; Start falling ramp from 5v by sending FFH to DAC
JNZ BACK1
JMP START
60
Cont…
8255 Control Word: D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 0 0 0 0 0 = 80H
Program (Sawtooth Wave):
OUT CWR, AL
START: MOV AL, 00H ; Start rising ramp from 0v by sending 00H to DAC
JNZ BACK
JMP START
61
Cont…
Delay program:
DELAY: MVI BX,0FFFH
BACK: DEC BX
JNZ BACK
RET
62
8253/54
Programmable Interval Timer
63
8253/54 – Programmable Interval Timer
Features of 8253 / 54 :
1. It has three independent 16-bit down counters.
2. 8254 can handle inputs from DC to 10 MHz and 8253 can handle
inputs from DC to 2 MHz.
64
BLOCK DIAGRAM OF 8253/54 Timer
65
Pin diagram of 8253 Timer
66
Cont….
Data Bus Buffer:
• It is a tri-state, bi-directional, 8-bit buffer, which is used to interface
the 8253/54 to the system data bus. It has three basic functions −
• Programming the modes of 8253/54.
• Loading the count registers.
• Reading the count values.
Read/Write Logic:
• It includes 5 signals, i.e. RD, WR, CS, and the address lines A0 & A1.
In the peripheral I/O mode, the RD and WR signals are connected to
IOR and IOW, respectively. In the memory mapped I/O mode, these
are connected to MEMR and MEMW.
• Address lines A0 & A1 of the CPU are connected to lines A0 and A1 of
the 8253/54, and CS is tied to a decoded address. The control word
register and counters are selected according to the signals on lines
A0 & A1 .
67
Cont…
A1 A0 FUNCTION
0 0 Counter 0
0 1 Counter 1
1 0 Counter 2
1 1 Control Word Register
X X No selection
68
Cont…
Following table shows the result for various control inputs,
Selection
A1 A0 RD WR CS Function
Mode
Control word
1 1 1 0 0 Write Control Word
register
69
Cont…
Counters:
• Each counter has 3 logical lines CLK, Gate and OUT. Clock and
Gate are input lines and OUT is the output signal.
70
Operating Modes of 8253 Timer
71
Cont…
72
Cont…
MODE 2 - Rate Generator
•It is a standard divide-by-N counter.
•The output will be initially high.
•The output will go low for one clock pulse before the terminal count.
•The output then goes high, the counter reloads the initial count and
the process is repeated.
73
Cont…
MODE 3 - Square Wave Generator
•Initially the output is high.
•Mode 3 is similar to mode 2, except that the output will be high for
one half of the count and then low for the other half if the count is
even.
•If the count is ODD, the output will be high for (n+1)/2 and low for
(n-1)/2 counts.
74
Cont…
MODE 4 - Software Triggered Strobe
•After the mode is set the output will be high.
•Once the count is loaded it will start counting, and once terminal
count is reached (i.e.) when counter equals to ‘0’.
•The output will go to a logical ‘0’ for one clock period and then
returns to a logical ‘1’.
75
Cont…
MODE 5 - Hardware Triggered Strobe
•This mode is similar to mode 4.
•After the mode is set the output will be high.
•It will wait for a hardware trigger signal (i.e.) rising edge of the Gate
input before starting to count.
•Modes 1 and 5 require the 8253 gate pin to go ‘high’ in order to
start counting.
•Once terminal count is reached the output will go to a logical ‘0’ for
one clock period and then returns to a logical ‘1’.
76
Cont…
77
8279
Keyboard/Display Controller
78
8279 Keyboard/Display Controller
Features of 8279:
5. The interrupt output of 8279 can be used to tell CPU that the
keypress is detected. This eliminates the need of software polling.
79
Cont…
6. It provides 8 byte FIFO RAM to store keycodes. This allows to store 8
key board inputs when CPU is busy in performing his own
computation.
7. It provides multiplexed display interface with blanking and inhibit
options.
8. It provides sixteen byte display RAM to store display codes for 16
digits, allowing to interface 16 digits.
9. In auto increment mode, address of display RAM and FIFO RAM is
incremented automatically which eliminates extra command after
each read/write operation to access successive locations of display
RAM and FIFO.
10. It provides two output modes for display interface. Left Entry
(typewriter type) Right Entry (calculator type).
11. Simultaneous keyboard and display operation facility allows to
interleave keyboard and display software.
80
BLOCK DIAGRAM OF 8279 Keyboard/Display Controller
81
Cont….
It consists of four main sections,
1. CPU interface and control section
2. Scan section
3. Keyboard section
4. Display section.
I/O Control:
The I/O control section uses the A0, CS, RD and WR signals to
control data flow to and from the various internal registers and
buffers.
The data flow to and from the 8279 is enabled only when CS = 0;
otherwise the 8279 signals are in a high impedance state.
When A0 is logic 0 data is transferred and when A0 is logic 1
command word or status word is transferred. RD and WR determine -
the direction of data flow through the data buffers.
82
Cont…
83
Cont…
Timing Control:
The timing control consists of the basic timing counter chain.
The first counter is divided by N prescaler that can be programmed
to give an internal frequency of 100 kHz.
The other counters divide down the basic internal frequency, to
provide the proper keyscan, row scan, keyboard matrix scan, and
display scan times.
The internal frequency of 100 KHz gives the internal timings as
shown in the table below.
84
Cont…
2. Scan Section (Scan counter):
The scan section has a scan counter which has two modes :
Encoded mode and decoded mode.
Encoded Mode: In the encoded mode, the scan counter provides a
binary count from 0000 to 1111 on the four scan lines (SC3 — SC0) with
active high outputs. This binary count must be externally decoded to
provide 16 scan lines. Display can use all 16 scan lines to interface 16
digit 7-segment display, but keyboard can use only 8 scan lines out of 16
scan lines.
Decoded Mode: In the decoded mode, the internal decoder decodes the
least significant 2 bits of binary count and provides four possible
combinations on the scan lines (SC3 — SC0) :1110, 1101, 1011 and
0111. Thus the output of decoded scan is active low. These four active
low output lines can be used directly to interface 4 digit 7 segment
display, 8 x 4 matrix keyboard, eliminating the external decoder.
85
Cont…
3. Keyboard Section:
Return buffers: The 8 return lines (RL7 — RL0) are buffered and latched by
the return buffers during each row scan in scanned keyboard or sensor matrix
mode. In strobed input mode, the contents of the return lines are transferred
to the FIFO RAM on the rising edge of the CNTL/STB line pulse.
86
Cont…
FIFO/Sensor RAM: This is a dual function 8 x 8 RAM. In scanned
keyboard and strobed input modes, it is a FIFO. Each new entry is
written into successive RAM positions and then read in order of entry. In
sensor matrix mode, the memory is referred to as sensor RAM. Each row
of the sensor RAM is loaded with the status of the corresponding row of
sensor in the sensor matrix.
FIFO/sensor RAM status: FIFO RAM status keeps track of the number
of characters in the FIFO and whether it is full or empty. The status logic
also makes IRQ signal high when the FIFO is not empty, which can be
used to interrupt CPU telling that key press is detected and keycode is
available in FIFO RAM.
4. Display section:
The display section consists of display RAM, display address registers and
display registers.
87
Cont…
88
Pin diagram of 8279 Keyboard/Display Controller
89
Cont…
Data Bus Lines, DB0 - DB7 - These are 8 bidirectional data bus lines
used to transfer the data to/from the CPU.
90
Cont…
IRQ - This interrupt output line goes high when there is data in the
FIFO sensor RAM. The interrupt line goes low with each FIFO RAM
read operation. However, if the FIFO RAM further contains any key-
code entry to be read by the CPU, this pin again goes high to
generate an interrupt to the CPU.
Vss, Vcc - These are the ground and power supply lines of the
microprocessor.
SL0 − SL3 - These are the scan lines used to scan the keyboard
matrix and display the digits. These lines can be programmed as
encoded or decoded, using the mode control register.
RL0 − RL7 - These are the Return Lines which are connected to one
terminal of keys, while the other terminal of the keys is connected to
the decoded scan lines. These lines are set to 0 when any key is
pressed.
SHIFT - The Shift input line status is stored along with every key
code in FIFO in the scanned keyboard mode. Till it is pulled low with
a key closure, it is pulled up internally to keep it high
91
Cont…
CNTL/STB - CONTROL/STROBED I/P Mode - In the keyboard
mode, this line is used as a control input and stored in FIFO on a key
closure. The line is a strobe line that enters the data into FIFO RAM,
in the strobed input mode. It has an internal pull up. The line is
pulled down with a key closure.
OUTA0 – OUTA3 and OUTB0 – OUTB3 - These are the output ports
for two 16x4 or one 16x8 internal display refresh registers. The data
from these lines is synchronized with the scan lines to scan the
display and the keyboard.
92
8259
Programmable interrupt
controller
93
8259 – Programmable interrupt controller
Features:
1. It can manage eight priority interrupts. This is equivalent to providing
eight interrupt pins on the processor in place of INTR pin.
2. It is possible to locate vector table for these additional interrupts any
where in the memory map. However, all eight interrupts are spaced at
the interval of either four or eight locations.
3. By cascading nine 8259s it is possible to get 64 priority interrupts.
4. Interrupt mask register makes it possible to mask individual interrupt
request.
5. The 8259A can be programmed to accept either the level triggered or
the edge triggered interrupt request.
6. With the help of 8259A user can get the information of pending
interrupts, in-service interrupts and masked interrupts.
7. The 8259A is designed to minimize the software and real time
overhead in handling multi-level priority interrupts.
94
BLOCK DIAGRAM OF 8259
95
Cont….
Data Bus Buffer: The data bus buffer allows the 8086 to send
control words to the 8259A and read a status word from the Block
Diagram of 8259 Programmable Interrupt Controller. The 8-bit data
bus buffer also allows the 8259A to send interrupt opcode and
address of the interrupt service subroutine to the 8086.
Control Logic: This block has an input and an output line. If the
8259A is properly enabled, the interrupt request will cause the
8259A to assert its INT output pin high. If this pin is connected to
the INTR pin of an 8086 and if the 8086 Interrupt Enable (IE) flag is
set, then this high signal will cause the 8086 to respond INTR as
explained earlier.
96
Cont…
Interrupt Request Register (IRR): The IRR is used to store all the
interrupt levels which are requesting the service. The eight interrupt
inputs set corresponding bits of the Interrupt Request Register upon
service request.
97
Cont…
Cascade Buffer Comparator: This section generates control signals
necessary for cascade operations. It also generates Buffer-Enable
signals. As stated earlier, the Block Diagram of 8259 Programmable
Interrupt Controller can be cascaded with other 8259s in order to
expand the interrupt handling capacity to sixty-four levels. In such a
case, the former is called a master, and the latter are called slaves.
The 8259 can be set up as a master or a slave by the SP/EN pin.
CAS0— CAS2: For a master 8259, the CAS0-CAS2 pins are output
pins, and for slave 8259, these are input pins. When the 8259 is a
master (that is, when it accepts interrupt requests from other
8259s), the CALL opcode is generated by the Master in response to
the first INTA. The vector address must be released by the slave
8259.
The master sends an identification code of three-bits to select one
out of the eight possible slave 8259s on the CAS0-CAS2 lines. The
slave 8259s accept these three signals as inputs (on their CAS0 –
CAS2 pins) and compare the code sent by the master with the codes
assigned to them during initialization. The slave thus selected (which
had originally placed an interrupt request to the master 8259) then
puts the address of the interrupt service routine during the second
and third INTA pulses from the CPU.
98
Cont…
SP / EN (Slave Program /Enable Buffer): The SP/EN signal is
tied high for the master. However it is grounded for the slave.
In large systems where buffers are used to drive the data bus, the
data sent by the 8259 in response to INTA cannot be accessed by the
CPU (due to the data bus buffer being disabled).
99
8257 DMA Controller
100
8257 DMA Controller
The DMA data transfer is initiated only after receiving HLDA signal
from the CPU.
101
8257 DMA Controller
• Initially, when any device has to send data between the device and
the memory, the device has to send DMA request (DRQ) to DMA
controller.
• The DMA controller sends Hold request (HRQ) to the CPU and waits
for the CPU to assert the HLDA.
• Then the microprocessor tri-states all the data bus, address bus,
and control bus. The CPU leaves the control over bus and
acknowledges the HOLD request through HLDA signal.
• Now the CPU is in HOLD state and the DMA controller has to
manage the operations over buses between the CPU, memory, and
I/O devices.
102
Cont…
Features of 8257:
Here is a list of some of the prominent features of 8257 −
• It has four channels which can be used over four I/O devices.
• Each channel has 16-bit address and 14-bit counter.
• Each channel can transfer data up to 64kb.
• Each channel can be programmed independently.
• Each channel can perform read transfer, write transfer and verify
transfer operations.
• It generates MARK signal to the peripheral device that 128 bytes
have been transferred.
• It requires a single phase clock.
• Its frequency ranges from 250Hz to 3MHz.
• It operates in 2 modes, i.e., Master mode and Slave mode.
103
BLOCK DIAGRAM OF 8257 DMA Controller
104
Pin diagram of 8257 DMA Controller
105
Cont….
DRQ0−DRQ3
• These are the four individual channel DMA request inputs, which
are used by the peripheral devices for using DMA services. When
the fixed priority mode is selected, then DRQ0 has the highest
priority and DRQ3 has the lowest priority among them.
DACKo − DACK3
• These are the active-low DMA acknowledge lines, which updates
the requesting peripheral about the status of their request by the
CPU. These lines can also act as strobe lines for the requesting
devices.
Do − D7
• These are bidirectional, data lines which are used to interface the
system bus with the internal data bus of DMA controller. In the
Slave mode, it carries command words to 8257 and status word
from 8257. In the master mode, these lines are used to send
higher byte of the generated address to the latch. This address is
further latched using ADSTB signal.
106
Cont…
107
Cont…
IOR - It is an active-low bidirectional tri-state input line, which is
used by the CPU to read internal registers of 8257 in the Slave
mode. In the master mode, it is used to read data from the
peripheral devices during a memory write cycle.
108
Cont…
Ao - A3 - These are the four least significant address lines. In the
slave mode, they act as an input, which selects one of the
registers to be read or written. In the master mode, they are the
four least significant memory address output lines generated by
8257.
109
Cont…
HRQ - This signal is used to receive the hold request signal from the
output device. In the slave mode, it is connected with a DRQ input
line 8257. In Master mode, it is connected with HOLD input of the
CPU.
MEMR - It is the low memory read signal, which is used to read the
data from the addressed memory locations during DMA read
cycles.
ADST - This signal is used to convert the higher byte of the memory
address generated by the DMA controller into the latches.
110
Cont…
AEN - This signal is used to disable the address bus/data bus.
MARK - The mark will be activated after each 128 cycles or integral
multiples of it from the beginning. It indicates the current DMA
cycle is the 128th cycle since the previous MARK output to the
selected peripheral device.
Vcc - It is the power signal which is required for the operation of the
circuit.
111