Interrupt Driven Transfers Using an External Clock with a PCI-6534 Hardware: Digital I/O (DIO)>>High-Speed>>PCI-6534
Problem: I am doing patterned input with a PCI-6534 using an external clock, and I want to read the digital lines on every clock edge. Why does it take multiple pulses from my external clock to read data on the digital ports? For Example: When I read from 1 port, I am only able to read data on every 32nd sample clock pulse. When I read from 2 ports, I am only able to read data on every 16th sample clock pulse. When I read from 4 ports, I am only able to read data on every 8th sample clock pulse. Solution: This phenomenon happens because the PCI-6534 uses DMA for data transfer, and it does DMA transfers in 32-byte blocks of data. The DMA doesn't transfer data from the card's FIFO to the computer memory until it acquires a full 32-byte block of data. Once it acquires 32-bytes, the DMA transfer occurs. Note that sampling 4 ports will accumulate 32-bytes of data in fewer samples than when sampling only 1 port. This explains why reading data from 4 ports will execute a DMA transfer every 8th sample clock pulse while reading data from 1 port executes a DMA transfer every 32nd sample clock pulse. In order to read from the digital lines on every single pulse of an external clock, the PCI-6534 must be configured for interrupt driven transfers. In LabVIEW, this can be done with the Set DAQ Device Information.vi; in text based languages, the Set_DAQ_Device_Info function does the same thing. The block diagram below shows how to use interrupts to read digital lines on every pulse. Be aware that interrupt driven transfers are slower and require more processing from your computer than DMA transfers. The maximum speed that can be used for the external clock will be dependent on your computer characteristics. Related Links: Attachments:
Report Date: 08/13/2004 Last Updated: 10/06/2004 Document ID: 3CCG521J |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
