SlideShare a Scribd company logo
2
Most read
4
Most read
5
Most read
DMA Controller 8257 
By : 
Daniel Ilunga 
1
DMA Controller 8257 
The Intel 8257 is a 4-channel Direct Memory Access (DMA) controller. It is 
specifically designed to simplify the transfer of data at high speeds for the Intel® 
microcomputer systems. Its primary function is to generate, upon a peripheral 
request, a sequential memory address which will allow the peripheral to read or write 
data directly to or from memory. Acquisition of the system bus in accomplished via 
the CPU's hold function. 
The 8257 has priority logic that resolves the peripherals requests and issues a 
composite hold request to the CPU. It maintains the OMA cycle count for each 
channel and outputs a control signal Jo notify the peripheral that the programmed 
number of OMA cycles is complete. Other output control signals simplify sectored 
data transfers. The 8257 represents a significant savings in component count for 
DMA-based microcomputer systems and greatly simplifies the transfer of data at high 
speed between peripherals and memories. 
Functional Block Diagram of 8257: 
The functional blocks of 8257 are data bus buffer, read/write logic, control 
logic, priority resolver and four numbers of DMA channels. 
Each channel has two programmable 16-bit registers named as address 
register and count register. 
2
Block diagram 
The 8257 is a programmable. Direct Memory Access 
(DMA) device which, when coupled with a single 
Intel® 8212 I/O port device, provides a complete four-channels 
DMA controller for use in Intel® 
microcomputer systems. After being initialized by 
software, the 8257 could transfer a block of data, 
containing up to 16.384 bytes, between memory and 
a peripheral device directly, without further 
intervention required of the CPU. Upon receiving a 
DMA transfer request from an enabled peripheral, the 
8257: 
1. Acquires control of the system bus. 
2. Acknowledges that requesting peripheral which is 
connected to the highest priority channel. 
3. Outputs the least significant eight bits of the 
memory 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. 
3
8257 features 
It is a device to transfer the data directly between IO device and memory without 
through the CPU. So it performs a high-speed data transfer between memory and I/O 
device. 
The features of 8257 are: 
1. The 8257 has four channels and so it can be used to provide DMA to four I/O 
devices 
2. Each channel can be independently programmable to transfer up to 64kb of data by 
DMA. 
3. Each channel can be independently perform read transfer, write transfer and 
verify transfer. 
• It is a 40 pin IC and the pin diagram is, 
4
Pin diagram 8257 
5
8257 Modes 
The 8257 processor works on two modes: 
1) Master mode; 
2) Slave mode; 
An active-low input which enables the I/O Read or I/O Write input when the 8257 is 
being read or programmed in the "slave" mode. 
In the "master" mode. CS is automatically disabled to prevent the chip from selecting 
itself while performing the DMA function. 
6
Control word 
Address register is used to store the starting address of memory location for DMA data 
transfer. 
The address in the address register is automatically incremented after 
every operation ( read/write/verify transfer). 
The count register is used to count the number of byte or word transferred by DMA 
The format of count register is 
7
• 14-bits B0-B13 is used to count value and a 2-bits is used for indicate the type of 
DMA transfer (Read/Write/ transfer). 
• In read transfer the data is transferred from memory to I/O device. 
• In write transfer the data is transferred from I/O device to memory. 
• Verification operations generate the DMA addresses without generating 
the DMA memory and I/O control signals. 
• The 8257 has two eight bit registers called mode set register and status 
register. 
• The format of mode set register is, 
8
9
10
• The use of mode set register is: 
1. Enable/disable a channel. 
2. Fixed/rotating priority 
3. Stop DMA on terminal count. 
4. Extended/normal write time. 
5. Auto reloading of channel-2. 
• The bits B0, B1, B2, and B3 of mode set register are used to enable/disable channel -0, 1, 2 
and 3 respectively. A one in these bit position will enable a particular channel and a zero 
will disable it 
• If the bit B4 is set to one, then the channels will have rotating priority and if it zero then the 
channels wilt have fixed priority. 
In rotating priority after servicing a channel its priority is made as lowest. 
In fixed priority the channel-0 has highest priority and channel-2 has lowest priority. 
• If the bit B5 is set to one, then the timing of low write signals (MEMW and IOW) will be 
extended. 
• If the bit B6 is set to one then the DMA operation is stopped at the terminal count. 
• The bit B7 is used to select the auto load feature for DMA channel-2. 
• When bit B7 is set to one, then the content of channel-3 count and address registers are loaded 
in channel-2 count and address registers respectively whenever the channel-2 
reaches terminal count. When this mode is activated the number of channels available for 
DMA reduces from four to three. 
11
The format of status register of 8257 is shown in fig. below: 
12
• The bit B0, B1, B2, and B3 of status register indicates the 
terminal count status of channel-0, 1,2 and 3 respectively. A one in 
these bit positions indicates that the particular channel has reached 
terminal count. 
• These status bits are cleared after a read operation by microprocessor. 
• The bit B4 of status register is called update flag and a one in this 
bit position indicates that the channel-2 register has been 
reloaded from channel-3 registers in the auto load mode of 
operation. 
• The internal addresses of the registers of 8257 are listed in table. 
13
8257 Register Selection 
14
15
DMA operation state diagram 
Single Byte Transfers 
A single byte transfer is initiated by the I/O device raising the DRQ line of one channel of the 8257. If the 
channel is enabled, the 8257 will output a HRQ to the CPU. The 8257 now waits until a HLDA is received 
insuring that the system bus is free for its use. Once HLDA is received the DACK line for the requesting 
channel is activated (LOW). The DACK line acts as a chip select for the requesting I/O device. The 8257 
then generates the read and write commands and byte transfer occurs between the selected I/O device and 
memory. After the transfer is complete, the DACK line is set HIGH and the HRQ line is set LOW to indicate 
to the CPU that the bus is now free for use. DRQ must remain HIGH until DACK is issued to be recognized 
and must go LOW before S4 of the transfer sequence to prevent another transfer from occurring. (See 
timing diagram.) 
Consecutive Transfers 
If more than one channel requests service simultaneously, the transfer will occur in the same way a burst 
does. No overhead is incurred by switching from one channel to another. In each S4 the DRQ lines are 
sampled and the highest priority request is recognized during the next transfer. A burst mode transfer in a 
lower priority channel will be overridden by a higher priority request. Once the high priority transfer has 
completed control will return to the lower priority channel if its DRQ is still active. No extra cycles are needed 
to execute this sequence and the HRQ tine remains active until all DRQ lines go LOW. 
Control Override 
The continuous DMA transfer mode described above can be interrupted by an external device by lowering 
the HLDA line. After each DMA transfer the 8257 samples the HLDA line to insure that it is still active. If it is 
not active, the 8257 completes the current transfer, releases the HRQ line (LOW) and returns to the idle 
state. If DRQ lines are still active the 8257 will raise the HRQ line in the third cycle and proceed normally. 
(See timing diagram.) 
Ready 
The 8257 has a Ready input similar to the 8080A and the 8085A. The Ready line is sampled in State 3. If 
Ready is LOW the 8257 enters a wait state. Ready is sampled during every wait state. When Ready returns 
HIGH the 8257 proceeds to State 4 to complete the transfer. Ready is used to interface memory or I/O 
devices that cannot meet the bus set up times required by the 8257. 
Speed 
The 8257 uses four clock cycles to transfer a byte of data. No cycles are lost in the master to master 
transfer maximizing bus efficiency. A 2MHz clock input will allow the 8257 to transfer at a rate of 500K 
bytes/second. 
Memory Mapped I/O Configurations 
The 8257 can be connected to the system bus as a memory device instead of as an I/O device for memory 
mapped I/O configurations by connecting the system memory control lines to the 8257s I/O control lines and 
the system I/O control lines to the 8257s memory control lines. 
This configuration permits use of the 8080's considerably larger repertoire of memory instructions when 
reading or loading the 8257s registers. Note that with this connection, the programming of the Read (bit 15) 
and Write (bit 14) bits in the terminal count register will have a 
different meaning. 
16
Thank you! 
17

