Hello,
Sorry for the simple question, I'm still new to this. I saw some similar questions posted but they didn't help me much.
I'm working on a TM4C123GL eval board.
I'm trying to invoke adc interrupts by the timer but the program doesn't enter the interrupt routine.
Hope someone can easily help me, I'm probably forgetting a crucial line or something.
This is the relevant code: (initialize is called at the beginning of main())
void initialize()
{
//
// Enable lazy stacking for interrupt handlers. This allows floating-point
// instructions to be used within interrupt handlers, but at the expense of
// extra stack usage.
//
ROM_FPULazyStackingEnable();
//
// Set the clocking to run directly from the crystal.
//
ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);
//
// Enable processor interrupts.
//
ROM_IntMasterEnable();
// Set up timer
//Timer2 for ADC cpu1
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);
ROM_TimerConfigure(TIMER2_BASE, TIMER_CFG_PERIODIC);
TimerConfigure(TIMER2_BASE, (TIMER_CFG_A_PERIODIC |TIMER_CFG_B_PERIODIC));
TimerLoadSet(TIMER2_BASE, TIMER_A, (SysCtlClockGet()/50)); //if just clock set so every 1 sec //if /50 every 20 mS
TimerControlTrigger(TIMER2_BASE, TIMER_A, true);
TimerEnable(TIMER2_BASE, TIMER_A);
//
// Configure the ADC.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_ADC0)));
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_0| GPIO_PIN_1| GPIO_PIN_2| GPIO_PIN_3);
ADCSequenceConfigure(ADC0_BASE, 2, ADC_TRIGGER_TIMER, 0);
ADCSequenceStepConfigure(ADC0_BASE, 2, 0, ADC_CTL_CH0);
ADCSequenceStepConfigure(ADC0_BASE, 2, 1, ADC_CTL_CH1);
ADCSequenceStepConfigure(ADC0_BASE, 2, 2, ADC_CTL_CH2);
ADCSequenceStepConfigure(ADC0_BASE, 2, 3, ADC_CTL_CH3 | ADC_CTL_END | ADC_CTL_IE);
ADCSequenceEnable(ADC0_BASE, 2);
ADCIntEnable(ADC0_BASE, 2);
}
I have the ISR that only prints a word for now and it is linked to ADC Sequence 2 in the startup_ccs file.
Thanks for the help!
Nadav
