efrenglezc
Joined: 26 Jan 2011 Posts: 1
|
DSPic33FJxx ADC->DMA Questions |
Posted: Wed Jan 26, 2011 8:44 am |
|
|
Hi Guys,
I’m using a DSPic33FJ64706 and would like to use 4 ADC Channels (AN0 and AN1 controlled by ADC1) and (AN2 and AN3) controlled by ADC2 using Simultaneous Sampling on the 4 channels, Peripheral Indirect Mode using DMA0 (ADC1) and DMA1 (ADC2) in order to store the conversion in the order AN0[0]…..AN0[Max], AN1[0]…..AN0[Max], AN2[0]…..AN2[Max], AN3[0]…..AN3[Max], in the DMA Buffer, in that order. Said that there are a couple of questions:
1. - When I declare the pins I will use as Analog Input do I need to set the 4 channels in both registers AD1PCFGL and AD2PCFGL or AN0, AN1 in AD1PCFGL and AN2, AN3 in AD2PCFGL?
2. – When I program the Starting DMA Memory for every buffer, do I need to set the initial address for the 4 buffers in the DMA0 register DMA0STA for AN0, DMA0STB for AN1, DMA1STA for AN2 and finally DMA1STB for AN3, or, it is enough to set only two starting address DMA0STA for AN0 and DMA1STA for AN2 and the DMA know what is the next address for AN1 and AN3 buffer address base on the totals number of Samples on DMA0CNT and DMA1CNT information (2 x Buffer_Size of Max Samples per channel)?
3. – For this configuration I programmed DMA0CON.AMODE and DMA1CON.AMODE with 0x10 (peripheral Indirect) and DMA0CON.MODE and DMA1CON.MODE with 0x10 (Continuous, Pin-Pong mode Enable), is that correct?
3. - The Datasheet mention if I’m using ADC-DMA I must disable the interrupt for the ADC in the uController side but not on the DMA side, when I set the interrupt associated to the DMA0 and DMA1 I point to the interrupt 13 for ADC1 and 21 for ADC2, so how I disable it from my uController side in order not to attend it, just not declaring the handle for that interrupt?
That’s all guys,
Thank you very much for your support
Efren |
|