Hello. I have found a new issue with my 129 development board.
I have written some code to get 2-channels 1024 ADC samples with DMA, using a Timer as the trigger for the ADC (that is why we are using ADC_TRIGGER_TIMER).
This code was working on the 123 boards.
However, inside the ADC interrupt handler, uDMAChannelModeGet is always stuck in mode UDMA_MODE_PINGPONG, so I never get the samples into the destination array. I am watching in the timer debug pin, the desired frequency.
The ADCinterrupt handler is called in every timer cycle.
Is there anything new with the uDMA interrupts for the 129x family?
Here is some code:
void ADC2IntHandler(void) { cnt_DMA_int++; clk_ADC2IntHandler=!clk_ADC2IntHandler; Shot_debug_signal2(clk_ADC2IntHandler); ulStatus = ADCIntStatus(ADC0_BASE, ADC_SEQUENCER,false); // Clear the ADC interrupt ADCIntClear(ADC0_BASE, ADC_SEQUENCER); // // If the channel's not done capturing, we have an error // /*if (uDMAChannelIsEnabled (UDMA_CHANNEL_ADC2)) { g_ulBadPeriphIsr2++; return; }/**/ /* if (uDMAChannelIsEnabled(UDMA_CHANNEL_ADC2)) { g_ulBadPeriphIsr2++; // ADCIntDisable(ADC0_BASE, ADC_SEQUENCER); // IntPendClear(INT_ADC0SS2); // return; } // // Verify count remaining is 0. // ulMode = uDMAChannelSizeGet(UDMA_CHANNEL_ADC2); if (ulMode) { g_ulBadPeriphIsr1++; //return; } /**/ ulMode = uDMAChannelModeGet(UDMA_CHANNEL_ADC2 | UDMA_PRI_SELECT); if (ulMode == UDMA_MODE_STOP) { cnt_bloque1++; uDMAChannelTransferSet (UDMA_CHANNEL_ADC2 | UDMA_PRI_SELECT, UDMA_MODE_PINGPONG, (void *) (ADC0_BASE + ADC_O_SSFIFO2 + (0x20 * UDMA_ARB_1)), g_ulADCValues, 2 * NUM_SAMPLES);/**/ flag_ADC_ready = 1; //UARTprintf("Block 1 - ADC: %d", cnt_bloque1); } ulMode = uDMAChannelModeGet(UDMA_CHANNEL_ADC2 | UDMA_ALT_SELECT); if (ulMode == UDMA_MODE_STOP) { cnt_bloque2++; uDMAChannelTransferSet (UDMA_CHANNEL_ADC2 | UDMA_ALT_SELECT, UDMA_MODE_PINGPONG, (void *) (ADC0_BASE + ADC_O_SSFIFO2 + (0x20 * UDMA_ARB_1)), g_ulADCValues, 2 * NUM_SAMPLES);/**/ flag_ADC_ready = 1; uDMAChannelEnable (UDMA_CHANNEL_ADC2); //UARTprintf("Block 2 - ADC: %d", cnt_bloque2); } }
Thank you
Thank you