Dear all
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
M
//-----------------------------------------------------------------------------------------
//*****************************************************************************
// ADC0 init
//*****************************************************************************
void InitADC0(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0); //Enable ADC0
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); // enable PORTE
GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_2);
ADCSequenceConfigure(ADC0_BASE,3,ADC_TRIGGER_PROCESSOR,0);
ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_IE |
ADC_CTL_END| ADC_CTL_CH1);
ADCSequenceEnable(ADC0_BASE,3); //Enables sequence
}
//*****************************************************************************
// main
//*****************************************************************************
int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_25MHZ);
while(1)
{
ADCProcessorTrigger(ADC0_BASE, 3);
while(!ROM_ADCIntStatus(ADC0_BASE, 3, false)){} // firmare stop here
ADCIntClear(ADC0_BASE, 3);//clears interrupt flag
ADCSequenceDataGet(ADC0_BASE, 3, &ADC0Value);
SysCtlDelay(1000000);
}
}