Hello,
I'm using TM4C123AH6PM with CCS and TivaWare.
I want to measure 8 channels with ADC1 in "ADC_TRIGGER_ALWAYS" mode for 200 samples. All this samples shall get copied to a buffer with uDMA in peripheral scatter gather mode. After all samples have been transfered I expect a uDMA transfer complete Interrupt, but I can't see one. The ADC values gets transfered once and the uDMA gets disabled but no interrupt occures.
I'm pasting the interesting code here. Do I miss something?
ADC initialisation:
ADCSequenceConfigure(ADC1_BASE, 0, ADC_TRIGGER_ALWAYS, 1); ADCSequenceStepConfigure(ADC1_BASE, 0, 0, ADC_CTL_CH1); ADCSequenceStepConfigure(ADC1_BASE, 0, 1, ADC_CTL_CH4); ADCSequenceStepConfigure(ADC1_BASE, 0, 2, ADC_CTL_CH5); ADCSequenceStepConfigure(ADC1_BASE, 0, 3, ADC_CTL_CH6); ADCSequenceStepConfigure(ADC1_BASE, 0, 4, ADC_CTL_CH7); ADCSequenceStepConfigure(ADC1_BASE, 0, 5, ADC_CTL_CH2); ADCSequenceStepConfigure(ADC1_BASE, 0, 6, ADC_CTL_CH0); ADCSequenceStepConfigure(ADC1_BASE, 0, 7, ADC_CTL_IE | ADC_CTL_END | ADC_CTL_CH8);
ADCIntRegister(ADC1_BASE, 0, ADC1SS0uDMATransferFinishedISR);
ADCIntEnableEx(ADC1_BASE, ADC_INT_DMA_SS0);
ADCSequenceEnable(ADC1_BASE, 0);
ADC ISR:
ADCIntClear(ADC1_BASE, 0);
if (uDMAIntStatus() & (1 << (UDMA_CH24_ADC1_0 & 0x1F)))
{
GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_5, 0);
GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_5, GPIO_PIN_5);
}
uDMA init:
uDMAEnable(); uDMAControlBaseSet(uDMAControlTable); uDMAChannelDisable(UDMA_CH24_ADC1_0); uDMAChannelAssign(UDMA_CH24_ADC1_0); uDMAChannelAttributeDisable(UDMA_CH24_ADC1_0, UDMA_ATTR_ALTSELECT | UDMA_ATTR_USEBURST | UDMA_ATTR_HIGH_PRIORITY | UDMA_ATTR_REQMASK); uDMAChannelScatterGatherSet(UDMA_CH24_ADC1_0, MAX_ADC_SAMPLES, (void*)TaskList, true); uDMAChannelEnable(UDMA_CH24_ADC1_0);
Thank you in advance
Regards
Christian
ADCSequenceConfigure(ADC1_BASE, 0, ADC_TRIGGER_ALWAYS, 1);
ADCSequenceStepConfigure(ADC1_BASE, 0, 0, ADC_CTL_CH1); //UZELL_A
ADCSequenceStepConfigure(ADC1_BASE, 0, 1, ADC_CTL_CH4); //UZELL_B
ADCSequenceStepConfigure(ADC1_BASE, 0, 2, ADC_CTL_CH5); //UZELL_C
ADCSequenceStepConfigure(ADC1_BASE, 0, 3, ADC_CTL_CH6); //UZELL_D
ADCSequenceStepConfigure(ADC1_BASE, 0, 4, ADC_CTL_CH7); //UZELL_E
ADCSequenceStepConfigure(ADC1_BASE, 0, 5, ADC_CTL_CH2); //UZELL_F
ADCSequenceStepConfigure(ADC1_BASE, 0, 6, ADC_CTL_CH0); //UZELL_1
ADCSequenceStepConfigure(ADC1_BASE, 0, 7, ADC_CTL_IE | ADC_CTL_END | ADC_CTL_CH8); //USTACK