More Related Content

PPTX
3.programmable interrupt controller 8259
MdFazleRabbi18
 
PPTX
Interrupts of microprocessor 8085
mujeebkhanelectronic
 
PPTX
4.programmable dma controller 8257
MdFazleRabbi18
 
PPTX
8259 Operating Modes.pptx
MeenaAnusha1
 
PPTX
8255 PPI
deval patel
 
PPTX
8255 Programmable parallel I/O
Muhammed Afsal Villan
 
PPT
8255 presentaion.ppt
kamlesh deshmukh
 
PPT
8086
Ravi Anand
 
3.programmable interrupt controller 8259
MdFazleRabbi18
 
Interrupts of microprocessor 8085
mujeebkhanelectronic
 
4.programmable dma controller 8257
MdFazleRabbi18
 
8259 Operating Modes.pptx
MeenaAnusha1
 
8255 PPI
deval patel
 
8255 Programmable parallel I/O
Muhammed Afsal Villan
 
8255 presentaion.ppt
kamlesh deshmukh
 

What's hot (20)

PPTX
8251 USART
ShivamSood22
 
PPTX
5.programmable interval timer 8253
MdFazleRabbi18
 
PPT
8254 timer - Microprocessor and interfacing
Amitabh Shukla
 
PPTX
IC 8253 - Microprocessor
Vatsal N Shah
 
