Part Number:TM4C129XNCZAD
Hi,
I am having this issue of ADC raw interrupt does not trigger if using PIOSC for both system and ADC clock. below is the code I use to do the testing. If the SysCtlClockFreqSet() is commented, the ADC does not interrupt does not triggered. Just wondering what could be the work around?
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "sysctl.h"
#include "gpio.h"
#include "adc.h"
int main(void)
{
uint32_t pui32ADC0Value;
//SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MOSC| SYSCTL_USE_PLL |
// SYSCTL_CFG_VCO_480), 120000000);
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
GPIODirModeSet(GPIO_PORTD_AHB_BASE, GPIO_PIN_4, GPIO_DIR_MODE_IN);
GPIOPadConfigSet(GPIO_PORTD_AHB_BASE, GPIO_PIN_4, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_ANALOG);
ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);
ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_CH7 | ADC_CTL_IE | ADC_CTL_END);
ADCSequenceEnable(ADC0_BASE, 3);
ADCIntClear(ADC0_BASE, 3);
ADCProcessorTrigger(ADC0_BASE, 3);
while(!ADCIntStatus(ADC0_BASE, 3, false));
ADCIntClear(ADC0_BASE, 3);
ADCSequenceDataGet(ADC0_BASE, 3, &pui32ADC0Value);
while(1);
}