Hello,
I just want to read sometimes an anlaog value on a Pin of my TM4C129EXL board (Port E, Pin 4), served by some peripheral.
Here is my init:
void init_ADC(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_4 );
ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);
ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_D | ADC_CTL_CH0 | ADC_CTL_IE | ADC_CTL_END);
ADCSequenceEnable(ADC0_BASE, 3);
}
I just want to read the value once at some points in my code.
Therefore I dont want to change the system-clock which is 120MHz and initialised as following:
ui32SysClockFreq = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
My questions:
1. Is it enough to use the ADCSequenceDataGet funktion in my code to read the ADC value?
2. what do I have to do to run the programm with my normal clock?
Please tell me in an easy way, Im new to this.
regards