Hi,
i was learning to use TM4C123GXL eval kit.I also tried executing the example projects provided in the tivaware.
Now, i made modifications to the ADC sample code with interrupt handler rather than polling method provided in the example.
the issue i am facing is while debugging i put beakpoint inside interrupt handler function i defined but it is not hitting the interrupt handler
here is my code,
please resolve my issue..
thanks for any help.....
#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "driverlib/adc.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"
#include "driverlib/rom.h"
#include "inc/tm4c123gh6pm.h"
#define SAMPLE_COUNT ((uint8_t)8)
uint32_t pui32ADC0Value[SAMPLE_COUNT];
void ADC_Init(void ){
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
ROM_GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_3);
ROM_SysCtlADCSpeedSet(SYSCTL_ADCSPEED_500KSPS);
ROM_ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);
ROM_ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_CH1| ADC_CTL_IE |ADC_CTL_END);
ROM_ADCSequenceEnable(ADC0_BASE, 3);
ROM_IntMasterEnable();
ROM_ADCIntEnable(ADC0_BASE, 3);
ROM_IntEnable(INT_ADC0SS1);
ROM_ADCIntClear(ADC0_BASE, 3);
}
void ADC_GetAvg(uint32_t ui32Base, uint32_t ui32SequenceNum)
{
ROM_ADCProcessorTrigger(ui32Base, ui32SequenceNum);
}
void ADC_INTRHandler(void)
{
ROM_ADCIntClear(ADC0_BASE, 0);
// Read ADC Value.
ROM_ADCSequenceDataGet(ADC0_BASE, 0, pui32ADC0Value);
static int ledstate=0;
if(ledstate==1)
{
ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0);
ledstate=0;
}
else
{
ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0XFF);
ledstate=1;
}
}
int main(void)
{
ROM_SysCtlClockSet(SYSCTL_SYSDIV_25 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |SYSCTL_XTAL_16MHZ);
// Enable the GPIO port that is used for the on-board LED.
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
// Enable the GPIO pins for the LED (PF2).
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_2);
ADC_Init();
ADC_GetAvg (ADC0_BASE, 0);
while(1)
{
}
}