PPTX
8251 USART
coolsdhanesh
 
PPTX
Spi in arm7(lpc2148)
Aarav Soni
 
PPT
Memory & I/O interfacing
deval patel
 
PPTX
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
RamaPrabha24
 
PDF
8259 Programmable Interrupt Controller
abhikalmegh
 
PPTX
8086 microprocessor-architecture
prasadpawaskar
 
PPTX
SRAM
rohitladdu
 
PPT
Architecture of 8086 Microprocessor
Mustapha Fatty
 
PPT
8085
Sunil Dutt
 
PPT
8251 universal synchronous asynchronous receiver transmitter
ShivangiSharma879191
 
PPTX
Minimum mode and Maximum mode Configuration in 8086
Jismy .K.Jose
 
PPT
Instruction set-of-8085
saleForce
 
PPTX
8257 DMA Controller
ShivamSood22
 
PDF
8086 memory segmentation
mahalakshmimalini
 
PPT
8051 Addressing Modes
Senthil Kumar
 
8251 USART
ShivamSood22
 
5.programmable interval timer 8253
MdFazleRabbi18
 
8254 timer - Microprocessor and interfacing
Amitabh Shukla
 
IC 8253 - Microprocessor
Vatsal N Shah
 
8251 USART
coolsdhanesh
 
Spi in arm7(lpc2148)
Aarav Soni
 
Memory & I/O interfacing
deval patel
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
RamaPrabha24
 
8259 Programmable Interrupt Controller
abhikalmegh
 
8086 microprocessor-architecture
prasadpawaskar
 
Architecture of 8086 Microprocessor
Mustapha Fatty
 
8251 universal synchronous asynchronous receiver transmitter
ShivangiSharma879191
 
Minimum mode and Maximum mode Configuration in 8086
Jismy .K.Jose
 
Instruction set-of-8085
saleForce
 
8257 DMA Controller
ShivamSood22
 
8086 memory segmentation
mahalakshmimalini
 
8051 Addressing Modes
Senthil Kumar
 
Ad

Viewers also liked (12)

PPT
8237 / 8257 DMA
AJAL A J
 
PPTX
8259 Programmable Interrupt Controller by vijay
Vijay Kumar
 
PPTX
8237 dma controller
Tech_MX
 
PPTX
8279 in microprocessor
Aisu
 
PPT
Direct Memory Access
Sanjay Saluth
 
PPTX
Booths algorithm for Multiplication
Vikas Yadav
 
PPT
Booths Multiplication Algorithm
knightnick
 
PPT
09 Arithmetic
Jeanie Delos Arcos
 
PPT
Booths Multiplication Algorithm
knightnick
 
PPTX
Pipelining and vector processing
Kamal Acharya
 
PPT
Booth Multiplier
Sudhir Kumar
 
PPTX
Direct Memory Access(DMA)
Page Maker
 
8237 / 8257 DMA
AJAL A J
 
8259 Programmable Interrupt Controller by vijay
Vijay Kumar
 
8237 dma controller
Tech_MX
 
8279 in microprocessor
Aisu
 
Direct Memory Access
Sanjay Saluth
 
Booths algorithm for Multiplication
Vikas Yadav
 
Booths Multiplication Algorithm
knightnick
 
09 Arithmetic
Jeanie Delos Arcos
 
Booths Multiplication Algorithm
knightnick
 
Pipelining and vector processing
Kamal Acharya
 
Booth Multiplier
Sudhir Kumar
 
Direct Memory Access(DMA)
Page Maker
 
