Good morning,
I have an issue with the ADC and DMA configuration and it seems i am not the only one to get issue with the DMA& ADC configuration.
I want to oversample one input using 8 adc inputs, and fill one outputbuffer of 2048 points.
Based on my following configuration, i still observe some missing point in my buffer.
I am not sure i am initializing correctly the DMA..but i don t see where would be the error.
Does any one see any initialization issue?
Regards
HEre is the ADC configuration i use:
// ADC configuration
AdcRegs.ADCTRL3.all = 0x00E0u;
DELAY_US(ADC_usDELAY);
AdcRegs.ADCTRL1.bit.SUSMOD = 3u;
AdcRegs.ADCTRL1.bit.CPS =0u;
AdcRegs.ADCTRL1.bit.ACQ_PS = 0;
AdcRegs.ADCTRL3.bit.ADCCLKPS = 0x1;
AdcRegs.ADCTRL1.bit.SEQ_OVRD =1;
AdcRegs.ADCTRL1.bit.SEQ_CASC = 1;
ADC_START_CONT_RUN;//1; // Continuous mode
AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1 = 0x1;
AdcRegs.ADCTRL2.bit.RST_SEQ1 = 0x1;
AdcRegs.ADCMAXCONV.bit.MAX_CONV1 =8-1;
AdcRegs.ADCCHSELSEQ1.bit.CONV00=0x0;
AdcRegs.ADCCHSELSEQ1.bit.CONV01=0x0;
AdcRegs.ADCCHSELSEQ1.bit.CONV02=0x0;
AdcRegs.ADCCHSELSEQ1.bit.CONV03=0x0;
AdcRegs.ADCCHSELSEQ2.bit.CONV04=0x0;
AdcRegs.ADCCHSELSEQ2.bit.CONV05=0x0;
AdcRegs.ADCCHSELSEQ2.bit.CONV06=0x0;
AdcRegs.ADCCHSELSEQ2.bit.CONV07=0x0;
// DMA configuration
DMAInitialize();
DMADestA = (Uint16*) Output; //Point DMA destination to the beginning of the array
DMASourceA = &AdcMirror.ADCRESULT0;
DMACH1AddrConfig(DMADestA,DMASourceA);
DMACH1BurstConfig(8-1,1,1); // 8 word by burst
DMACH1TransferConfig(256-1,1,1); ;// 2048/8 burst transfer required
DMACH1WrapConfig (1,0,2048,0);//
DMACH1ModeConfig(DMA_SEQ1INT,PERINT_ENABLE,ONESHOT_DISABLE,CONT_DISABLE,SYNC_DISABLE,SYNC_SRC,
OVERFLOW_DISABLE,SIXTEEN_BIT,CHINT_END,CHINT_ENABLE);