Other Parts Discussed in Thread: TM4C1294NCPDT, EK-TM4C1294XL
Dear TI community.
I am trying to make a program in which the ADC converter performs a conversion and the result is stored in a variable.
This without the CMSIS library, to increase my knowledge about the microcontroller.
I have read the ADC chapter and section 15.4 even provides a step-by-step plan to configure the different registers.

However, my program seems fine, but when debugging it gets stuck at waiting for the conversion to be done (line 49 in the code).
Does anyone know what I am missing/doing wrong? I have followed all steps in the datasheet 4 times and without succes. The code is
The code even contains comments with steps that refer to section 15.4 in the datasheet.
Please help! I put already enough of my time in this and can't let it go.
EDIT:
Here is the source code again.
#define GPIO_CGC_R (*((volatile unsigned long *) 0x400FE608))
#define ADC_CGC_R (*((volatile unsigned long *) 0x400FE638))
#define GPIO_PORTE_DIR_R (*((volatile unsigned long *) 0x4005C400))
#define GPIO_PORTE_AFSEL_R (*((volatile unsigned long *) 0x4005C420))
#define GPIO_PORTE_DEN_R (*((volatile unsigned long *) 0x4005C51C))
#define GPIO_PORTE_AMSEL_R (*((volatile unsigned long *) 0x4005C528))
#define ADCPC_R (*((volatile unsigned long *) 0x40038FC4))
#define ADCSSPRI_R (*((volatile unsigned long *) 0x40038020))
#define ADCACTSS_R (*((volatile unsigned long *) 0x40038000))
#define ADCEMUX_R (*((volatile unsigned long *) 0x40038014))
#define ADCSSMUX3_R (*((volatile unsigned long *) 0x400380A0))
#define ADCSSCTL3_R (*((volatile unsigned long *) 0x400380A4))
#define ADCIM_R (*((volatile unsigned long *) 0x40038008))
#define ADCPSSI_R (*((volatile unsigned long *) 0x40038028))
#define ADCRIS_R (*((volatile unsigned long *) 0x40038004))
#define ADCSSFIFO3_R (*((volatile unsigned long *) 0x400380A8))
#define ADCISC_R (*((volatile unsigned long *) 0x4003800C))
#include <stdint.h>
static uint16_t result;
int main(void)
{
GPIO_CGC_R |= 0x10; /* Enable the GPIO port E module. This is step 1 of module init. */
GPIO_PORTE_DIR_R &= ~0x10; /* Direction is an input pin. */
GPIO_PORTE_AFSEL_R |= 0x10; /* Use an alternative function. This is step 3 of module init.*/
GPIO_PORTE_DEN_R &= ~0x10; /* This pin is not a digital pin. This is step 4 of module init.*/
GPIO_PORTE_AMSEL_R |= 0x10; /* This pin is an analog pin. This is step 5 of module init. */
ADC_CGC_R = 0x01; /* Enable the ADC0 module. This is step 2 of module init.*/
ADCSSPRI_R = 0x0123; /* Change the priority of the different sequencers.*/
ADCACTSS_R &= ~0x0008; /* Disable sample sequencer 3 during configuration. This is step 1 of SS config.*/
ADCEMUX_R &= ~0xF000; /* Sequence 3 is software trigger. This is step 2 of SS config.*/
ADCSSMUX3_R = (ADCSSMUX3_R & 0xFFFFFFF0) + 9; /* Use AIN9 (PE4) as input. ADCSSEMUX3 is already 0. This is step 4 of SS config. */
ADCSSCTL3_R = 0x0006; /* No TS0, D0. Yes IE0 and END0. This is step 5 of SS config.*/
ADCIM_R &= ~0x0008; /* Disable Sampler Sequencer 3 (SS3) interrupts. This is step 6 of SS config.*/
ADCACTSS_R |= 0x0008; /* Enable SS3. This is step 7 in SS config. */
while(1)
{
ADCPSSI_R = 0x0008; /* Initiate SS3. */
while((ADCRIS_R & 0x0008) == 0) {} /* Wait for the conversion to be done. */
result = ADCSSFIFO3_R & 0xFFF; /* Read the 12 bit result. */
ADCISC_R = 0x0008; /* Acknowledge completion. */
}
return 0;
}