Ad

Similar to DMA controller intel 8257 (20)

PDF
Intel 8257 programmable dma controller
afzal ahmad
 
PDF
Intel 8257 programmable dma controller
abdulugc
 
PPTX
Programmable dma controller 8237
saravanamanikandan02
 
PDF
3 ijcmes dec-2015-27-simulation of 8257 direct memory access controller (dma)...
INFOGAIN PUBLICATION
 
PPTX
Ppt micro fianle (1)
Pavni Gairola
 
PPTX
Dma and dma controller 8237
Ashwini Awatare
 
PPTX
MCgchjjgccfgxhdhfjxjxjxkxjdsj dudududysudidicic3.pptx
nitheeshk887
 
PPTX
Advance Microprocessor application and its uses 2
nikhilksp512
 
PPTX
8251 -USART.pptx
VikasMahor3
 
PPTX
DMA
Sonali Soni
 
PDF
Module 3 special purpose programmable devices and their interfacing
Deepak John
 
PPTX
8237-DMA-Caontroller.pptx for unitiii in
SureshbabuP10
 
PPTX
IO INTERFACING in unit 2 8086 Microprocessor
tamil arasan
 
PPTX
Microprocessor and Assembly Language - 9.pptx
SwarnimBajra
 
PPTX
Interrupt Controller (pic)8259 and 8259A A.pptx
bavyalece
 
PPT
8086 Microprocessor by Nitish Nagar
Nitish Nagar
 
PPT
8086 Microprocessor Architecture: 16-bit microprocessor
AshwiniTodkar4
 
PPTX
Direct Memory Access_Unit 5.pptx
GovindJha93
 
PDF
INTERFACING WITH INTEL 8251A (USART)
Prof Ansari
 
PDF
INTERFACING WITH INTEL 8251A (USART)
Prof Ansari
 
Intel 8257 programmable dma controller
afzal ahmad
 
Intel 8257 programmable dma controller
abdulugc
 
Programmable dma controller 8237
saravanamanikandan02
 
3 ijcmes dec-2015-27-simulation of 8257 direct memory access controller (dma)...
INFOGAIN PUBLICATION
 
Ppt micro fianle (1)
Pavni Gairola
 
Dma and dma controller 8237
Ashwini Awatare
 
MCgchjjgccfgxhdhfjxjxjxkxjdsj dudududysudidicic3.pptx
nitheeshk887
 
Advance Microprocessor application and its uses 2
nikhilksp512
 
8251 -USART.pptx
VikasMahor3
 
Module 3 special purpose programmable devices and their interfacing
Deepak John
 
8237-DMA-Caontroller.pptx for unitiii in
SureshbabuP10
 
IO INTERFACING in unit 2 8086 Microprocessor
tamil arasan
 
Microprocessor and Assembly Language - 9.pptx
SwarnimBajra
 
Interrupt Controller (pic)8259 and 8259A A.pptx
bavyalece
 
8086 Microprocessor by Nitish Nagar
Nitish Nagar
 
8086 Microprocessor Architecture: 16-bit microprocessor
AshwiniTodkar4
 
Direct Memory Access_Unit 5.pptx
GovindJha93
 
INTERFACING WITH INTEL 8251A (USART)
Prof Ansari
 
INTERFACING WITH INTEL 8251A (USART)
Prof Ansari
 

More from Daniel Ilunga (6)

PDF
Leadership seminar presentation - Daniel Ilunga
Daniel Ilunga
 
PDF
GCC Compiler as a Performance Testing tool for C programs
Daniel Ilunga
 
PPTX
Six sigma
Daniel Ilunga
 
PPTX
Memory management
Daniel Ilunga
 
PPTX
Third parties are actively seeking out end-user information using Facebook
Daniel Ilunga
 
PPTX
Object Oriented Programming - Java
Daniel Ilunga
 
Leadership seminar presentation - Daniel Ilunga
Daniel Ilunga
 
GCC Compiler as a Performance Testing tool for C programs
Daniel Ilunga
 
Six sigma
Daniel Ilunga
 
Memory management
Daniel Ilunga
 
Third parties are actively seeking out end-user information using Facebook
Daniel Ilunga
 
Object Oriented Programming - Java
Daniel Ilunga
 

Recently uploaded (20)

PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
PPTX
Introduction and Scope of Bichemistry.pptx
shantiyogi
 
