0% found this document useful (0 votes)
6 views39 pages

DMA Controller 8257 Overview and Functions

Uploaded by

pigefi6333
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views39 pages

DMA Controller 8257 Overview and Functions

Uploaded by

pigefi6333
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SYLLABUS

Programmable Peripheral Input/Output Port 8255-Architecture and


modes of operation, Programmabl eInterval tmer 8254 -Architecture
and modes of operation,DMA Controller 8257 Architecture(Just
mention the controlword, no need to memorize the control word of
8254 and 8257)

College of Engg,Kottarakkara,Dept. of
CSE 1
8257
DMA CONTROLLER

College of Engg. Kottarakkara, Dept.


of CSE 2
 It is a 4-channel DMA.
 So 4 I/O devices can be interfaced to DMA
 It is designed by Intel
 Each channel have 16-bit address and 14 bit
counter
 It provides chip priority resolver that resolves
priority of channels in fixed or rotating mode.

College of Engg. Kottarakkara, Dept.


of CSE 3
It generates a TC signal to
indicate the peripheral that the
programmed number of data
bytes have been transferred.
It generates MARK signal to
indicate the peripheral that 128
bytes have been transferred.
It requires single phase clock.
The maximum frequency is 3Mhz
and minimum frequency is 250
Hz. College of Engg. Kottarakkara, Dept.
of CSE 4
 It execute 3 DMA cycles
[Link] read [Link] write
[Link] verify.
 It provide AEN signal that can be
used to isolate CPU and other
devices from the system bus.
 It is operate in two modes.
[Link] Mode
[Link] Mode
College of Engg. Kottarakkara, Dept.
of CSE 5
College of Engg. Kottarakkara, Dept.
of CSE 6
 D0-D7:
 it is a bidirectional ,tri state ,Buffered
,Multiplexed data (D0-D7)and (A8-A15).
 In the slave mode it is a bidirectional (Data is
moving).
 In the Master mode it is a unidirectional
(Address is moving).

College of Engg. Kottarakkara, Dept.


of CSE 7
 IOR:
 It is active low ,tristate ,buffered ,Bidirectional
lines.
 In the slave mode it function as a input line.
IOR signal is generated by microprocessor to
read the contents 8257 registers.
 In the master mode it function as a output line.
IOR signal is generated by 8257 during write
cycle

College of Engg. Kottarakkara, Dept.


of CSE 8
 IOW:
 It is active low ,tristate ,buffered ,Bidirectional
control lines.
 In the slave mode it function as a input line.
IOW signal is generated by microprocessor to
write the contents 8257 registers.
 In the master mode it function as a output
line. IOR signal is generated by 8257 during
read cycle

College of Engg. Kottarakkara, Dept.


of CSE 9
CLK:
 It is the input line ,connected with TTL clock
generator.
 This signal is ignored in slave mode.
RESET:
 Used to clear mode set registers and status
registers
A0-A3:
These are the tristate, buffer, bidirectional
address lines.
In slave mode ,these lines are used as address
inputs lines and internally decoded to access the
internal registers.
In master mode, these lines are used as address
outputs lines,A0-A3 bits of memory address on
the lines.
College of Engg. Kottarakkara, Dept.
of CSE 10
CS:
 It is active low, Chip select input line.
 In the slave mode, it is used to select the chip.
 In the master mode, it is ignored.
A4-A7:
These are the tristate, buffer, output address
lines.
In slave mode ,these lines are used as address
outputs lines.
In master mode, these lines are used as address
outputs lines,A0-A3 bits of memory address on
the lines.

College of Engg. Kottarakkara, Dept.


of CSE 11
READY:
 It is a asynchronous input line.
 In master mode,
 When ready is high it is received the signal.
 When ready is low, it adds wait state between S1
and S3
 In slave mode ,this signal is ignored.
HRQ:
 It is used to receiving the hold request signal
from the output device.

College of Engg. Kottarakkara, Dept.


of CSE 12
HLDA:
 It is acknowledgment signal from microprocessor.
MEMR:
 It is active low ,tristate ,Buffered control output
line.
 In slave mode, it is tristated.
 In master mode ,it activated during DMA read
cycle.
MEMW:
 It is active low ,tristate ,Buffered control input
line.
 In slave mode, it is tristated.
 In master mode ,it activated during DMA write
cycle.
College of Engg. Kottarakkara, Dept.
of CSE 13
AEN (Address enable):
 It is a control output line.
 In master mode ,it is high
 In slave mode ,it is low
 Used it isolate the system address ,data ,and
control lines.
ADSTB: (Address Strobe)
 It is a control output line.
 Used to split data and address line.
 It is working in master mode only.
 In slave mode it is ignore.

College of Engg. Kottarakkara, Dept.


