Hello Guys.
I am trying to make a simple ADC code that reads potentiometer's voltage and visualize the raw adc data into expression watch view. The problem is that when I run the debugger it is trapped into an infinit FaultISR loop. I guess that some interrupt is triggered but I dont know wich one. May be my code is completly wrong, please correct me if so. My goal is to change ADC data by potentiometer and to monitor it.
Excuse my bad English I hope you get my issue.
Here is "the code" :)
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/sysctl.h"
#include "driverlib/adc.h"
#include "driverlib/gpio.h"
#include "driverlib/gpio.c"
int main(void)
{
uint32_t ui32ADC0Value;
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);
ADCSequenceStepConfigure(ADC0_BASE,3,0,ADC_CTL_CH0|ADC_CTL_IE|ADC_CTL_END);
ADCSequenceEnable(ADC0_BASE, 3);
GPIOPinTypeGPIOInput(GPIO_PORTE_BASE, GPIO_PIN_3);
GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_3);
while (1)
{
ADCIntClear(ADC0_BASE, 3); //My breakpoint is on this line (action Refresh all windows)
ADCProcessorTrigger(ADC0_BASE, 3);
while(!ADCIntStatus(ADC0_BASE, 3, false))
{
}
ADCSequenceDataGet(ADC0_BASE, 3, &ui32ADC0Value);
}
}