[p111] [p111] WAVEFORM [p111] [p111] [p111] [p111] 0, _ _ _ _- ' [p111] -tpw - [p111] ~ [p111] 8080 OAT A BUS )I( )I( [p111] [p111] DB IN [p111] ts:J.= -- tsri ~ [p111] --j tRR F [p111] \ [p111] t oc- I. [p111] HlDA [p111] [p111] tNT A, lOR. MEMR [p111] DURING HLDA \ [p111] - .J l-tHD [p111] [p111] ~ \_tos- _ tD~ [p111] ------------- [p111] SYSTEM BUS DURING READ [p111] -------- [p111] -------- [p111] ---I---. [p111] [p111] -- -r=t ~I- [p111] I)K [p111] -t::1 '- - - - - - - - - - - -- [p111] -r----p [p111] tRE [p111] [p111] 8080 BUS DURING READ -------- -------------- [p111] t RE - - [p111] [p111] [p111] ). 1 [p111] IOWOR MEMW [p111] WR [p111] *t oc- [p111] r 'wR-1 .1- ~11_twR [p111] [p111] [p111] Il- - - - - - - - - - - - ). 1 [p111] 8080 BUS DURING WRITE [p111] --------- - [p111] --------- - [p111] ftWD5k [p111] SYSTEM BUS DURING WRITE [p111] [p111] [p111] [p111] [p111] SYSTEMBUSENAB~CE [p111] --------- [p111] - :1- }::1' [p111] SYSTEM BUS OUTPUTS - - - - - - - - - ~ - - - -t'~r [p111] - t---- > - - - - - - - - - - - - - - [p111] - < [p111] [p111] VOLTAGE MEASUREMENT POINTS: DO-D7 (when outputs) Logic "0" = a.8V. Logic "1" = 3 av. All other Signals measured [p111] at 1.5V. [p111] "ADVANCED IOW/MEMW FOR 8238 ONLY. [p111] [p111] [p111] [p111] [p111] 2-87 AFN~00213C [p111] 8237A/8237A-4/8237A-5 [p112] HIGH PERFORMANCE [p112] PROGRAMMABLE DMA CONTROLLER [p112] • Enable/Disable Control of Individual • High performance: Transfers up to 1.6M [p112] DMA Requests Bytes/Second with 5 MHz 8237A·5 [p112] • Directly Expandable to any Number of [p112] • Four Independent DMA Channels [p112] Channels [p112] • Independent Autoinitialization of all • End of Process Input for Terminating [p112] Channels Transfers [p112] • Software DMA Requests [p112] • Memory·to·Memory Transfers [p112] • Independent Polarity Control for DREQ [p112] • Memory Block Initialization and DACK Signals [p112] • Available in EXPRESS [p112] • Address Increment or Decrement - Standard Temperature Range [p112] The 8237A Multimode Direct Memory Access (DMA) Controller is a peripheral interface circuit for microprocessor sys· [p112] tems. It is designed to improve system performance by allowing external devices to directly transfer information from [p112] the system memory. Memory·to·memory iransfer capability is also provided. The 8237A offers a wide variety of pro· [p112] grammable control features to enhance data throughput and system optimization and to allow dynamic reconfigura· [p112] tion under program control. [p112] The 8237A is designed to be used in conjunction with an external 8·bit address register such as the 8282. It contains [p112] four independent channels and may be expanded to any number of channels by cascading additional controller chips. [p112] The three basic transfer modes allow programmability of the types of DMA service by the user. Each channel can be [p112] individually programmed to Autoinitialize to its original condition following an End of Process (EOP). [p112] Each channel has a full 64K address and word count capability. [p112] The 8237A·4 and 8237A-5 are 4 MHz and 5 MHz selected versions of the standard 3 MHz 8237A respectively. [p112] [p112] [p112] [p112] [p112] 110 BUFFER [p112] [p112] [p112] [p112] [p112] A. [p112] [p112] [p112] MEMW [p112] TIMING [p112] (NOTE 11) 5 [p112] 'NO [p112] CONTROL BASE CURRENT [p112] "" [p112] ADDRESS [p112] (HI) [p112] WORD [p112] COUNT [p112] CURRENT [p112] ADDRESS [p112] (16) [p112] WORD [p112] COUNT HLDA [p112] (16) (16) [p112] AOSTB [p112] AEN 9 [p112] HRQ [p112] [p112] [p112] elK [p112] RESET [p112] OACK2 [p112] 080-087 [p112] [p112] [p112] [p112] [p112] Figure 2. [p112] Figure 1. Block Diagram Pin Configuration [p112] [p112] 2-88 [p112] 8237 A/8237A-4/8237 A-5 [p113] [p113] Table 1. Pin Description [p113] Symbol [p113] ,---------,---r------------------, [p113] Symbol Type Name and Function [p113] Type Name and Function [p113] Vee Power: + 5 volt supply. ory-to-memory operations, data [p113] from the memory comes into the [p113] Vss Ground: Ground. [p113] 8237A on the data bus during the [p113] ClK I Clock Input: Clock Input controls read-from·memory transfer. In the [p113] the internal operations of the write-to-memory transfer, the data [p113] 8237A and its rate of data trans· bus outputs place the data Into the [p113] fers. The input may be driven at up new memory location. [p113] to 3 MHz for the standard 8237A [p113] lOR I/O I/O Read: I/O Read is a bidirec- [p113] and up to 5 MHz for the 8237A-5. tional active low three-state line. In [p113] CS I Chip Select: Chip Select is an ac- the Idle cycle, it is an input control [p113] tive low input used to select the signal used by the CPU to read the [p113] 8237A as an I/O device during the control registers. In the Active cy- [p113] Idle cycle. This allows CPU com- cle, it is an output control signal [p113] munication on the data bus. used by the 8237 A to access data [p113] from a peripheral during a DMA [p113] RESET I Re••t: Reset is an active high in- [p113] Write transfer. [p113] put which clears the Command, [p113] Status, Request and Temporary lOW 110 I/O Write: 110 Write is a bidirec- [p113] . registers. It also clears the tional active low three-state line. In [p113] first/last flip/flop and sets the the Idle cycle, it is an input control [p113] Mask register. Following a Reset signal used by the CPU to load In- [p113] the device is in the Idle cycle. formation into the 8237 A. In the Ac- [p113] tive cycle, it is an output contral [p113] READY I Resdy: Ready is an input used to [p113] signal used by the 8237A to load [p113] extend the memory read and write [p113] data to the peripheral during a [p113] pulses from the 8237A to accom- [p113] DMA Read transfer. [p113] modate slow memories or 110 per· [p113] ipheral devices. Ready must not EOP I/O End 01 Process: End of Process is [p113] C [p113] [p113] [p113] [p113] [p113] make transitions during its speci· an active low bidirectional signal. [p113] fied setup/hold time. Information concerning the com- [p113] pletion of DMA services is avail- [p113] HlDA I Hold Acknowledge: The active able at the bidirectional EOP pin. [p113] high Hold Acknowledge from the The 8237 A allows an external sig- [p113] CPU indicates that it has relin- nal to terminate an active DMA [p113] quished control of the system service. This is accomplished by [p113] busses. pulling the EOP Input low with an [p113] DREQO-DREQ3 I DMA Request: The DMA Request external EOP signal. The 8237A al- [p113] lines are individual asynchronous so generates a pulse when the ter- [p113] channel request inputs used by pe- minal count (TC) lor any channel is [p113] ripheral circuits to obtain DMA reachedc This generates an EOP [p113] service. In fixed Priority, DREQO ~al which is output through the [p113] has the highest priority and EOP Line. The reception of EOP, [p113] DREQ3 has the lowest priority. A either internal or external, will [p113] request is generated by activating cause the 8237A to terminate the [p113] the DREQ line of a channel. DACK service, reset the' request, and, if [p113] will acknowledge the recognition Autoinitialize is enabled, to write [p113] of DREQ signal. Polarity of DREQ the base registers to the' current [p113] is programmable. Reset intializes registers of that channel. The mask [p113] these lines to active high. DREQ bit and TC bit in the status word [p113] must be maintained until the corre- will be set for the currently active [p113] sponding DACK goes active. chann",1 by EOP unless the channel [p113] is progrilmmed for Autoinitialize. In [p113] DBO-DB7 I/O Data Bus: The Data Bus lines are [p113] bidirectional three-state signals that case, the mask bit remains [p113] clear. During memory-lo-memory [p113] connected to the system data bus. [p113] The outputs are enabled in the Pro- transfers, EOP will be output when [p113] the TC for channel 1 occurs. EOP [p113] gram condition during the I/O Read [p113] should be tied high with a pull·up [p113] to output the contents of an Ad- [p113] resistor if it is not used to prevent [p113] dress register, a Status register, [p113] erroneous end of process inputs. [p113] the Temporary register or a Word [p113] Count register to the CPU. The out- AO-A3 110 Address: The four least significant [p113] puts are disabled and the inputs address lines are bidirectional [p113] are read during an 110 Write cycle three-state signals. In the IQle cy- [p113] when the CPU is programming the cle they are inputs and are used by [p113] 8237A control registers. During the 8237 A to address the control [p113] DMA cycles the most Significant 8 register to be loaded or read In the [p113] bits of the address are output onto Active cycle they are outputs and [p113] I [p113] the data bus to be strobed into an [p113] external latch by ADSTB. In mem- [p113] I provide the lower 4 bits of the out· [p113] put address. [p113] [p113] [p113] 2-89 AFN·00789D [p113] 8237A/8237A-4/8237~5 [p114] [p114] Table 1. Pin Description (Continued) [p114] [p114] Symbol Type Name and Function Symbol Type Name and Function [p114] [p114] A4-A7 0 Address: The four most significant AEN 0 Address Enable: Address Enable [p114] address lines are three-state out- enables the S-bit latch containing [p114] puts and provide 4 bits of address. the upper 8 address bits onto the [p114] These lines are enabled only during system address bus. AEN can also [p114] the DMA service. be used to disable other system bus [p114] HRO· 0 Hold Request: This Is the Hold Re- drivers during DMA transfers. AEN [p114] quest to the CPU and is used to re- is active HIGH. [p114] quest control of the system bus. If ADSTB 0 Address Strobe: The active high, [p114] the corresponding mask bit is Address Strobe is used to strobe the [p114] clear, the presence of any valid upper address byte into an external [p114] DR EO causes 8237A to issue the latch. [p114] HRO. After HRO goes active at [p114] MEMR 0 Memory Read: The Memory Read [p114] least one clock cycle (TCY) must [p114] signal is an active low three-state [p114] oecur before HLDA,goes active. [p114] output used to access data from the [p114] DACKO-DACK3 0 DMA Acknowledge: DMA Ac- selected memory location during a [p114] knowledge is used to notify the in- DMA Read or a memory-to-memory [p114] dividual peripherals when one' has transfer. [p114] been granted a DMA cycle. The [p114] MEMW 0 Memory Write: The Memory Write [p114] sense of these lines is program- [p114] is an active low three-state output [p114] mable. Reset initializes them to ac- [p114] used to write data to the selected [p114] tive low. [p114] memory location during a DMA [p114] Write or a memory-ta-memory [p114] FUNCTIONAL DESCRIPTION transfer. [p114] [p114] The 8237A block diagram includes the major logic be the 2 TTL clock from an 8224 or ClK from an [p114] blocks and all of the internal registers. The data inter- 8085AH or 8284A. For 8085AH-2 systems above 3.9 MHz, [p114] connection paths are also shown. Not shown are the the 8085 ClK(OUT) does not satisfy 8237A-5 clock lOW [p114] various control signals between the blocks. The 8237A and HIGH time requirements. In this case, an external [p114] contains 344 bits of internal memory in the form of clock should be used to drive the 8237A-5. [p114] registers_ Figure 3 lists these registers by name and [p114] shows the size of each. A detailed description of the DMA Operation [p114] registers and their functions can be found under [p114] Register Description. The 8237A is designed to operate in two major cycles. [p114] These are called Idle and Active cycles. Each device cy- [p114] Name Size Number [p114] cle is made up of a number of states. The 8237A can [p114] Base Address Registers 16 bits 4 assume seven separate states, each composed of one [p114] Base Word Count Registers 16 bits 4 full clock period_ 8tate I (81) is the inactive state. It Is [p114] Current Address Registers 16 bits 4 [p114] Current Word Count Registers 16bits 4 entered when the 8237A has no valid DMA requests [p114] Temporary Address Register 16 bits 1 pending. While in 81, the DMA controller is inactive but [p114] Temporary Word Count Register 16bits 1 . may be in the Program Condition, being programmed by [p114] Status Register 8bits 1 the processor. 8tate 80 (80) is the first state of a DMA [p114] Command Register 8bils 1 [p114] Temporary Register 8 bits 1 [p114] service. The 8237 A has requested a hold but the pro- [p114] Mode Registers 6bils 4 cessor has not yet returned an acknowledge. The 8237 A [p114] Mask Register 4bils 1 may still be programmed until it receives HlDA from the [p114] Request Register 4bils 1 CPU. An acknowledge from the CPU will signal that [p114] DMA transfers may begin. 81, 82, 83 and 84 are the [p114] working states of the DMA service. If more' time is [p114] Figure 3. 8237A Internal Registers needed to complete a transfer than is available with nor- [p114] The 8237A contains three basic blocks of control logic. mal timing, wait states (8W) can be inserted between 82 [p114] The Timing Control block generates internal timing and or 83 and 84 by the use of the Ready line on the 8237A. [p114] external control signals for the 8237 A_ ,The Program Note that the data is transferred directly from the I/O [p114] Command Control block decodes the various com- device to memory (or vice versa) with lOR and MEMW (or [p114] mands given to the 8237A by the microprocessor prior MEMR and lOW) being active at the same time. The data [p114] to servicing a DMA Request. It also decodes the Mode is not read into or driven out of the 8237A in I/O-to- [p114] Control word used to select the type of DMA during the memory or memory-to-I/O DMA transfers. [p114] servicing. The Priority Encoder block resolves priority Memory-to-memory transfers require a read-from and a [p114] contention between DMA channels requesting service write-to-memory to complete each transfer. The states, [p114] simultaneously. which resemble the normal working states, use two [p114] digit numbers for identification. Eight states are re- [p114] The Timing Control block derives internal timing from quired for a single transfer. The first four states (811, [p114] the clock input. In 8237A systems this input will usually 812, 813, 814) are used for the read-from-memory half [p114] [p114] [p114] 2-90 AFN·OO7B9D [p114] 8.237 A/8237 A-4/8237 A-5 [p115] [p115] and the last four states (S21, 522, 523, S24) for the write- becomes active. Again, an Autoinitialization will occur [p115] to-memory half of the transfer. at the end of the service if the channel has been pro- [p115] grammed for it. [p115] IDLE CYCLE [p115] Demand Trans.er Mode - In Demand Transfer mode the [p115] When no channel is requesting service, the 8237A will device is programmed to continue making transfers [p115] enter the Idle cycle and perform "51" states. Ln this until a TC or external EOP is encountered or until DREQ [p115] cycle the 8237A will sample the DREQ lines every clock goes Inactive. Thus transfers may continue until the 1/0 [p115] cycle to determine If any channel is requesting a DMA device has exhausted Its data capacity. After the 1/0 [p115] service. The device will also sample CS, looking for an device has had a chance to catch up, the DMA service is [p115] attempt by the microprocessor to write or read the Inter- re-established by means of a DREQ. During the time [p115] nal registers of the 8237A. When CS is low and HLDA is between services when the microprocessor is allowed [p115] low, the 8237A enters the Program Condition. The CPU to operate, the intermediate values of address and word [p115] can now establish, change or inspect the internal defini- count are stored in the 8237A Current Address and Cur- [p115] tion of the part by reading from or writing to the internal rent Word Count registers. Only an EOP can cause an [p115] registers. Address lines AO-A3 are inputs to the device Autoinitialize at the end of the service. EOP is generated [p115] and select which registers will be read or written. The either by TC or by an external signal. [p115] lOR and lOW lines are used to select and time reads or [p115] writes. Due to the number and size of the internal regis- Cascade Mode - This mode is used to cascade more [p115] ters, an internal flip-flop is used to generate an addi- than one 8237A together for simple system expansion. [p115] tional bit of address. This bit is used to determine the The HRQ and HLDA signals from the additional 8237A [p115] upper or lower byte of the 16-bit Address and Word are connected to the DREQ and DACK signals of a chan- [p115] Count registers. The flip:flop is reset by Master Clear or nel of the initial 8237A. This allows the DMA requests of [p115] Reset. A separate software command can also reset this the additional device to propagate through the priority [p115] flip-flop. network circuitry of the preceding device. The priority [p115] chain is preserved 'and the new device must wait for its [p115] Special software commands can be executed by the turn to acknowledge requests. Since the cascade chan- [p115] 8237A in the Program Condition. Thes!,£ommands are nel of the initial 8237 A is used only for prioritizing the [p115] decoded as sets of addresses with the CS and lOW. The [p115] additional device, it does not output any address or con- [p115] commands do not make use of the data bus. Instruc- [p115] trol signals of its own. These could conflict with the [p115] tions include Clear First/Last Flip-FLop and Master outputs of the active channel In the added device. The [p115] Clear. 8237A will respond to DREQ and DACK but all other out- [p115] ACTIVE CYCLE puts except HRQ will be disabled. [p115] [p115] When the 8237A Is in the Idle cycle and a non-masked Figure 4 shows two additional devices cascaded into an [p115] channel requests a DMA service, the device will output initial device using two of the previous channels. This [p115] an HRQ to the microprocessor and enter the Active cy- forms a two level DMA system. More 8237As could be [p115] cle. It is in this cycle that the DMA service will take added at the second level by using the remaining chan- [p115] place, in one of four modes: nels of the first level. Additional devices can also be [p115] added by cascading into the channels of the second [p115] Single Trans.er Mode - In Single Transfer mode the level devices, forming a third level. [p115] device is programmed to make one transfer only. The [p115] word count will be decremented and the address dec- 2ND LEVEL [p115] remented or incremented following each transfer. When [p115] the word count "rolls over" from zero to FFFFH, a Ter- [p115] minal Count (TC) will cause an Autoinitialize if the chan- [p115] nel has been programmed to do so. [p115] 1ST LEVEL 8237A [p115] MICROPROCESSOR [p115] DREQ must be held active until DACK becomes active in [p115] t-- HRQ DREQ 1- HRQ [p115] order to be recognized. If DREQ is held active through- [p115] I--- HLDA DACK ~ HLDA [p115] out the single transfer, HRQ will go inactive and release [p115] the bus to the system. It will again go active and, upon 8237A [p115] receipt of a new HLDA, another single transfer will be [p115] performet;!, in 8080A, 8085AH, 8088, or 8086 system this DREQ [p115] r-- HRQ [p115] [p115] will ensure one full machine cycle execution between DACK r-- HLDA [p115] DMA transfers. Details of timing between the 8237A and [p115] INITIAL DEVICE [p115] other bus control protocols,will depend upon the char- 8237A [p115] [p115] acteristics of the microprocessor involved. [p115] [p115] Block Trans.er Mode - In Block Transfer mode the [p115] device Is activated by DREQ to continue making trans- ADDITIONAL [p115] fers during the service until a TC, caused by word count DEVICES [p115] going to FFFFH, or an external End of Process (EOP) is [p115] encountered. DREQ need only be held active until DACK Figure 4_ Cascaded 8237As [p115] [p115] [p115] 2-91 AFN·00789D [p115] 8237 A/8237 A-4/8237 A-5 [p116] [p116] TRANSFER TYPES based upon the descending value of their number. The [p116] channel with the lowest priority is 3 followed by 2, 1 and [p116] Each of the three active transfer modes can perform the highest priority channel, O. After the recognition of [p116] three different types of transfers. These are Read, Write anyone channel for service, the other channels are pre- [p116] and Verify. Write transfers move data from an I/O device vented from interferrlng with that service until it is [p116] to the memory by activating MEMW and lOR. Read completed. [p116] transfers move data from memory to an I/O device by [p116] activating MEMR and lOW. Verify transfers are pseudo The second scheme is Rotating Priority. The last chan- [p116] transfers. The 823?A operates as in Read or Write nel to get service becomes the lowest priority channel [p116] transfers generating addresses, and responding to EOP, with the others rotating accordingly. [p116] etc. However, the memory and I/O control lines all remain [p116] inactive. Verify mode is not permitted during memory to , [p116] memory operation. 11' 2nd 3rd [p116] Service Service Service [p116] Memory·lo·Memory - To perform block moves of data highest o 2 _service \3_'service [p116] from one memory address space to another with a mini· 1 _service \ 3_ request 0 [p116] mum of program effort and time, the 823?A includes a [p116] 2 ,0 1 [p116] memory·to·memory transfer feature. Programming a bit lowest 3 1 2 [p116] in the Command register selects channels 0 and 1 to [p116] operate as memory·to·memory transfer channels. The [p116] transfer is initiated by setting the software DREQ for [p116] channel O. The 823?A requests a DMA service in the nor· With Rotating Priority In a single chip DMA system, any [p116] ,mal manner. After HLDA is true, the device, using eight· device requesting service is guaranteed to be recog- [p116] state transfers in Block Transfer mode, reads data from nized after no more than three higher priority services [p116] the memory. The channel 0 Current Address register is have occurred. This prevents anyone channel from [p116] the source for the address used and is decremented or monopolizing the system. [p116] incremented in the normal manner. The data byte read [p116] from the memory is stored in the 823?A inte~nal Tem· Compressed Timing - In order to achieve even greater [p116] porary register. Channel 1 ihen writes the data' from the throughput where system characteristics permit, the [p116] Temporary register to memory using the address in its 823?A can compress the transfer time to two clock [p116] Current Address register and incrementing or decre· cycles. From Figure 11 It can be seen that state S3 Is [p116] menting it in the normal manner. The channel 1 Current used to extend the access time of the read pulse. By [p116] Word Count is decremented. When the word count of removing state S3, the read pulse width is made equal to [p116] channel 1 goes to FFFFH, a TC is generated causing an the write pulse width and a transfer consists only of [p116] EOP output terminating the service. state S2 to change the address and state S4 to perform [p116] the read/write. S1 states will still occur when A8-A15 [p116] Channel 0 may be programmed to retain the same ad· need updating (see Address Generation). Timing for [p116] dress for all transfers. This allows a single word to be compressed transfers is found in Figure 14. [p116] written to a block of memory. [p116] Address Generation - In order to reduce pin count, the [p116] The 823?A will respond to external EOP signals during 823?A multiplexes the eight higher order address bits [p116] memory·to·memory transfers. Data comparators in on the data lines. State S1 is used to output the higher [p116] block search schemes may use this input to terminate order address bits to an external latch from which they [p116] the service when a match is found. The timing of may be placed on the address bus. The falling edge of [p116] memory·to·memory transfers is found in Figure 12. Address Strobe (ADSTB) is used to load these bits from [p116] Memory·to·memory operations can be detected as an the data lines to the latch. Address Enable (AEN) is used [p116] active AEN with no DACK outputs. to enable the bits onto the address bus through a three- [p116] state enable. The lower order address bits are outputby [p116] Autoinitialize - By programming a bit in tlie Mode reg· the 823?A directly. Lines AO-A? should be connected to [p116] ister, a channel may be set up as an Autoinitialize chan· the address bus. Figure 11 shows the time relationships [p116] nel. During Autoinitialize initialization, the original between CLK, AEN, ADSTB, DBO-DB7 and AO-A? [p116] values of the Current Address and Current Word Count [p116] registers are automatically restored from the Base During Block and Demand Transfer mode services, [p116] Address and Base Word count registers of that channel which include multiple transfers, the addresses gener- [p116] following EOP. The base registers are loaded simultane· ated will be sequential. For many transfers the data held [p116] ously with the current registers by the microprocessor in the external address latch will remain the same. This [p116] and remain unchanged throughout the DMA service. The data need only change when a carry or borrow from A7 [p116] mask bit is not set when the channel is in Autoinitialize. to A8 takes place in the normal sequence of addresses. [p116] Following Autoinitialize the channel is ready to perform To save time and speed transfers, the 823?A executes [p116] another DMA service, without CPU intervention, as soon S1 states only when updating of A8-A15 in the latch is [p116] as a valid DREQ is detected. necessary. This means for long services, S1 states and [p116] Priority - The 823?A has two types of priority encoding Address Strobes may occur only once every 256 trans- [p116] available as software selectable options. The first is fers, a savings of 255 clock cycles for each 256 [p116] FixfJd Priority which fixes the channels in priority order transfers. [p116] [p116] [p116] 2-92 AFN·00789D [p116] inter 8237 A/8237 A-4/8237 A·5 [p117] [p117] REGISTER DESCRIPTION Command Register /!: , , -,' [p117] 7654321 o _BIINumbar [p117] [p117] Current Address Register - Each channel has a 16-bit [p117] I I I " I I I I [p117] Current Address register. This register holds the value Yo Memory-lo-memory disable [p117] Memory.to.memory enable [p117] of the address used during DMA transfers. The address [p117] o Channel 0 address hold disable [p117] is automatically incremented or decremented after each [p117] trans·fer and the intermediate values of the address are -{ 1 [p117] X [p117] Channel 0 address hold enable [p117] If bit 0=0 [p117] stored in the Current Address register during the trans- [p117] fer. This register is written or read by the micro- I o Controller enable [p117] l 1 Controller disable [p117] processor in successive 8-bit bytes. It may also be reini- [p117] tialized by an Autoinitialize back to its original value. [p117] Autoinitialize takes place only after an EOP. I o1 Compressed [p117] Normal liming [p117] timing [p117] I X Ifb1t0=1 [p117] Current Word Register - Each channel has a 16-bit Cur· [p117] I o Fixed priority [p117] rent Word Count ,register. This register determines the l 1 Rotating priority [p117] number of transfers to be performed. The actual number [p117] of transfers will be one more than the number pro- [p117] grammed in the Current Word Count register (I.e., pro- [p117] Io 1 [p117] Late write selection [p117] Extended write selection [p117] gramming a count ot100 will result in 101 transfers). The I X If bit 3=1 [p117] word count is decremented after each transfer. The f o DREO sense active high [p117] intermediate value of the word count is stored in the reg- I DREO sense active low [p117] ister during the transfer. When the value in the register [p117] goes from zero to FFFFH, a TC will be generated. This I o DACK sense active low [p117] l DACK sense active high [p117] register is loaded or read in successive 8-bit bytes by [p117] the microprocessor in the Program Condition. Follow· Mode Register , ,'';, ~ [p117] ing the end of a DMA service it may also be reinitialized [p117] by an Autoinitialization back to it's original value. Auto- [p117] initialize can occur only when an EOP occurs. If it is not [p117] Autoinitialized, this register will have a count of FFFFH [p117] after TC. [p117] [p117] Base Address and 'Base Word Count Registers - Each [p117] 00 Verify transfer [p117] channel has a pair of Base Address and Base Word 01 Write lransfer [p117] Count registers. These 16-bit registers store the original L...._ _- { 10 Read lransfer [p117] value of their associated current registers. During Auto- 11 Illegal [p117] initialize these values are used to restore the current XX If bits 6 and 7= 11 [p117] registers to their original values. The base registers are [p117] "------1 0 Autoinitialization disable [p117] written simultaneously with their corresponding current 1 Autoinitialization enable [p117] register in 8-bit bytes in the Program Condition by the [p117] microprocessor. These registers cannot be read by the "--------1 0 Address increment select [p117] 1 Address decrement select [p117] microprocessor. [p117] 00 Demand mode select [p117] Command Register - This 8-bit register controls the [p117] ' - - - - - - - - - { ~~ ~:~~~e :o":ees:~~:~t [p117] operation of the 8237A. It is programmed by the micro- [p117] processor in the Program Condition and is cleared by 11 Cascade mode select [p117] Reset or a Master Clear instruction. The following table Request Register [p117] lists the function of the command bits. See Figure 6 for [p117] address coding. r'-,...:,...:,...:...,r=-,..=..,:...,-.:.., _ B i t Number [p117] [p117] Mode, Register - Each channel has a 6-bit Mode regis- [p117] ter associated with it. When the register is being written [p117] to by the microprocessor in the Program Condition, bits [p117] o and 1 determine which. channel Mode register is to be [p117] written. "-_ _-I. 0 Reset request bit [p117] 1 Set request bit [p117] [p117] Request Register - The 8237A can respond to requests rately under software control or is cleared upon genera- [p117] for DMA service which are initiated by software as weli tion of a TC or external EOP. The entire register is [p117] as by a DREQ, Each channel has a request bit associ- cleared by a Reset. To set or reset.a bit, the software [p117] ated with it in the 4-bit Request register. These are non- loads .the proper form of the data word. See Figure 5 for [p117] maskable and subject to prioritization by the Priority register address coding. In order to make a software re- [p117] Encoder network. Each register bit is set or reset sepa- quest, the channel must be in Block Mode. [p117] [p117] [p117] [p117] [p117] 2-93 AFN·OO789D [p117] intJ 8237 A't8237A-4/8237 A-5 [p118] [p118] [p118] o _ _ Bit Number {J tj [p118] Mask Register - Each channel has associated with it II r--,r'-r-'-r-'--r..--r-" [p118] mask' bit which can be set to disable the incoming [p118] 1 Channel 0 has reached TC [p118] DREQ, Each mask bit is set when its associated channel [p118] Channell has reached TC [p118] produces an EOP if the channel is not programmed for Channel 2 has reached TC [p118] Autoinitialize, Each bit of the 4·bit Mask register may Channel 3 has reached TC [p118] also be set or cleared separately under software control. [p118] The entire register is also set by a Reset. This disables Channel 0 request [p118] ' - - - - - - - - 1 Channell request [p118] all DMA requests until a clear Mask register instruction ' - - - - - - - - ' - - 1 Channel 2 request [p118] allows them to occur, The instruction to separately set ' - - - - - - - - - - 1 ,Channel 3 request [p118] or clear the mask bits is similar in form to that used with [p118] the Request register: See Figure 5 for instruction ad· Temporary Register - The Temporary register is used [p118] dressing, to hold data during memory·to·memory transfers, Fol· [p118] lowing the completion of the transfers, the last word [p118] moved can be read by the microprocessor in the Pro· [p118] 7 6 5 4 3 2 1 0 _ _ Bit Number [p118] gram Condition, The Temporary regi~ter always con· [p118] tains the last byte transferred in the previous memory· [p118] Select channel 0 mask bit to·memory operation, unless cleared by a Reset. [p118] Don't Care Select channell mask bit [p118] Select channel 2 mask bit Software Commands - These are additional special [p118] Select channel 3 mask bit software commands which can be executed in the Pro· [p118] gram Condition, They do not depend on any specifi9 bit [p118] '-----I 0 Clear mask bit pattern on the data bus. The two software commands [p118] 1 Set, mask bit [p118] are: ' 'i "1·'_1-; cti ~1 f C [p118] Clear Firs tlLas t Flip·Flop: This command is executed [p118] All four bits of the Mask register may also be written prior to writing or reading new address or word count [p118] with a single command, information to the 8237A. This initializes the flip·flop [p118] to a known state so that subsequent accesses to reg· [p118] 6 5 4 3 2 1 0 _ _ Bit Number /', " f' ister contents by the microprocessor will address [p118] upper and lower bytes in the correct sequence. [p118] o Clear channel 0 mask bit I ' 1. • ~ J .' ' [p118] [p118] Set channel 0 mask bit Master Clear: T~iS software'instruction has the same [p118] effect as the hardware Reset. The Command, Status, [p118] o Clear channell mask bit [p118] Set channell mask bit Request, Temporary, and Internal FirstlLast Flip·Flop [p118] registers are cleared and tlW Mask register is set. The [p118] '--_ _-{ 0 Clear channel 2 mask bit 8237A will enter the ,Idle cycle. [p118] 1 Set channel 2 mask bit [p118] r/r'f I" '1.y, ~', [p118] [p118] '-----I 0 Clear channel 3 mask bit [p118] Clear Mask Register: This command clears the mask [p118] 1 Set channel 3 mask bit bits of all four channels, enabling them to accept [p118] DMA requests. [p118] Figure 6 lists the address codes for the software com· [p118] Signals mands: [p118] Register Operation [p118] CS lOR lOW A3 A2 Al AO [p118] Signals [p118] Command Write 0 1 0 " 1 0 0 0 [p118] Mode Write 0 1 0 1 0 1 1 A3 A2 Al AO lOR lOW Operation [p118] Request Write 0 1 0 1 0 0 1 1 0 0 0 0 1 Read Status Register [p118] Mask SeUReset 0 1 0 1'\ 1 0 1 0 1 0 0 0 1 0 Write Command Register [p118] Mask Write 0 1 0 I- 1 1 1 1 [p118] Temporary 1" 1 1 0 0 1 0 1 Illegal [p118] Read 0 0 1 1 0 1 [p118] Status Read J 0 0 {; 1 0 0 0 1 0 0 1 1 0 Write Request Register [p118] [p118] 1 0 1 0 0 1 Illegal [p118] Figure 5. Definition of Register Co TEST POINTS [p121] [p121] 0.8 [p121] < 2.ox= [p121] [p121] 0.8 [p121] DEVICE [p121] UNDER [p121] TeST [p121] I C L-'50 PF [p121] [p121] [p121] [p121] A C TESTING INPUTS ARE DRIVEN AT 2 4V FOR A LOGIC '" AND 0 45V FOR [p121] A LOGIC' 0 " TIMING MEASUR£MENTS ARE MADE AT 2 OV FOR A LOGIC "" [p121] AND 0 BV FOR A LOGIC' 0 " CL -'50pF [p121] CL INCWDES JIG CAPACITANCE [p121] [p121] [p121] [p121] [p121] 1 [p121] 2 _97 AFN-00789D [p121] intJ 8237A/8237~4/8237~5 [p122] [p122] [p122] A.C. CHARACTERISTICS-DMA (MASTER) MODE (TA=O·Cto 70·C,· [p122] Vee= +5V:l:5%, GND=OV) [p122] [p122] 8237A 8237A-4 8237~5 [p122] Symbol Parameter Min. Max. Min. Max. Min. Max. Unit [p122] TAEL AEN HIGH from CLK LOW (51) Delay TIme 300 225 200 ns [p122] TAET AEN LOW from CLK HIGH (51) Delay Time 200 150 130 ns [p122] TAFAB ADR Active to Float De!ay from CLK HIGH 150 120 90 ns [p122] TAFC READ or WRITE Float from CLK HIGH 150 120 120 ns [p122] TAFDB DB Active to Float Delay from CLK HIGH 250 190 170 ns [p122] TAHR ADR from READ HIGH Hold Time TCY-l00 TCY-l00 .TCY-l00 ns [p122] TAHS DB from ADSTB LOW Hold Time 50 40 30 ns [p122] TAHW ADR from WRITE HIGH Hold Time TCY-50 TCY-50 TCY-50 ns [p122] DACKValid from CLK LOW Delay Time (Note 7) 250 220 170 ns [p122] TAK EOP HIGH from CLK HIGH DelayTime 250 190 170 ns [p122] EOP LOW to CLK HIGH DelayTime 250 190 100 ns [p122] TASM ADR Stable from CLK HIGH 250 190 170 ns [p122] TA&S DB to ADSTB LOW Setup Time 100 100 100 ns [p122] TCH Clock High Time (Transitions<;;10 ns) 120 100 80 ns [p122] TCL Clock LOW Time (Transitlons<;;10 ns) 1,50 110 68 ns [p122] TCY CLK Cycle Time 320 250 200 ns [p122] TOCL CLK HIGH to READ or WRITE LOW Delay (Note 4) 270 200 190 ns [p122] TOCTR READ HIGH from CLK HIGH (54) Delay Time [p122] (Note 4) 270 210 190 ns [p122] TDCTW WRITE HIGH from CLK HIGH (54) Delay TIme [p122] (Note 4) 200 150 130 ns [p122] TOOl 160 120 120 ns [p122] HRO Valid from CLK HIGH Delay TIme (Note 5) [p122] TD02 250 190 120 ns [p122] TEPS EOP LOW from CLK lOW Setup TIme 60 45 40 ns [p122] TEPW EOP Pulse Width 300 225 220 ns [p122] TFAAB ADR Float to ActIve Delay from ClK HIGH 250 190 170 ns [p122] TFAC READ orWRITE Active from ClK HIGH 200 150 150 ns [p122] TFADB DB Float to Active Delay from CLK HIGH 300 225 200 ns [p122] THS HlDA Valid to ClK HIGH Setup Time 100 75 75 ns [p122] TIDH Input Data from MEMR HIGH Hold TIme 0 0' 0 ns [p122] TIDS Input Data to MEMR HIGH Setup Time 250 190 170 ns [p122] TODH Output Data from MEMW HIGH Hold TIme 20 20 10 ns [p122] TODV Output Data Valid to MEMW HIGH 290 125 125 ns [p122] TOS DR EO to ClK lOW (SI, 54) Setup Time (Note 7) 0 0 0 ns [p122] TRH ClK to READY lOW Hold TIme 20 20 20 ns [p122] TRS READY to ClK lOW Setup TIme 100 60 60 ns [p122] TSTl ADSTB HIGH from CLK HIGH Delay Time 200 150 130 ns [p122] TSTT ADSTEI lOW from ClK HIGH D!!layT!m~ 140 110 90 ns [p122] [p122] [p122] [p122] [p122] 2-98 AFN·OO789D [p122] inter 8237 A/8237 A-4/8237 A-5 [p123] [p123] A.C. CHARACTERISTICS-PERIPHERAL (SLAVE) MODE (TA = O°C to 70°C. VCC = 5.0V ±5%. [p123] GND';' OV) [p123] [p123] [p123] Symbol Parameter 8237A 8237A-4 8237A·5 'Unit [p123] Min. Max. Min. Max. Min. Max. [p123] TAR ADRValid or CS LOW to READ LOW 50 50 50 ns [p123] TAW ADRValid to WRITE HIGH Setup Time 200 150 150 ns [p123] TCW CS LOW to WRITE HIGH Setup Time 200 150 150 ns [p123] TOW DataValid to WRITE HIGH Setup Time 200 150 150 ns [p123] TRA ADR or CS Hold from READ HIGH 0 0 0 ns [p123] TRDE Data Access from READ LOW (Note 8) 200 200 140' ns [p123] TRDF DB Float Delay from READ HIGH 20 100 20 100 0 70 ns [p123] TRSTD Power Supply HIGH to RESET LOW Setup Time 500 500 500 ns [p123] TRSTS ,RESET to First IOWR 2TCY 2TCY 2TCY ns [p123] TRSTW RESET Pulse Width 300 300 300 ns [p123] TRW READ Width 300 250 200 ns [p123] TWA ADR from WRITE HIGH Hold Time 20 20 20 ns [p123] TWC CS HIGH from WRITE HIGH Hold Time 20 20 20 ns [p123] TWD Data from WRITE HIGH Hold Time 30 30 30 ns [p123] TWWS Write Width 200 200 160 ~s [p123] [p123] [p123] [p123] [p123] WAVEFORMS [p123] [p123] SLAVE MODE WRITE TIMING [p123] I, TCW [p123] -i [p123] I, TWWS [p123] - r TWC [p123] (NOTES) [p123] j I [p123] , TAW - -TWA [p123] [p123] [p123] [p123] AO-A3 ~ [p123] ---.J INPUT VALID [p123] [p123] [p123] [p123] TDW - !--TWD [p123] DBO-oB7 [p123] ==>- INPUT VALID [p123] Figure 9. Slave Mode Write [p123] K [p123] [p123] SLAVE MODE READ TIMING [p123] cs~ / [p123] ~------------------------------------~ [p123] [p123] AO-A3 ~~______~____________A_D_D_RE_S_S_M_U_ST_B_E_V_A_Ll_D______________________~(~______________ [p123] [p123] [p123] [p123] [p123] 0R TA_R_'_~h~ _=_=_=~=~=~=~=~=~=~=_=_=-_-T_-R_-DE_- ~- ~T~-R-W~ =~=~=~=~=~=~=~=~=~=:t-I-~=_-~=_-~=_=L~_:0_: _:,_9)3_ [p123] DBO-DB7 [p123] ___-_, [p123] __ [p123] [p123] Figure 10. Slave Mode Read [p123] _ [p123] ______ [p123] DATA OUT VALID [p123] _ [p123] [p123] [p123] [p123] 2-99 AFN·00789D [p123] inter 8237A/8237~4/8237AH5 [p124] [p124] , WAVEFORMS (Continued) [p124] [p124] DMA TRANSFER TIMING [p124] [p124] [p124] [p124] [p124] CLK [p124] j~rl~~,:H~~rLK.:.u~rt~lk [p124] --1-- [p124] · [p124] ~-r '" I----~ '- I- [p124] TOH [p124] [p124] DREO m' ' \\\\,\\\\\' (NOTE&)' [p124] [p124] [p124] T~_ ~ - [p124] ~ [p124] TDQ_ [p124] [p124] HRC [p124] [p124] THS_ [p124] - I [p124] [p124] [p124] HLOA [p124] /1/, ,\ ,\\\\\\\\\ [p124] [p124] .... [p124] TAELI-- [p124] H TAn~ [p124] \ [p124] TSTL [p124] Vt [p124] 1- [p124] - ~ [p124] - -TEPS [p124] [p124] "DOTE r r"\ [p124] \ [p124] TFAD_ [p124] I- jt-r. [p124] - I-r TA88 [p124] a [p124] ~ [p124] ""08' \ A Ali [p124] - [p124] \ [p124] .,- I-- 1 ==rtt· ADDRI!S8YALID [p124] - I - TAS. [p124] I- TAHW [p124] [p124] [p124] ADDRESS VALID [p124] I-- [p124] I--""A. [p124] +--TAHW [p124] [p124] [p124] [p124] [p124] ~ - I- -TAHA r-TAHR [p124] OOCK [p124] \ ~ [p124] [p124] \ [p124] TFAC I-- [p124] r---'\ [p124] ~ TDOT. [p124] [p124] [p124] ~ [p124] ~ TDeTR r--- - [p124] c-, _TAFe [p124] [p124] [p124] [p124] [p124] ~~ v~~- ~~~ [p124] TCCTW TCCTW- [p124] [p124] [p124] I [p124] [p124] 1I'O.1!XTI!.... w.m 7.c;L ~. [p124] I [p124] [p124] [p124] [p124] I [p124] ' T!I'W [p124] .Y [p124] IXTIIII' \ \ \ \ \ \ \ \ \ \ \' h l l l l l l l l l i l l [p124] Figure 11. DMA Transfer [p124] [p124] [p124] [p124] [p124] 2-100 AFN·00789D [p124] 8237A/8237~4/8237A-5 [p125] [p125] [p125] WAVEFORMS (Continued) [p125] [p125] MEMORY·TO·MEMORY TRANSFER TIMING [p125] [p125] [p125] [p125] [p125] ADSTB [p125] [p125] [p125] [p125] [p125] AO-A7 [p125] [p125] [p125] [p125] [p125] DBO-DB7 [p125] [p125] [p125] [p125] [p125] n [p125] TAK [p125] [p125] [p125] [p125] TEPS [p125] [p125] TEPW [p125] [p125] EXT EOP [p125] -----or-.\\C""T'""S't'"""'t"\\,....,\\l""""r""\"r"""I\\C""T'""ST"""t'\\""or-S't'"""'t"\\"""r"'\ [p125] .....\S""'\\ '""T"//r-T//"'-'Z'""T"ZZr-TO-r-lZ"--- [p125] Figure 12. Memory·lo·Memory Transf8r [p125] [p125] [p125] [p125] [p125] READY TIMING [p125] [p125] [p125] [p125] elK [p125] [p125] [p125] TDel--t~-1 [p125] [p125] [p125] [p125] [p125] TDel TDCTW_ [p125] [p125] [p125] [p125] [p125] EXTENDED~ [p125] [p125] READY [p125] ~~\\~.t:-1'l-r-;/}.-/r-~ _TRS_ [p125] [p125] [p125] [p125] [p125] Figure 13. Ready [p125] [p125] 2-101 AFN·00789D [p125] 8237A/8237~4/8237A-5 [p126] [p126] [p126] WAVEFORMS (Continued) [p126] [p126] [p126] COMPRESSED TRANSFER TIMING [p126] [p126] [p126] [p126] [p126] Figure 14. Compressed Transfer [p126] [p126] [p126] [p126] [p126] RESET TIMING [p126] r------------------------------------~II~' ----------- [p126] -----/lr. [p126] rl------ [p126] Vee . - - - - - - - T R S T D _ _ _ _ _ _ _ _-1 [p126] [p126] TRSTW - - - - [p126] [p126] [p126] RESET _ _ _ _ _ _ _ _ _ _ _ _ _ _ _- - ' , - - - - - - - - - - - - - - - - - [p126] [p126] [p126] [p126] [p126] lOR OR lOW [p126] [p126] [p126] Figure 15. Resel [p126] [p126] [p126] [p126] [p126] 2-102 AFN·OO789D [p126] 8257/8257·5