For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.
Is there a problem with interrupts clashing at the same time.
i have timer0 on a 1ms interrupt to run a clock timer and have RB0 as an event
counter. the problem i have is the event counter miss's counts some times.
The main problem with interrupts can happen if you have large delays or calls to things like LCDs or other slow reacting devices inside the interrupt service routine. The interrupt macro has to be completed before that perticular interrupt is reactivated.
Take for example this.
interrupt 1 fires and service routine 1 starts.
interrupt 2 then fires and service routine 2 starts
service routine 2 ends
interrupt 2 then fires and service routine 2 starts
service routine 2 ends
service routine 1 ends
Here you can see that service routine 1 is greatly extended in size due to interrupt 2 kicking in.
If you can move any code out of the interrupt routine and instead use a variable to control when the code gets called in the main. The variable is set by the interrupt and then cleared in the main when the code has been executed.