Professional Documents
Culture Documents
0,0,
I/ORQ 1 ^"^ 40
2 39
mcmrC 3 38
M[MW[ 4 21
markC S 36
RfAOVQ 6 3S
7 34
aostbC 8 33 Da
A€NC 9 8747 37
HROC 10 31
11 30
clkC 12 79 Do,
R€S€TC 13 78
OACK 2C 14 21
OACK 3C IS 76
ORQ3C 16 25 Doack o
ORO2C 17 74 DOACK 1
ORO iC 18 73
OROOC 19 72 Do,
. GNOC 20 21
2-103
8257/8257-5
1. DMA Channels
General The 8257 provides four separate DMA channels (labeled
The 8257 is a programmable. Direct Memory Access CH-0 to CH-3). Each channel includes two sixteen-bit
(DMA) device which, when coupled with a single Intel® registers: (1) a DMA address register, and (2) a termi
8212 I/O port device, provides a complete four-channel nal count register. Both registers must be initialized
DMA controller for use in Intel® microcomputer systems. before a channel is enabled. The DMA address register is
After being initialized by software, the 8257 can transfer a loaded with the address of the first memory location to be
block of data, containing up to 16.384 bytes, between accessed. The value loaded into the low-order 14-bits of
memory and a peripheral device directly, without further the terminal count register specifies the number of DMA
intervention required of the CPU. Upon receiving a DMA cycles minus one before the Terminal Count (TC) output
transfer request from an enabled peripheral, the 8257: is activated. For instance, a terminal count of 0 would
cause the TC output to be active in the first DMA cycle for
that channel. In general, if N = the number of desired DMA
1. Acquires control of the system bus.
cycles, load the value N-1 into the low-order 14-bits of the
2. Acknowledges that requesting peripheral which is terminal count register. The most significant two bits of the
connected to the highest priority channel. terminal count register specify the type of DMA operation
3. Outputs the least significant eight bits of the memory for that channel.
address onto system address lines A0-A7. outputs
the most significant eight bits of the memory address
to the 8212 I/O port via.the data bus (the 8212
places these address bits on lines A8-A15), and
4. Generates the appropriate memory and I/O read/
write control signals that cause the peripheral to
receive or deposit a data byte directly from or to the
addressed location in memory.
The 8257 will retain control of the system bus and repeat
the transfer sequence, as long as a peripheral maintains its
DMA request. Thus, the 8257 can transfer a block of data
to/from a high speed peripheral (e.g.. a sector of data on a
floppy disk) in a single "burst". When the specified
RIAO'
number of data bytes have been transferred, the 8257 AfSfT-
wmtc
LOGIC
activates its Terminal Count (TC) output, informing the
CPU that the operation is complete.
—• 6U* I
The 8257 offers three different modes of operation:
(1) DMA read, which causes data to be transferred from
memory to a peripheral: (2) DMA write, which causes
data to be transferred from a peripheral to memory:
and (3) DMA verify, which does not actually involve the CONTROL
—. dack J
MOO*
mode, it will respond the same as described for transfer MKO - «I
transfer of data The 8257. however, will gain control of the At* -
2-104 AFN-018400
8257/8257-5
These two bits are not modified during a DMA cycle, but
BIT IS BIT 14 TYPE OF DMA OPERATION
can be changed between DMA blocks.
Each channel accepts a DMA Request (DRQn) input and 0 0 Verify OMA Cycle
provides a DMA Acknowledge (DACKn) output 0 1 Write DMA Cycle
1 0 Read DMA Cycle
(DACK 0 - DACK 3)
DMA Acknowledge: An active low level on the acknowl
edge output informs the peripheral connected to that
channel that it has been selected for a DMA cycle. The
DACK output acts as a "chip select'* for the peripheral
device requesting service. This line goes active (low)
and inactive (high) once for each byte transferred even if cm;
—•> o*c« *
2. Data Bus Buffer
This three-state, bi-directional, eight bit buffer interfaces
the 8257 to the system data bus.
<D0-07)
Data Bus Lines: These are bi-directional three-state lines.
When the 8257 is being programmed by the CPU. eight-
bits of data for a DMA address register, a terminal count
register or the Mode Set register are received on the data
bus. When the CPU reads a DMA address register, a
terminal count register or the Status register, the data is
sent to the CPU over the data bus. During DMA cycles
(when the 8257 is the bus master), the 8257 will output the
most significant eight-bits of the memory address (from
one of the DMA address registers) to the 8212 latch via the
data bus. These address bits will be transferred at the
beginning of the DMA cycle: the bus will then be released
to handle the memory data transfer during the balance of Figure 4. 8257 Block Diagram Showing Oata Bus
the DMA cycle. Buffer
2-105 AFN-018400
8257/8257-5
3. Read/Write Logic
When the CPU is programming or reading one of the Address Lines: These least significant four address lines
8257*s registers (i.e., when the 8257 is a "slave" device on are bi-directional. In the "slave" mode they are inputs
the system bus), the Read/Write Logic accepts the I/O which select one of the registers to be read or
Read (USE) or I/O Write (175OT) signal, decodes the least programmed. In the "master" mode, they are outputs
significant four address bits, (A0-A3), and either writes which constitute the least significant four bits of the 16-bit
the contents of the data bus into the addressed register
memory address generated by the 8257.
(if I/OW is true) or places the contents of the addressed
register onto the data bus (if I/OR is true). (CS)
During DMA cycles (i.e., when the 8257 is the bus
Chip Select: An active-low input which enables the I/O
"master"), the Read/Write Logic generates the I/O read Read or I/O Write input when the 8257 is being read or
and memory write (DMA write cycle) or I/O Write and programmed in the "slave" mode. In the "master" mode.
memory read (DMA read cycle) signals which control the CS is automatically disabled to prevent the chip from
data link with the peripheral that has been granted the selecting itself while performing the DMA function.
DMA cycle.
Note that during DMA transfers Non-DMA I/O devices 4. Control Logic
should be de-selected (disabled) using "AEN" signal to
This block controls the sequence of operations during all
inhibit I/O device decoding of the memory address as an
DMA cycles by generating the appropriate control signals
erroneous device address.
and the 16-bit address that specifies the memory location
(i/OR) to be accessed.
cycle. ADOA
»I
CNTM — OACK 1
(I/OW)
of the data bus to be loaded into the 8-bit mode set register
CNTM
(CLK)
PRIORITY
(RESET) BUS
2-106 AFN-01840D
8257/8257-5
(TC)
(MEMR)
(AOSTB) MSCT-
(AEN)
CM 3
System Data Bus and the System Control Bus. It may also AOO«
—► OAC« i
CMT«
be used to disable (float) the System Address Bus by use
of an enable on the Address Bus drivers in systems to
inhibit non-DMA devices from responding during DMA
cycles. It may be further used to isolate the 8257 data bus
from the System Data Bus to facilitate the transfer of the 8
most significant DMA address bits over the 8257 data I/O (NTfftftAl
2-107 AFN-018400
I
8257/8257-5
5. Mode Sat Register Note that rotating priority will prevent any one channel
When set, the various bits in the Mode Set register enable from monopolizing the PMA mode; consecutive DMA
each of the four DMA channels, and allow four different cycles will service different channels if more,than one
options for the 8257: channel is enabled and requesting service. There is no
overhead penalty associated with this mode of opera
tion. All DMA operations began with Channel 0 initially
assigned to the highest priority for the first DMA cycle.
I I I I I TTTI
Erubfei AUTOLOAD J T, Enable* DMA Channel 0
Erublct TC STOP Enables DMA Channel 1 Extended Write Bit 5
Enable* EXTCNDEO WRITE Enables DMA Channel 2
Enables ROTATING PRIORITY- Enables DMA Channel 3 If the EXTENDED WRITE bit is set. the duration of both the
MEMW and I/OW signals is extended by activating them
The Mode Set register is normally programmed by the earlier in the DMA cycle. Data transfers within micro
CPU after the DMA address register(s) and terminal computer systems proceed asynchronously to allow
count register(s) are initialized. The Mode Set Register is use of various types of memory and I/O devices with
cleared by the RESET input, thus disabling all options, different access times. If a device cannot be accessed
inhibiting all channels, and preventing bus conflicts on within a specific amount of time it returns a "not ready"
power-up. A channel should not be left enabled unless its indication to the 8257 that causes the 8257 to insert one or
DMA address and terminal count registers contain valid more wait states in its internal sequencing. Some devices
values; otherwise, an inadvertent DMA request (DROn) are fast enough to be accessed without the use of wait
from a peripheral could initiate a DMA cycle that would states, but if they generate their READY response with the
destroy memory data. leading edge of the f/SW or MEMW signal (which
generally occurs late in the transfer sequence), they
The various options which can be enabled by bits in the
would normally cause the 8257 to enter a wait state
Mode Set register are explained below:
because it does not receive READY in time. For systems
with these types of devices, the Extended Write option
Rotating Priority Bit 4
provides alternative timing for the I/O and memory write
In the Rotating Priority Mode, the priority of the channels signals which allows the devices to return an early READY
has a circular sequence. After each DMA cycle, the and prevents the unnecessary occurrence of wait states in
priority of each channel changes. The channel which had the 8257. thus increasing system throughput.
just been serviced will have the lowest priority.
TC Stop Bit 6
2-108 AFN-018400
inter 8257/8257-5
PARAMETERS
PARAMETERS I .PARAMETERS
1
FOR BLOCK 3
FOR BLOCK 1 r IFOR BLOCK 2 HANNEI2UPOATE
CHANNEL 2UPOATE
OCCURS HERE OCCURS HERE
JIRJUL-. rUUUU|_fL\.l
-OATABLOCK J OATA BLOCK? -| hfOATA BLOCK 3 —'
UPOATEFLAG
2-109 AFN01840O
8257/8257-5
OPERATIONAL SUMMARY
CONTROL INPUT CS I/OW I/OR A*
Programming and Reading the 8257 Registers
Program Half of a 0 0 1 0
There are four pairs of "channel registers'*: each pair Channel Register
consisting of a 16-bit DMA address register and a 16-bit
Read Half of a 0 1 0 0
terminal count register (one pair for each channel). The
Channel Register
8257 also includes two "general registers": one 8-bit
Mode Set register and one 8-bit Status register. The program moo© sei 0 0 1 1
registers are loaded or read when the CPU executes a Register
write or read instruction that addresses the 8257 device
and the appropriate register within the 8257. The 8228 Read Status Register 0 1 0 1
•A0-A15: DMA Starting Address. Co-C13: Terminal Count value (N-1). Rd and Wr: DMAVerify (00), Write (01) or Read (10) cycle selection.
AL: Auto Load. TCS:TC STOP. EW: EXTENDED WRITE. RP: ROTATING PRIORITY. EN3-EN0: CHANNEL ENABLE MASK. UP: UPDATE
FLAG. TC3-TC0: TERMINAL COUNT STATUS BITS.
2-110 AFN-01840D
8257/8257-5
Consecutive Transfers
Control Override
Not Ready
REAOV ♦ VERIFY The 8257 has a Ready input similar to the 8080A and the
8085A. The Ready line is sampled in State 3. If Ready is
RESET ENABLE FOR CHANNEL N IF LOW the 8257 enters a wait state. Ready is sampled dur
TC STOP ANO TC ARE ACTIVE
DEACTIVATE COMMANDS
ing every wait state. When Ready returns HIGH the 8257
DEACTIVATE DACKn. MARK ANO TO proceeds to State 4 to complete the transfer. Ready is
OROn HLDA SAMPLE OROn ANO HLDA
RESOLVE OROn PRIORITIES used to interface memory or I/O devices that cannot
RESET HRO IF HLOA ' OOR DRQ • 0
meet the bus set up times required by the 8257.
HLOA ♦ OROo
Speed
BIT 15 BIT 14
READ WRITE
• - r MEMRD —
Figure 9. System Interface for Memory Figure 10. TC Register for Memory Mapped
Mapped I/O I/O Only
\ ADDRESS BUS \
f>
\ CONTROL BUS
\
\ DATA BUS
\
U 0 U J\1$) U 0 U
DRQO DISK 1
SYSTEM
OACKO
-- RAM
DRQ1 MEMORY
DISK 2
AW 0ACK !
8212 DRQ2
OISK3
OACK 2
ORQ3
DACK3 DISK 4
DMA CONTROLLER
ADDRESS BUS
7T
CONTROL BUS
DATA BUS
u U 0 U
DRQ
82S7 SYSTEM
82S1
AND RAM
OACK USART
8212 MEMORY
MODEM
TELEPHONE
LINES
2-112 AFN-O184OD
inter 8257/8257-5
INPUT/OUTPUT
2.4
2.0 2.0 DEVICE
r
0.8 0.8
0.4S
Tracking Parameters
Signals labeled as Tracking Parameters (footnotes 1 and 6-7 under A.C. Specifications) are signals that follow similar
paths through the silicon die. The propagation speed of these signals varies in the manufacturing process but the
relationship between all these parameters is constant. The variation is less than or equal to 50 ns.
Suppose the following timing equation is being evaluated,
WAVEFORMS—PERIPHERAL MODE
WRITE
CHIPSCLCCT
READ
\ /"
AOORESS6US
CHIP SELECT
- H
OAT A BUS
AOORESSBUS
X
L— taw 1
—*>!
—r
Y
i>
f
1 0 HO
RESET
OATA BUS
- T«$TO H
vcc
2-113 AFN-01840O
t*%*ria^
8257/8257-5
WAVEFORMS—DMA .-^c T.
rur
ORQO 3
=5):
TOM-
T«$-
Ta$$ -
AOR STB
MEM/RO/I'O RO— — —
"TOCT
MCM/WR/I/O WR — ^ —
.__y
T«
/ v
NOTf:
I SI I SO I SI I S2 . I S3 I S4 I SI I SI -1 S3 I S4 I SI I SI I SI
o«wdocli -mut.
2-114- AFN-01840O
8257/825?t5 *T»
WAVEFORMS (Continued)
SI | S2
1 « j
1 ". 1 M 1 a 84 i
St | SI
CLOCK \__/ \ /
ORQ 0 3 x^ \
HRQ \
-1
HLOA
TA€L "^ : h-
AEN
J
-
SI | SI
1 "
so SI I S2
CLOCK f^ u
ORQ0 3 "v
6ACKTT3 \ r
f~ \ / S- -
T
— -A
j
RCAOY / \
TC/MARK
/
2-115 AFN-01MOO
^
inter 8257/8257-5
AOORCtt
BUS
00,-00,
$TB
13
DS2
•212
MO
D»>—01, 0S1
AD,
DATA BUS
Oo
A,
O,
i
o.
HENRI CONTROL
CHIP
ol SELECT REAOV
■i L
SCL (Bl T1S
10/0
CS REAOV
HOLD
o,
MLOA
CLK (OUT}
Rf$f T iR
RESET OUT
3 ^
MEMR ORO, ►22- ORQ.
_1 25
m DACK« 6~AC~K«
4 ^
M6MW ORO, ORO,
IOW
Sack,
ORQ,
14
HRO DACK, OACK,
16
HLOA ORO, ORO,
IS
OACK,
CLK TC TC
RESET MARK
OO,
• t212 •
01. OO,
MO 6S1
2-1*16 AFN41840D
inter
ABSOLUTE MAXIMUM RATINGS* •NOTICE: Stresses above those listed under "Absolute
Maximum Ratings" may cause permanent damage to the
device. This is a stress rating only and functional opera
Ambient Temperature Under Bias 0°C to 70°C tion of the device at these or any other conditions above
Storage Temperature -65°C to +150°C those indicated in the operational sections of this specifi
Voltage on Any Pin cation is not implied. Exposure to absolute maximum
With Respect to Ground -0.5V to +7V rating conditions for extended periods may affect device
Power Dissipation 1 Watt reliability.
D.C. CHARACTERISTICS (8257: TA = 0°C to 70°C, VCc = 5.0V ±5%, GND = OV)
(8257-5: TA = 0°C to 70°C, VCc = 5.0V ±10%, GND = 0V)
Vhh HRQ Output High Voltage 3.3 vcc Volts Ioh - -80jiA
«CC Vcc Current Drain 120 mA
2r117 AFN-01840D
8257/8257-5
8257 8257-5
WRITE CYCLE
8257 8257-5
OTHER TIMING
8257 8257-5
TIMING REQUIREMENTS
8257 8257-5
Symbol Parameter Unit
Min. Max. Min. Max.
TIMING RESPONSES
8257 8257-5
Symbol Parameter Unit
Mln. Max. Mln. Max.
TFAAB Adr (AB) (Active) Delay from CLKf (S1)[21 250 250 ns
TAFAB Adr (AB) (Float) Delay from CLKf (SI)121 150 150 ns
TASM Adr (AB) (Stable) Delay from CLKf (S1)121 250 250 ns
TAH Adr (AB) (Stable) Hold from CLK| (S1)[21 TaSM-50 TASM-50 ns
TAHW Adr (AB) (Valid) Hold from Wr| (St. SI)111 300 300 ns
TFADB Adr (DB) (Active) Delay from CLKf (S1)[21 300 300 ns
TAFDB Adr (DB) (Float) Delay from CLK| (S2)[21 Tstt+20 250 TSTT+20 170 ns
NOTES:
1. Tracking Parameter. 3. Load = Vqh = 3.3V. 5- ATOCl < 50 ns.
2. Load = + 50 pF. 4. ATAK < 50 ns. 6. AT0CT < 50 ns.
2-119 AFN-018400