07-12-2007 08:03 AM
07-16-2007 03:27 PM
Hi eesen-
Your call to board->ScarabDMASelect is incorrect. In order to setup DMA from scarab-based S Series devices you should set the DMA channel with a call to board->AIAO_Select. Check out the attached file for an example of the steps required to enable the AI DMA engine. This example is not specific to the 6143 (it's actually for another device), so your other device settings should remain unchanged; only the DMA content is necessarily applicable.
Hopefully this helps-
07-17-2007 03:48 AM
Thank you for your reply.
When i change DRQ source, i began to read data yesterday, but this time number of bytes available is meaningless. Suddenly it becomes millions level altough i make sample at low rates. Todat i see yor reply and i think perhaps the reason of very high "number of bytes available" data is calling wrong function.
i don't understand why call board->ScarabDMASelect is incorrect. I can't do it by AIAO_Select since it doesn't have a method "set(dma channel)" (maybe i can't find. ) Can you be more especific, what method should i call exactly?
The example provided is not actually help me. Chip object of 6133 provided by NI is different than 6143. There is no class named scab in 6143 chip objects. And in the example of 6133 ,most configuration about DMA is done by scrabe class method. I cant't find matching function on the 6143 side.
07-17-2007 08:57 AM
07-17-2007
02:48 PM
- last edited on
04-09-2025
05:22 PM
by
Content Cleaner
Hi eesen-
The ScarabDMASelect() bitfield is used to determine which DMA channel to use while downloading the large scarab image on scarab-based boards. It does not apply to AI operations. The AIAO_select bitfield is indeed the correct entry to indicate the AI DMA channel in use. Possible values for AIAO_select are as follow (from the E Series RLP manual):
AI AO Select Register
The AI AO Select Register contains 8 bits that control the logical DMA selection for the
analog input and analog output resources. The contents of this register are cleared upon power
up and after a reset condition.
<...>
3–0 Input <D..A> Analog Input Logical Channel D through A—These four
bits select the logical channels to be used by the analog
input. You can only set one of these bits at a time.
In order to achieve a circular buffered DMA operation you should use Ring mode; it is the easiest to work with and works well with the MHDDK DMA library. I don't have an example specific to the 6143, but the M Series example should be quite similar in terms of the steps to setup buffers and the actual access into the MHDDK DMA library. Check out aiex3 from the M Series DDK as an example.
Hopefully this helps
07-18-2007 01:04 AM
Hi,
I'm sorry for still bothering you.
I look at code of DDK and i see that wheather you choose normal mode or ring mode it create a linear DMAbuffer. I still don't understand difference between normal mode and ring mode.? What actually i need is continuous mode, i mean when i start dma it should continue transfer data till i stop it.Is ring mode continuous mode?
Another problem is that, sometimes readidx become higher that writeidx, when this happen the number of bytes available= writeidx-readidx become a high number and code gives bufferoverflow error. It's nothing with to bufferoverflow. how this can be happen i don't understand.
Thanks
07-18-2007 06:17 AM
hi,
i solve writeidx , readidx issues by using getbytesinbuffer function in the following thread
http://forums.ni.com/ni/board/message?board.id=90&message.id=899&view=by_date_ascending&page=2
I have one l(hopefully last) problem.. How i choose dma channel, (i didn'nt do any adjustment, i work with default channel???)a nd how i assign them to anolog input channel.As far as i know PCI 6143 has three DMA channel. I want to make such a configuration (for example)
sample data coming from analog input channel 0-2 will be transfered with DMA channel 0,
analog input channel 3-5 will be transfered with DMA channel 1
analog input channel 6,7 will be transfered with DMA channel 2
07-18-2007 07:23 AM
Hi eesen-
In order to adjust the DMA channel in use you only need to make sure that the channel selected by the AIAO_Select bitfield and the channel number in dma->config() are the same. Ring mode is indeed the preferred mode for continuous DMA using the MHDDK.
Glad to hear you're having better luck-
07-26-2007 07:27 AM
07-26-2007 07:27 AM