Hi guys,
Did any of you managed to run Timer 1 interrupt with OSAL?
Cheers,
Kay
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.
Hi Eirik,
Many thanks for the reply. I managed to get the interrupts working by removing def 'POWER_SAVING'. I reckon the OSAL sleep functions disable the interrupts and screw the time 1 interrupt.
I had another funny thing happening - I coouldn't clear the OVFIF flag in the ISR due to whatever reason. I had to stop the timer first and then reset OVFIF. Following is the code.
AL_ISR_FUNCTION(halT1_TimerIsr, T1_VECTOR)
{
HAL_ENTER_ISR();
T1CTL &= ~(HAL_TIMER1_OPMODE_BITS); // clear OPMODE bits 1..0
T1CTL |= HAL_TIMER1_OPMODE_STOP; //timer stoped to clear OVFIF
T1STAT &= ~T1CTL_OVFIF; // clear the OVFIF - doesnt seem to be cleared when timer is running
T1CNTL=0; // set timer back to 0
T1CTL |= HAL_TIMER1_OPMODE_UPDOWN; // start timer again
HAL_EXIT_ISR();
return;
}
Any ideas?
Cheers,
Kay
Hi Eirik, Many thanks. That's how I initially tried it. Didn't work at that time. However I commented out the timer disabling statements I had earlier now and it is working!! I think the issue was I was having a breakpoint into the ISR and single stepping to see this bit clear. It doesn't seem to work like that. When it is running without breakpoint, it works.
Thanks again,
Kaushalya