Hello, I want to transfer sampled data from the ADC to a variable, through DMA, without CPU intervention. Thus the ADC should trigger the DMA unit whenever sampled data are available. I utilize sequencer 3 which has a FIFO depth of 1. The sampled data should be stored in the variable ADC_value. Additionally I use the INT_UDMAERR ISR to verify if an error occurs.
According to the reference manual:
“BASIC mode can be programmed to ignore when XFERSIZE reaches 0x000 and continue copying
on request until the channel is stopped manually. If the NXTUSEBURST bit in the uDMA Channel
Control Word (DMACHCTL) register is set while in BASIC mode and the XFERSIZE reaches 0x000
and is not written back, transfers continue until the request is deasserted by the peripheral.”
Thus I utilize UDMA_NEXT_USEBURST and UDMA_MODE_BASIC. What does it mean “and is not written back”? Is there something else to consider?
Below you can see my uDMA configuration:
uint32_t ADC_value;
uint8_t DMA_controlTable[1024];
SysCtlPeripheralReset(SYSCTL_PERIPH_UDMA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UDMA);
uDMAEnable();
uDMAControlBaseSet(DMA_controlTable);
uDMAChannelAttributeDisable(UDMA_CHANNEL_ADC3, UDMA_ATTR_ALL);
uDMAChannelAttributeEnable(UDMA_CHANNEL_ADC3, UDMA_ATTR_USEBURST);
uDMAChannelControlSet(UDMA_CHANNEL_ADC3 | UDMA_PRI_SELECT,
UDMA_SIZE_32 |
UDMA_SRC_INC_NONE |
UDMA_NEXT_USEBURST |
UDMA_ARB_8 |
UDMA_DST_INC_NONE);
uDMAChannelTransferSet(UDMA_CHANNEL_ADC3 | UDMA_PRI_SELECT,
UDMA_MODE_BASIC,
(void *)(ADC0_BASE + ADC_O_SSFIFO3),
&ADC_value,
8);
uDMAChannelEnable(UDMA_CHANNEL_ADC3);
IntEnable(INT_UDMAERR);
Unfortunately, the transfer is only executed once. I check within the while loop weather the DMA has been stopped or the channel has been disabled.
while(1)
{
if((stateX = uDMAChannelModeGet(UDMA_CHANNEL_AC3) == UDMA_MODE_STOP)
{
uDMA_Channel_Configuration();
}
if((stateY = uDMAChannelIsEnabled(UDMA_CHANNEL_ADC3) ) == false)
{
stateY = 1;
}
}
After the fist execution the uDMA channel is disabled and stateY = 1. Then the fist if statement gets true. After an additional call of uDMA_Channel_Configuration the ADC_value is update with a new value.
Are additional or other steps necessary to achieve the DMA transfer without the permanent reconfiguration?
Thank you in advance for all the help!