Hello Guys,
I am using the TM4C129 (www.ti.com/.../launchpads-connected-ek-tm4c1294xl.html have uDMA working with the ADC.
I have setup the ADC on sample sequencer 0 i.e.
ADCSequenceConfigure(ADC0_BASE, 0 /*SS0*/, ADC_TRIGGER_ALWAYS, 3 /*priority*/); // SS0-SS3 priorities must always be different ADCSequenceStepConfigure(ADC0_BASE, 0 /*SS0*/, 0, ADC_CTL_TS); // ADC_CTL_TS = read temp sensor ADCSequenceStepConfigure(ADC0_BASE, 0 /*SS0*/, 1, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 0 /*SS0*/, 2, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 0 /*SS0*/, 3, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 0 /*SS0*/, 4, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 0 /*SS0*/, 5, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 0 /*SS0*/, 6, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 0 /*SS0*/, 7, ADC_CTL_TS | ADC_CTL_END | ADC_CTL_IE);
I have setup the UDMA like So:
uDMAChannelControlSet(UDMA_CHANNEL_ADC0 | UDMA_ALT_SELECT, UDMA_SIZE_32 | UDMA_SRC_INC_NONE | UDMA_DST_INC_32 | UDMA_ARB_256); uDMAChannelTransferSet(UDMA_CHANNEL_ADC0 | UDMA_PRI_SELECT, UDMA_MODE_PINGPONG, (void *)(ADC0_BASE + ADC_O_SSFIFO0), g_ui8RxBufA, MEM_BUFFER_SIZE); static uint32_t g_ui8RxBufA[some size];
My understanding of this is: 32 bits are transferred from the ADC, to g_ui8RxBufA.
Question 1
But I was thinking, because the ADC sequencer is 32 bits wide and 8 deep. can I do something like this?
uDMAChannelControlSet(UDMA_CHANNEL_ADC0 | UDMA_ALT_SELECT, UDMA_SIZE_256 | UDMA_SRC_INC_NONE | UDMA_DST_INC_256 | UDMA_ARB_256);
i.e. 32*8=256 bits are transferred at once?
Question 2
Forget about Question 1 for a second.
Because I know that only 12 bits of ADC are actually used,
can I do something like this?
uDMAChannelControlSet(UDMA_CHANNEL_ADC0 | UDMA_ALT_SELECT, UDMA_SIZE_16 | UDMA_SRC_INC_NONE | UDMA_DST_INC_16 | UDMA_ARB_256); static uint16_t g_ui8RxBufA[some size];
This would save lots of RAM
Thanks Guys
Dan