PDF
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
PPTX
Odoo 18 Sales_ Managing Quotation Validity
Celine George
 
PPTX
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PDF
Module 3: Health Systems Tutorial Slides S2 2025
Jonathan Hallett
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
MartinaBurlando1
 
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
Skill Development Program For Physiotherapy Students by SRY.pptx
Prof.Dr.Y.SHANTHOSHRAJA MPT Orthopedic., MSc Microbiology
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
Understanding operators in c language.pptx
auteharshil95
 
PDF
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
Introduction and Scope of Bichemistry.pptx
shantiyogi
 
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
Odoo 18 Sales_ Managing Quotation Validity
Celine George
 
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
Module 3: Health Systems Tutorial Slides S2 2025
Jonathan Hallett
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
NOI Hackathon - Summer Edition - GreenThumber.pptx
MartinaBurlando1
 
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Skill Development Program For Physiotherapy Students by SRY.pptx
Prof.Dr.Y.SHANTHOSHRAJA MPT Orthopedic., MSc Microbiology
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
Understanding operators in c language.pptx
auteharshil95
 
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 

DMA controller intel 8257

  • 1. DMA Controller 8257 By : Daniel Ilunga 1
  • 2. DMA Controller 8257 The Intel 8257 is a 4-channel Direct Memory Access (DMA) controller. It is specifically designed to simplify the transfer of data at high speeds for the Intel® microcomputer systems. Its primary function is to generate, upon a peripheral request, a sequential memory address which will allow the peripheral to read or write data directly to or from memory. Acquisition of the system bus in accomplished via the CPU's hold function. The 8257 has priority logic that resolves the peripherals requests and issues a composite hold request to the CPU. It maintains the OMA cycle count for each channel and outputs a control signal Jo notify the peripheral that the programmed number of OMA cycles is complete. Other output control signals simplify sectored data transfers. The 8257 represents a significant savings in component count for DMA-based microcomputer systems and greatly simplifies the transfer of data at high speed between peripherals and memories. Functional Block Diagram of 8257: The functional blocks of 8257 are data bus buffer, read/write logic, control logic, priority resolver and four numbers of DMA channels. Each channel has two programmable 16-bit registers named as address register and count register. 2
  • 3. Block diagram The 8257 is a programmable. Direct Memory Access (DMA) device which, when coupled with a single Intel® 8212 I/O port device, provides a complete four-channels DMA controller for use in Intel® microcomputer systems. After being initialized by software, the 8257 could transfer a block of data, containing up to 16.384 bytes, between memory and a peripheral device directly, without further intervention required of the CPU. Upon receiving a DMA transfer request from an enabled peripheral, the 8257: 1. Acquires control of the system bus. 2. Acknowledges that requesting peripheral which is connected to the highest priority channel. 3. Outputs the least significant eight bits of the memory 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. 3
  • 4. 8257 features It is a device to transfer the data directly between IO device and memory without through the CPU. So it performs a high-speed data transfer between memory and I/O device. The features of 8257 are: 1. The 8257 has four channels and so it can be used to provide DMA to four I/O devices 2. Each channel can be independently programmable to transfer up to 64kb of data by DMA. 3. Each channel can be independently perform read transfer, write transfer and verify transfer. • It is a 40 pin IC and the pin diagram is, 4
  • 6. 8257 Modes The 8257 processor works on two modes: 1) Master mode; 2) Slave mode; An active-low input which enables the I/O Read or I/O Write input when the 8257 is being read or programmed in the "slave" mode. In the "master" mode. CS is automatically disabled to prevent the chip from selecting itself while performing the DMA function. 6
  • 7. Control word Address register is used to store the starting address of memory location for DMA data transfer. The address in the address register is automatically incremented after every operation ( read/write/verify transfer). The count register is used to count the number of byte or word transferred by DMA The format of count register is 7
  • 8. • 14-bits B0-B13 is used to count value and a 2-bits is used for indicate the type of DMA transfer (Read/Write/ transfer). • In read transfer the data is transferred from memory to I/O device. • In write transfer the data is transferred from I/O device to memory. • Verification operations generate the DMA addresses without generating the DMA memory and I/O control signals. • The 8257 has two eight bit registers called mode set register and status register. • The format of mode set register is, 8
  • 9. 9
  • 10. 10
  • 11. • The use of mode set register is: 1. Enable/disable a channel. 2. Fixed/rotating priority 3. Stop DMA on terminal count. 4. Extended/normal write time. 5. Auto reloading of channel-2. • The bits B0, B1, B2, and B3 of mode set register are used to enable/disable channel -0, 1, 2 and 3 respectively. A one in these bit position will enable a particular channel and a zero will disable it • If the bit B4 is set to one, then the channels will have rotating priority and if it zero then the channels wilt have fixed priority. In rotating priority after servicing a channel its priority is made as lowest. In fixed priority the channel-0 has highest priority and channel-2 has lowest priority. • If the bit B5 is set to one, then the timing of low write signals (MEMW and IOW) will be extended. • If the bit B6 is set to one then the DMA operation is stopped at the terminal count. • The bit B7 is used to select the auto load feature for DMA channel-2. • When bit B7 is set to one, then the content of channel-3 count and address registers are loaded in channel-2 count and address registers respectively whenever the channel-2 reaches terminal count. When this mode is activated the number of channels available for DMA reduces from four to three. 11
  • 12. The format of status register of 8257 is shown in fig. below: 12
  • 13. • The bit B0, B1, B2, and B3 of status register indicates the terminal count status of channel-0, 1,2 and 3 respectively. A one in these bit positions indicates that the particular channel has reached terminal count. • These status bits are cleared after a read operation by microprocessor. • The bit B4 of status register is called update flag and a one in this bit position indicates that the channel-2 register has been reloaded from channel-3 registers in the auto load mode of operation. • The internal addresses of the registers of 8257 are listed in table. 13
  • 15. 15
  • 16. DMA operation state diagram Single Byte Transfers A single byte transfer is initiated by the I/O device raising the DRQ line of one channel of the 8257. If the channel is enabled, the 8257 will output a HRQ to the CPU. The 8257 now waits until a HLDA is received insuring that the system bus is free for its use. Once HLDA is received the DACK line for the requesting channel is activated (LOW). The DACK line acts as a chip select for the requesting I/O device. The 8257 then generates the read and write commands and byte transfer occurs between the selected I/O device and memory. After the transfer is complete, the DACK line is set HIGH and the HRQ line is set LOW to indicate to the CPU that the bus is now free for use. DRQ must remain HIGH until DACK is issued to be recognized and must go LOW before S4 of the transfer sequence to prevent another transfer from occurring. (See timing diagram.) Consecutive Transfers If more than one channel requests service simultaneously, the transfer will occur in the same way a burst does. No overhead is incurred by switching from one channel to another. In each S4 the DRQ lines are sampled and the highest priority request is recognized during the next transfer. A burst mode transfer in a lower priority channel will be overridden by a higher priority request. Once the high priority transfer has completed control will return to the lower priority channel if its DRQ is still active. No extra cycles are needed to execute this sequence and the HRQ tine remains active until all DRQ lines go LOW. Control Override The continuous DMA transfer mode described above can be interrupted by an external device by lowering the HLDA line. After each DMA transfer the 8257 samples the HLDA line to insure that it is still active. If it is not active, the 8257 completes the current transfer, releases the HRQ line (LOW) and returns to the idle state. If DRQ lines are still active the 8257 will raise the HRQ line in the third cycle and proceed normally. (See timing diagram.) Ready The 8257 has a Ready input similar to the 8080A and the 8085A. The Ready line is sampled in State 3. If Ready is LOW the 8257 enters a wait state. Ready is sampled during every wait state. When Ready returns HIGH the 8257 proceeds to State 4 to complete the transfer. Ready is used to interface memory or I/O devices that cannot meet the bus set up times required by the 8257. Speed The 8257 uses four clock cycles to transfer a byte of data. No cycles are lost in the master to master transfer maximizing bus efficiency. A 2MHz clock input will allow the 8257 to transfer at a rate of 500K bytes/second. Memory Mapped I/O Configurations The 8257 can be connected to the system bus as a memory device instead of as an I/O device for memory mapped I/O configurations by connecting the system memory control lines to the 8257s I/O control lines and the system I/O control lines to the 8257s memory control lines. This configuration permits use of the 8080's considerably larger repertoire of memory instructions when reading or loading the 8257s registers. Note that with this connection, the programming of the Read (bit 15) and Write (bit 14) bits in the terminal count register will have a different meaning. 16