Hello all.
I am using uDMA to get two channels of data from the ADC0. Both channels (let's call them CHa and CHb) are sampled at the same time, so at the end of the pong buffer I have all the points alternated in the way:
array_of_data= CHa1-CHb1-CHa2-CHb2-.....-CHaN-CHbN
The interrupt handler for this DMA-ADC interrupt is:
ROM_ADCIntClear (ADC0_BASE, ADC_SEQUENCER);
//
// If the channel's not done capturing, we have an error
//
if (ROM_uDMAChannelIsEnabled (UDMA_CHANNEL_ADC2))
{
g_ulBadPeriphIsr2++;
return;}
//First block - PRI
ulMode = ROM_uDMAChannelModeGet(UDMA_CHANNEL_ADC2 | UDMA_PRI_SELECT);if (ulMode == UDMA_MODE_STOP)
{
cnt_bloque1++;
estado_int_bloque1=!estado_int_bloque1;GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_3,estado_int_bloque1*0xFF);
ROM_uDMAChannelTransferSet (UDMA_CHANNEL_ADC2 | UDMA_PRI_SELECT,
UDMA_MODE_PINGPONG,
(void *) (ADC0_BASE + ADC_O_SSFIFO2 + (0x20 * UDMA_ARB_1)),
g_ulADCValues, NUM_SAMPLES);/**/
}//Second block - ALT
ulMode = ROM_uDMAChannelModeGet (UDMA_CHANNEL_ADC2 | UDMA_ALT_SELECT);if (ulMode == UDMA_MODE_STOP)
{cnt_bloque2++;
estado_int_bloque2=!estado_int_bloque2;GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_0,estado_int_bloque2*0xFF);
ROM_uDMAChannelTransferSet (UDMA_CHANNEL_ADC2 | UDMA_ALT_SELECT,
UDMA_MODE_PINGPONG,
(void *) (ADC0_BASE + ADC_O_SSFIFO2 + (0x20 * UDMA_ARB_1)),
&g_ulADCValues[NUM_SAMPLES], NUM_SAMPLES);/**/}
ROM_uDMAChannelEnable (UDMA_CHANNEL_ADC2);
flag_data_ready=true;
The date seems to be consistent to what I am expecting, however, as you can see, I am changing the state of some GPIO pins to check in an oscilloscope the timing of the intterupt and what I find is this:
So both PRI and ALT states of the uDMA interrupt are interrupting at the same time!!!
I have checked also via JTAG and it happens the same, everytime "ulMode = ROM_uDMAChannelModeGet()" is checked I get a UDMA_MODE_STOP for both modes even in the same interrupt.
Shouldn't I get somethinbg like this and half the period?
I mean, shouldn't PRI and ALT modes interrupt alternated instead of interrupt at the same time? But the data seems to be OK, just a little glitch of some samples (about 8) at the beggining of the capture.
Regards