of CSE 14
TC (Terminal Count):
 It is a status of output line.
 It is activated in master mode only.
 It is high ,it selected the peripheral.
 It is low ,it free and looking for a new peripheral.
MARK:
 It is a modulo 128 MARK output line.
 It is activated in master mode only.
 It goes high ,after transferring every 128 bytes
of data block.

College of Engg. Kottarakkara, Dept.


of CSE 15
DRQ0-DRQ3(DMA Request):
 These are the asynchronous peripheral request
input signal.
 The request signals is generated by external
peripheral device.
DACK0-DACK3:
 These are the active low DMA acknowledge
output lines.
 Low level indicate that ,peripheral is selected for
giving the information (DMA cycle).
 In master mode it is used for chip select.

College of Engg. Kottarakkara, Dept.


of CSE 16
College of Engg. Kottarakkara, Dept.
of CSE 17
 It containing Five main Blocks.
1. Data bus buffer
2. Read/Control logic
3. Control logic block
4. Priority resolver
5. DMA channels.

College of Engg. Kottarakkara, Dept.


of CSE 18
DATA BUS BUFFER:
 It contain tristate ,8 bit bi-directional buffer.
 Slave mode ,it transfer data between
microprocessor and internal data bus.
 Master mode ,the outputs A8-A15 bits of
memory address on data lines (Unidirectional).
READ/CONTROL LOGIC:
 It control all internal Read/Write operation.
 Slave mode ,it accepts address bits and control
signal from microprocessor.
 Master mode ,it generate address bits and
control signal.

College of Engg. Kottarakkara, Dept.


of CSE 19
Control logic block:
 It contains ,
1. Control logic
2. Mode set register and
3. Status Register.
CONTROL LOGIC:
 Master mode ,It control the sequence of
DMA operation during all DMA cycles.
 It generates address and control signals.
 It increments 16 bit address and decrement
14 bit counter registers.
 It activate a HRQ signal on DMA channel
Request.
 Slave ,mode it is disabled.
College of Engg. Kottarakkara, Dept.
of CSE 20
MODE SET REGISTERS:
 It is a write only registers.
 It is used to set the operating modes.
 This registers is programmed after
initialization of DMA channel.

D7 D6 D5 D4 D3 D2 D1 D0
AL TCS EW RP EN3 EN2 EN1 EN0

College of Engg. Kottarakkara, Dept.


of CSE 21
AL=1=Auto load mode
AL=0=Rotating mode

 TCS=1=Stop after TC (Disable Channel)


 TCS=0=Start after TC (Enable Channel)

 EW=1=Extended write mode


 EW=0=normal mode.

 RP=1=Rotating priority
 RP=0=Fixed priority.

College of Engg. Kottarakkara, Dept.


of CSE 22
 EN3=1=Enable DMA CH-3
 EN3=0=Disable DMA CH-3

 EN2=1=Enable DMA CH-2


 EN2=0=Disable DMA CH-2

 EN1=1=Enable DMA CH-1


 EN1=0=Disable DMA CH-1

 EN0=1=Enable DMA CH-0


 EN0=0=Disable DMA CH-0

College of Engg. Kottarakkara, Dept.


of CSE 23
STATUS REGISTERS:
 It is read only registers.
 It is tell the status of DMA channels
 TC status bits are set when TC signal is
activated for that channel.
 Update flag is not affected during read
operation.
 The UP bit is set during update cycle . It is
cleared after completion of update cycle.
D7 D6 D5 D4 D3 D2 D 1 D0
0 0 0 UP TC3 TC2 TC1 TCO
College of Engg. Kottarakkara, Dept.
of CSE 24
 UP=Update flag
 UP=1=8257 executing update cycle
 UP=0=8257 executing DMA cycle

 TC3=1=TC activated CH-3


 TC3=0=TC activated CH-3

 TC2=1=TC activated CH-2


 TC2=0=TC activated CH-2

College of Engg. Kottarakkara, Dept.


of CSE 25
 TC1=1=TC activated CH-1
 TC1=0=TC activated CH-1

 TC0=1=TC activated CH-0


 TC0=0=TC activated CH-0

 The address of status register is


A3A2A1A0=1000.

 8257 have 8bit data line and 16 bit address


line.

College of Engg. Kottarakkara, Dept.


of CSE 26
 A0-A3 lines are used to distinguish between
registers ,but they are not distinguish lower
and higher address.
 It is reset by external RESET signal.
 It is also reset by whenever mode set register
is loaded.
 So program initialization with a dummy (00 H).
 FF=1=Higher byte of address
 FF=0=Lower byte of address.

College of Engg. Kottarakkara, Dept.


of CSE 27
 Rotating priority Mode:
 The priority of the channels has a circular
