Hello- I'm new to CCS (v5.5) and TM4C123 and working through some examples.
I when I ran the code below and watched the variables I saw that instead of the "Count" going for 0 and counting up, it seemed to showing a value about the same as from the ADC read.
Does anyone have any idea why the count variable doesn't work the way I have it. It works fine when I comment out the ADC capture lines.
Thanks for any help
#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"
int main(void)
{
uint32_t ui32ADC0Value[1];
volatile uint32_t ui32Accel;
long int volatile Count;
long int volatile a;
ADCSequenceConfigure(ADC0_BASE, 0, ADC_TRIGGER_PROCESSOR, 0);
ADCSequenceStepConfigure(ADC0_BASE, 0, 0,ADC_CTL_CH0);
ADCSequenceEnable(ADC0_BASE, 0);
Count=0;
a=0;
do{
Count++;
a++;
ADCProcessorTrigger(ADC0_BASE, 0);
while(!ADCIntStatus(ADC0_BASE, 0, false))
{
}
ADCSequenceDataGet(ADC0_BASE, 0, ui32ADC0Value);
ui32Accel=ui32ADC0Value[0];
}while (Count<2000);
}