timer interrupt lockup? | Cypress Semiconductor
timer interrupt lockup?
I'm trying to use a timer interrupt to generate a 1/ms interrupt. I've set up a Timer component (32-bit UDB) with interrupt set for "On TC" (Timer complete I believe.) Interrupt type is "DERIVED."
The code that manages this is:
static int count=0;
SysTimer_STATUS; // dismiss interrupt
if( sysTimer == 1000 )
And within main():
while(SW1_Read()); // wait for button press to continue (gives you time to switch to a terminal window)
Output prior to SysTimerISR_Enable(); displays (on the USB/Serial) but once I push the button and proceed past that point, the system locks up. No more output and the bootloader reset (copied from one of the videos) does not work. I suspect that the source of the ionterrupt is not dismissed so as soon as the timer ISR returns it goes right back into the interrupt. I don;t understand why the SysTimerISR_Stop does not seem to execute. (Debug code.) If I don't enable the interrupt, the remaining code executes as expected.
What I want is an interrupt that can maintain a counbter that increments every millisecond. Feel free to suggest another solution, but I'm also interested in knowing why this does not work.
I can provide the whole project if desired. Would I jut zip it up? What about bootloader dependency (since this is on an -049.)