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

Other Parts Discussed in Thread: TM4C123GH6PM

I'm facing with problem.I don't know why it cant't operation 


#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "inc/hw_gpio.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#include "driverlib/interrupt.h"
#include "driverlib/debug.h"
#include "driverlib/sysctl.h"
#include "driverlib/adc.h"
#include "driverlib/rom.h"
#include"include.h"
float TempC;
uint32_t Temp[1];
void Tem_ISR(void);
void config_TempSensor(void);
void config_TempSensor(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC1);
ADCHardwareOversampleConfigure(ADC1_BASE,64);
ADCSequenceConfigure(ADC1_BASE, 1, ADC_TRIGGER_PROCESSOR, 1);
ADCSequenceStepConfigure(ADC1_BASE, 1, 0, ADC_CTL_TS|ADC_CTL_END|ADC_CTL_IE);
ADCSequenceEnable(ADC1_BASE,1);
ADCIntRegister(ADC1_BASE,1,&Tem_ISR);
IntMasterEnable();
}

void Tem_ISR(void)
{


ADCIntClear(ADC1_BASE,1);//clearn flag interrupt

ADCSequenceDataGet(ADC1_BASE,1,(uint32_t *)&Temp);//force type for data read
//the date was read form sensor is digital type.should change for number.
TempC=(1475 - ((2475 * Temp[0])) / 4096)/10;//total vref- +((vref+ -vref-)/4096)*Data
}

void main (void)
{
// Configure clock 40 MHz
SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
config_TempSensor();

while(1)
{
ADCProcessorTrigger(ADC1_BASE, 1);
}

}

the tempC=0 any time.

Thanks for your supports.