Tool/software: Code Composer Studio
I'm quite new using Ti Tiva microcontrroller series.
I'm the demo board DK-TM4C129x and I'm trying to perform an analog to digital conversion using TivaWare API.
I followed the example found on the pack but my ADC module perform only one conversion then stop warking and microprocessor wait forever for the next conversion complete.
I attached my code in the fallowing.
Thanks for all
int
main(void)
{
unsigned long ulADC0Value;
volatile unsigned long ulTempAvg;
volatile unsigned long ulTempValueC;
volatile unsigned long ulTempValueF;
SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |SYSCTL_CFG_VCO_480), 120000000);
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
ADCSequenceDisable(ADC0_BASE, 3);
ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);
ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_TS | ADC_CTL_IE | ADC_CTL_END);
ADCSequenceEnable(ADC0_BASE, 3);
while(1)
{
ADCProcessorTrigger(ADC0_BASE, 3);
while(!ADCIntStatus(ADC0_BASE, 3, false)){}
ADCIntClear(ADC0_BASE, 3);
ADCSequenceDataGet(ADC0_BASE, 3, ulADC0Value);
ulTempAvg = (ulADC0Value + 2);
}
}