The Dma; Dma Single Mask Register - Real Time Devices AD1200 User Manual

Table of Contents

Advertisement

. The DMA Controller
The DMA controller is a complex chip that occupies the first 16 bytes of the PC's I/O port space. A complete
discussion on how it operates is beyond the scope of this manual; only relevant information is included here. The
DMA connoller is programmed by writing to the DMA registers in your PC. The table below lists these registers.
Note that when you write 16-bit values to any of these registers (such as to the Count registers), you must write ttre
LSB frst, followed by rhe MSB.
If you are using DMA channel l, write your page offset and count ro ports 02H and 03H; if you are using
channel 3, write your page offset and count to pors 06H and 07H. The page offset is simply the offset that you
calculated for your buffer (see discussion above). Count indicates the number of bytes that you want the DMA
controller to transfer. Remember ttrat each digitized sample from the 1200 consiss of 2 bytes, so the count that you
write to tle DMA controller should be equal to (the number of samples x 2) - l. The single mask register and mode
register are described below. The clear byte pointer sets an internal flip-flop on the DMA conroller ttrat keeps track
of whether the LSB or MSB will be sent next to registers that accept both LSB and MSB. Ordinarily, you neue,
need to write to this port, but it is a good habit o do so before programming the DMA conrroller. Writing any value
to this port clears rhe flip-flop.
Address hex{decimal)
Register Descrlption
02/(02)
Channel 1 Page Offset (write 2 bytes, LSB firsl)
03(03)
Channel 1 Count (write 2 bytes, LSB first)
06(06)
Channel 3 Page CIfset (write 2 bytes, LSB first)
07t(o7)
Channel 3 Count (write 2 bytes, LSB first)
0A/(1 0)
Single Mask Register
oB(1 1)
Mode Register (write only)
jct(12)
Clear Byte Pointer Flip-Flop (write only)
. DMA Single Mask Register
The DMA single mask register is used to enable or disable DMA on a specified DMA channel. you should
mask (disable) DMA on the DMA channel you will be using while programming the DMA controller. After the
DMA controller has been programmed and the 1200 has been programmed to sample data, you can enable DMA by
clearing the mask bit for the DMA channel you are using. You should manr:ally disable DMA by setting the mask
bil before exiting your program or, if for some reason, sampling is halted before ttre DMA controller has ransfened
all the data it was programmed to transfer. If you leave DMA enabled and it has not transferred all the dara it was
programmed to transfer, it will resume transfers the next time data appears at the A/D converter. This can spell
disaster if your program has ended and the buffer has be reallocated to another application.
x
x
x
x
x
82
B1
BO
Channel
l/O Port OAH
Select
Mask Blt
00 = Channet 0
0 = unmask 01 = e6snn"; 1
1 = mask
10 = channel 2
11 = Channel 3
4-22

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ada1200

Table of Contents