This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADC interrupt in TI-RTOS crash - Tiva C launchpad - TM4C1294NCPDT

Other Parts Discussed in Thread: TM4C1294NCPDT

Hello guys, your help would be greatly appreciated.

I am running a Tiva C launchpad - TM4C1294NCPDT -  http://www.ti.com/ww/en/launchpad/launchpads-connected-ek-tm4c1294xl.html#tabs

I want to do the following: use a hardware interrupt, to get the temperature ( there is an onboard temperature sensor) via an ADC using TI-RTOS.

what works.

an interrupt fires, every time the ADC has finished reading a value. I know this, because I have toggle LED's in the interrupt, and placed a break point in it also.

what doesnt work.

I cannot seem to read the value of the ADC correctly in the interrupt. This is what i have done:

here is the project files:/cfs-file/__key/communityserver-discussions-components-files/791/0675.Lab11C.zip

void main(void)
{

hardware_init(); // init hardware via Xware

BIOS_start();

}

void hardware_init(void)
{
uint32_t clock_rate = SysCtlClockFreqSet(
(SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480),
120000000
);

SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);

ADCSequenceConfigure(ADC0_BASE, 0, ADC_TRIGGER_ALWAYS, 0);
ADCSequenceStepConfigure(ADC0_BASE, 0, 0, ADC_CTL_TS);
ADCSequenceStepConfigure(ADC0_BASE, 0, 1, ADC_CTL_TS | ADC_CTL_IE | ADC_CTL_END);
ADCSequenceEnable(ADC0_BASE, 0);

ADCIntEnable(ADC0_BASE, 0);

}

//this is the interrupt that does fire.
void ledToggle(void)
{

uint32_t gui32ADC0Value[2];

ADCSequenceDataGet(ADC0_BASE, 0, gui32ADC0Value);
uint32_t ui32TempValueC = (1475 - ((2475 * gui32ADC0Value[0])) / 4096)/10;//convert to Celsius 


}

The following are two outputs, one is a breakpoint just after ui32TempValueC, and the other, is after I click resume.

 , now when I click continue, this is what happens:

What am i doing wrong with the ADC???

thanks

Daniel