
Chapter 5 A/D conversion
41
A/D data transfer
You can perform A/D data transfer by program control, interrupt
routine or DMA.
1. Program controlled data transfer operates by polling the A/D status
register. After the A/D conversion has been triggered, your
application program checks the INT bit (data valid) of the A/D
status register. When it detects that the INT bit is on (1), it sends
the A/D data to the PC's memory using DMA. Remember to reset
the INT bit (by writing to register BASE+8 with any value) after
you transfer the A/D data.
When you use software triggering, you can check either the INT or
EOC bits for data validity. Because the program triggers the A/D
conversion, you do not need to poll the INT bit to see if the
conversion has occurred. It is easier to use the EOC bit, because
you do not need to clear it after you transfer the data.
2. With interrupt routine data transfer, an interrupt routine handler
program transfers data from the card's A/D data registers to a
previously defined memory segment in the PC. At the end of each
conversion the EOC signal generates an interrupt, and the interrupt
handler routine performs the transfer. You must specify the
interrupt control bit and the interrupt level selection bits in the
PCL-818L control register (BASE+9) before you use the interrupt
routine. Writing to the A/D status register address (BASE+8) resets
the PCL-818L interrupt request and re-enables the PCL-818L
interrupt.
3. Direct memory access (DMA) transfer moves the A/D data from
the PCL-818L hardware device to the PC system memory without
the system CPU. DMA is very useful in high speed data transfer,
but it is complicated to operate. Before the DMA operation you
must set the DMA level (JP3), the DMA enable bit control register
(BASE+9) and the registers in the 8237 DMA controller. We
recommend that you use the PCL-818L driver to perform DMA
operations. See Chapter 9 for more information on the 8237 DMA
controller and PCL-818L DMA operations.