Long delays and interrupts

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
echase
Posts: 429
Joined: Mon Jun 11, 2007 11:55 am
Has thanked: 49 times

Long delays and interrupts

Post by echase »

My code has long delays like 5 seconds set. If a button on a Port B interrupt is pressed in the middle of one of these long delays it is not read in Flowcode's simulation. Have to wait till end of delay to press the button.

Is this also true of the real hardware or is it just the way Flowcode simulates it?

Could split delay down into 100 shorter delays if needed e.g. a loop running 100 short delays.

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:

Post by Benj »

Hello

The hardware will not react like this. We are working on making Flowcode simulate more like the hardware and we are getting close.

However the interrupt on the PICmicro will occur the next program cycle after the interrupt has been triggered. The PIC will then complete the interrupt service routine and then go back to where it was in the delay.

For a set amount of smalller delays you could do the following.

count = 0
While count < 100
{
short delay
count = count + 1
}

chrisr16
Posts: 1
Joined: Wed Aug 29, 2007 1:06 am

Post by chrisr16 »

Just to say that I've also exprienced the same type of scenairo mentioned in the previous comment by echase with regard to interupt simulation, and as Benj mentioned I have indeed found that the PIC hardware reacts with what appears to be an almost instant effect on the trigger of an interupt rather than how flowcode reacts in simulation, but its good to hear the guys at matrix are working to refine a simulation solution which is great news!

Post Reply