Content originally posted in LPCWare by beharrell on Mon Apr 25 12:32:17 MST 2011
Hi all,
I'm kind of lost on this one and hope you can help. I wrote a simple app for the LCP1769 to count interrupts received during a time period.
I do this by using the match registers for timers 2 & 3 to toggle pins 0.6 and 0.10 every 0.5 and 0.25 seconds respectively.
I hook these pins to external interrupt 0(the slow toggling pin) & 1 (the fast toggling pin), where each handler is fired on the falling edge. The interrupt handler for 1 increments a counter, the handler to 0 calcs the difference in the counter since it was last called. I print the resultant difference in a loop in main (semi hosting).
When I'm debugging I see a value of 2 (as I would expect), when I run in release I see a value of 4.
I've modifed the handler for ext int 1 with a busy wait for ~3mSec when in release before re-enabling the interrupt to try to rule out noise in the curcuit - this made no difference.
Can anyone suggest what the problem may be?