Interrupt problem?

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.

Moderator: Benj

Post Reply
wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

Interrupt problem?

Post by wayne millard »

Hi team,

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.

Thanks,
Wayne M :?:

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Interrupt problem?

Post by Benj »

Hello,

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.

Post Reply