Programming The Dma Controller; Programming The 1200 For Dma; Monitoring For Dma Done - Real Time Devices AD1200 User Manual

Table of Contents

Advertisement

. DMA Mode Register
The DMA mode register is used to set parameters for the DMA channel you will be using. The read/write bits
are self explanatory; the read mode cannot be used with ttre 1200. Autoinitialization allows the DMA controller to
automatically s[afi over once it has transferred the requested number of bytes. Decrement means the DMA conroller
should decrement its offset counter after each transfer; the default is increment. You can use either the demand or
single transfer mode when transferring data. The demand mode transfers data o the PC on demand for fastest
transfer rate. The single transfer mode forces the DMA controller to relinquish every other cycle so that the proces-
sor can 0ake care ofother tasks.
B7
B6
B5
B4
B3
82
B1
BO
tnsfer Mode
I autornrtiailzati
= 3'?T'iii".o",'
I o = oisaute
= U l o i [
l 1 = e n " b l "
= cascade
I
on
Channel t
00 = Chan
01 = 66s1
10 = Chan
11 = Chan
l/O Port OBH
Tran
0 0 =
0 1 =
1 0 =
1 1 =
rnelSelect
Channel 0
Channel 1
Channel 2
Channel 3
Offset Counter
0 = increment
1 = decrement
Read/Vt/rite
01 = write
10 = 1s3! (not used with 1200)
. Programming the DMA Controller
To program the DMA controller, follow these steps:
1. Clear the byte pointer flip-flop.
2. Disable DMA on the channel you are using.
3. Write the DMA mode register to choose the DMA paramet€rs.
4. Write the LSB of the page offset of your buffer.
5. Write the MSB of the page offset of your buffer.
6. Write the LSB of the number of bytes to transfer.
7. Write the MSB of the number of bytes to transfer.
8. Enable DMA on the channel you are using.
. Programming the 1200 for DMA
Once you have set up the DMA controller, you must progmm ttre 1200 for DMA. The following steps list this
procedure:
l. Set up the 8255 PPI for Port B ourput.
2. Set up the timer/counters for the desired transfer rate.
3. Enable DMA and external rigger.
4. Monitor DMA done bit.
NOTE: If the DMA is set up in the single transfer mode, each DMA transfer takes two read cycles to com-
plete. Therefore, in single transfer, you can run the L2{J|.- arspeeds up to about 100 kIIz so the DMA transfer rate can
keep up with the board's conversion rate. The demand mode supports even higher transfer rates. However, rates
faster than l25kHz, even in the demand mode, may give unreliable results.
. Monitoring for DMA Done
There are two ways to monitor for DMA done. The easiest is to poll the DMA done bit in the 1200 status
register (BA +0). While DMA is in progress, the bit is clear (0). When DMA is complete, the bit is set (l). The
second way to check is to use the DMA done signal to generate an intemrpl An intemrpt can immediately notify
your program that DMA is done and any actions can be taken as needed. Both methods are demonstrated in the
sample C and Pascal progmms, the polling method in the program named DMA and the intemrpt method in
DMASTRM.
4-23

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ada1200

Table of Contents