sequence.
 Fixed Priority Rotating Mode:
 The priority is fixed.
 TC Stop Mode
 Auto Load mode
 Extended Write mode

College of Engg. Kottarakkara, Dept.


of CSE 28
Rotating Priority :-
 In the Rotating Priority Mode, the priority of
the channels has a circular sequence. After
each DMA cycle, the priority of each channel
changes. The channel which had just been
serviced will have the lowest priority.
 If the ROTATING PRIORITY bit is not set (set
to a zero). each DMA channel has a fixed
priority. In the fixed priority mode.

College of Engg. Kottarakkara, Dept.


of CSE 29
 If the TC STOP bit is set. a channel is disabled
(i.e.. Its enable bit is reset) after the Terminal
Count (TC) output goes true, thus automatically
preventing further DMA operation on that
channel. The enable bit for that channel must be
re-programmed to continue or begin another
DMA operation.

College of Engg. Kottarakkara, Dept.


of CSE 30
 If the TC STOP bit is not set.
The occurrence of the TC output has no
effect on the channel enable bits. In this case, it
is generally the responsibility of the peripheral to
cease DMA requests in order to terminate a DMA
operation.

College of Engg. Kottarakkara, Dept.


of CSE 31
 The Auto Load mode permits Channel 2 to be
used for repeat block or block chaining
operations, without immediate software
intervention between blocks. Channel 2
registers are initialized as usual for the first
data block

College of Engg. Kottarakkara, Dept.


of CSE 32
 If the EXTENDED WRITE bit is set. the duration of
both the MEMW and I/OW signals is extended by
activating them earlier in the DMA cycle.
 Extended Write option provides alternative timing
for the I/O and memory write signals which
allows the devices to return an early READY and
prevents the unnecessary occurrence of wait
states in the 8257. thus increasing system
throughput.

College of Engg. Kottarakkara, Dept.


of CSE 33
 DMA controller has four modes for data
transfer:
 1. Single Byte Transfer Mode/ Cycle Stealing
 Once the DMAC becomes the bus master, it
will transfer only ONE BYTE and return the
bus back to the microprocessor. As soon as
the microprocessor performs one bus cycle,
DMAC will once again take the bus back from
the microprocessor.
 Both DMAC and microprocessor are
constantly stealing bus cycles from each
other. It is the most popular method of DMA,
because it keeps the microprocessor active in
the background.
College of Engg. Kottarakkara, Dept.
of CSE 34
 After a byte is transferred, the CAR and CWCR
are adjusted accordingly. The system bus is
returned to the µP. For further bytes to be
transferred, the DREQ line must go active
again, and then the entire operation is
repeated.
 2. Block Transfer Mode.
 In this mode, the DMAC is programmed to
transfer all the bytes in one complete DMA
operation. After a byte is transferred, the CAR
and CWCR are adjusted accordingly.

College of Engg. Kottarakkara, Dept.


of CSE 35
 The system bus is returned to the µP, only
after all the bytes are transferred. i.e. TC is
reached or EOP signal is issued. It is the
fastest form of DMA but keeps the
microprocessor inactive for a long time.
 The DREQ signal needs to be active only in
the beginning for requesting the DMA service
initially. Thereafter DREQ can become low
during the transfer.
 3. Demand Transfer Mode
 It is very similar to Block Transfer, except that
the DREQ must active throughout the DMA
operation.

College of Engg. Kottarakkara, Dept.


of CSE 36
 If during the operation DREQ goes low, the
DMA operation is stopped and the busses are
returned to the µP.
 . Once DREQ goes high again, the DMA
operation continues from where it had
stopped.
 4. Cascade Transfer Mode
 In this mode, more than one DMACs are
cascaded together. It is used to increase the
number of devices interfaced to the µP. Here
we have one Master DMAC, to which one or
more Slave DMACs are connected.
 The Slave gives HRQ to the Master on the
DREQ of the Master, and the Master gives
HRQ to the µP on the HOLD of the µP.
College of Engg. Kottarakkara, Dept.
of CSE 37
College of Engg,Kottarakkara,Dept. of
CSE 38
College of Engg,Kottarakkara,Dept. of
CSE 39

Common questions

Powered by AI

In the 8257 DMA Controller, the AEN (Address Enable) signal is a control output line used to isolate the system address, data, and control lines. It is active (high) in master mode and low in slave mode to enable this isolation. The ADSTB (Address Strobe) is another control output line that functions to separate data and address lines during operation, activating only in master mode while being ignored in slave mode. Both signals play crucial roles in ensuring effective communication and data transfer management without interference from other components .

The 8257 DMA controller can prioritize its channels through two principal configurations: Fixed Priority and Rotating Priority Mode. In Fixed Priority Mode, each channel retains a constant priority, while in Rotating Priority Mode, the priority of the channels follows a circular sequence, changing after each DMA cycle so that the channel which was recently serviced gains the lowest priority. The mode of priority is set using the RP bit in the mode set register, where RP=0 configures fixed priority and RP=1 configures rotating priority .

