Hello Alice,
I am modifying existing lpadc_dma example provided with SDK
i checked all peripheral ADC, Ctimer and DMA individually. problem is with integration of all three.
I have configured following:
ADC:
enabled hardware trigger 5
5 State Counter Timer (CTIMER) ct0_mat3_out via TCTRLa[HTEN] for index 5
TCTRLa[TPRI] is kept 0
Ctimer:
#define CTIMER CTIMER0 /* Timer 0 */
#define CTIMER_MAT_OUT kCTIMER_Match_3 /* Match output 3 */
#define CTIMER_CLK_FREQ CLOCK_GetCTimerClkFreq(2U)
config:
matchConfig.enableCounterReset = true;
matchConfig.enableCounterStop = false;
matchConfig.matchValue = CTIMER_CLK_FREQ / 4;
matchConfig.outControl = kCTIMER_Output_Toggle;
matchConfig.outPinInitState = true;
matchConfig.enableInterrupt = false;
CTIMER_SetupMatch(CTIMER, CTIMER_MAT_OUT, &matchConfig);
DMA :
No modification from Lpadc_dma example.
Changes in main:
Removed getchar() and LPADC_DoSoftwareTrigger(). and called CTIMER_StartTimer(CTIMER) before while(1)
my understanding:
i/p: continious square wave from function generator on P28 on board
As the ctimer value reaches the matchvalue , CTIMER_MAT_OUT (which is mat_out_3) performs togle operation and reloads timer .
mat_out_3 rising edge acts as hardware trigger to ADC and after conversion it should trigger DMA to transfer from FIFO to ram .
but not able to see output in FIFO or ram variable . so ADC is not triggered .
Please do tell if any configuration is missing or function call to be done in main.