Hi,
I am using timer2, in tiva c series mcu.
This is my initialisation code:
UARTprintf("\nIR Noise Timer initialised ...\n");
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);
TimerClockSourceSet(TIMER2_BASE,TIMER_CLOCK_PIOSC); // clock source
ROM_TimerConfigure(TIMER2_BASE, TIMER_CFG_PERIODIC_UP);
ROM_TimerLoadSet(TIMER2_BASE, TIMER_A,IR_NOISE_TIMEOUT);
and in someother interrupt when I try to clear the interrupt value using below code ....
ROM_TimerIntDisable(TIMER2_BASE, TIMER_TIMA_TIMEOUT);
ROM_IntDisable(INT_TIMER2A);
ROM_TimerDisable(TIMER2_BASE, TIMER_A);
HWREG(TIMER2_BASE + TIMER_O_TAV)=0; // added by sanme to debug the noise in IR
ROM_TimerLoadSet(TIMER2_BASE, TIMER_A, IR_NOISE_TIMEOUT); //load the timer in the timeout interrupt handler.
The code is hanging on the marked red line.
Please throw somelight on this , I have many timers in my code and I am resetting those timers also to zero using similar way.
I cannot figure out , why resetting the timer2 to zero, is hanging the tiva.
Thanks,
Sanchit Mehra