The status register in the 8257 DMA controller is a read-only register that indicates the operational status of the DMA channels. It provides Terminal Count (TC) status bits for each channel, set when a channel's TC signal is activated, signaling the completion of its data transfer. The register also includes an Update (UP) flag, set during an update cycle and cleared upon its completion, indicating whether the controller is executing an update or a DMA cycle. The encoded binary format D0 to D7 reflects these states, and the status register's unique address is defined by the pattern A3A2A1A0=1000 .

In the 8257 DMA Controller, the Read/Control Logic's operation differs notably between Master and Slave modes. In Slave mode, it accepts address bits and control signals from the microprocessor, facilitating data exchange with internal registers. Conversely, in Master mode, it generates necessary address bits and control signals autonomously, overseeing the sequence of DMA operations, incrementing the 16-bit address, and decrementing the 14-bit counter registers. Thus, the Read/Control Logic adapts its function from a passive signal receiver in Slave mode to an active signal generator in Master mode, reflecting its versatile control capabilities over the DMA process .

The Auto Load mode in the 8257 DMA controller, specifically associated with channel 2, allows for repeat block or block chaining operations without requiring immediate software intervention between blocks. This mode is advantageous as it enables continuous data transfer across successive data blocks automatically. Once initialized for the first block, channel 2 can seamlessly handle repeated transfers, leading to increased data throughput and efficiency in scenarios involving recurring or extensive blocks of data transfer. The Auto Load mode is particularly useful in systems with high data volume demands, as it minimizes downtime and the need for processor involvement in managing consecutive transfers .

The Terminal Count (TC) and MARK signals play significant roles in the 8257 DMA controller's data transfer process by indicating the completion of specific stages. The TC signal is activated only in Master mode. It indicates when a programmed number of data bytes have been transferred, signaling the peripheral that the DMA operation for the current data set is complete. This is critical for synchronizing operations between devices. The MARK signal, also activated in Master mode, highlights the transfer of every 128 bytes, offering a periodic check during large data transfers. This is particularly useful for processes requiring action at regular data intervals, such as buffer flushing or status checks .

The MODE SET REGISTER in the 8257 DMA controller, a write-only register, is vital for configuring the operating modes of the DMA channels. Individual bits within this register influence several aspects of DMA operation, including enabling or disabling specific channels (EN0-EN3), setting priority modes (RP for rotating/fixed), controlling TC behavior (TCS to stop or continue operations after terminal count), and configuring write modes (EW for extended or normal). The Auto Load mode (AL) is activated by these bits to enable continuous operation on channel 2. Each setting is crucial for tailoring the DMA controller functionalities to the specific needs of the system, allowing for flexible and optimized DMA operations .

The 8257 DMA Controller supports four primary modes of operation: Single Byte Transfer Mode, Block Transfer Mode, Demand Transfer Mode, and Cascade Transfer Mode. In Single Byte Transfer Mode, also known as Cycle Stealing, the DMAC transfers one byte before returning control of the bus to the microprocessor, effectively alternating bus cycles. Block Transfer Mode allows the DMAC to transfer all bytes in one operation, returning the system bus to the microprocessor only after completion, making it fast but keeping the microprocessor inactive for a longer duration. Demand Transfer Mode is similar to Block Transfer Mode, with the difference that the DREQ signal must remain active throughout the DMA operation, pausing if DREQ goes low. Finally, Cascade Transfer Mode is designed for a hierarchy of DMACs, where multiple slave DMACs are linked to a master DMAC, allowing more devices to connect to the microprocessor .

Both MEMR (Memory Read) and MEMW (Memory Write) signals being active low indicate that their respective operations occur when the signal level is low. In the 8257 DMA controller, these signals are utilized directly during the DMA cycles to manage read and write operations. In Master mode, MEMR is activated during a DMA read cycle to facilitate data retrieval from memory, while MEMW is activated during a DMA write cycle to transfer data to memory. In Slave mode, both signals are tristated (inactive), highlighting their role in isolating these operations to Master mode, ensuring precise data movement sequences during DMA operations .

The architectural features enabling the 8257 DMA controller to handle multiple channels and efficiently prioritize requests include its 4-channel design, each with a 16-bit address and a 14-bit counter. It integrates a chip priority resolver to manage channel requests either in fixed or rotating priority modes. The controller executes its operations in three DMA cycles—DMA read, write, and verify—supported by the Address Enable (AEN) signal to separate CPU and other devices from the system bus. Furthermore, in master mode, it generates address and control signals and increments address counters, facilitating streamlined and prioritized handling of multiple requests across channels .

You might also like