Trouble with timed interrupt | Cypress Semiconductor
Trouble with timed interrupt
I'm using the evaluation kit for PRoC BLE. I've added a timer counter on the schematic and set it up for continuous run, capture mode, interrupt on terminal count. My goal is to have a 60 Hz interrupt routine.
In my ISR, I increment a global variable and print a message on the debug port on every 60th count. I then clear the interrupt using TCPWM_ClearInterrupt().
The problem I'm experiencing is that it seems that when the interrupt flag clear is included in the ISR, it causes the timer to freeze. However, when I remove the interrupt clear, I get the debug messages much more frequently than I expect. I assume this is because the flag is never cleared and so it re-enters the ISR every time it exits. So my conclusion is that I'm pretty sure I need to clear the interrupt flag.
So my question is, why is my timer freezing when I have the interrupt clear call in the ISR? How do I fix this?