intterupt to specific part of program possible?

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
wtulp
Flowcode V4 User
Posts: 10
Joined: Mon Jan 11, 2010 12:59 pm
Contact:

intterupt to specific part of program possible?

Post by wtulp »

Hello,

I have write a program which simulates the flashlight from a car.
When i press the switch to stop the flashlight the lights doesn't stop direct.
I want the lights stopped direct when a switch is turned off.

Is it possible with an intterupt (B4 - B7) to jump to an specific part (or line) of the program?
I have tried to reset the program, with an interrupt, with the following C-code but then it looks like the program hangs in the interrupt:

//perform a reset
pclath = 0;
pcl = 0;

Can someone please help me?
Knipperlicht.fcf

wtulp
Flowcode V4 User
Posts: 10
Joined: Mon Jan 11, 2010 12:59 pm
Contact:

Re: intterupt to specific part of program possible?

Post by wtulp »

Excuse me,

This is the program:
Knipperlicht.fcf
(23.64 KiB) Downloaded 347 times

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: intterupt to specific part of program possible?

Post by Benj »

Hello

The interrupts can only jump to a macro.

Maybe you could change the program so you switch the light off in the interrupt macro. This way the light would go out as soon as the interrupt is triggered.

wtulp
Flowcode V4 User
Posts: 10
Joined: Mon Jan 11, 2010 12:59 pm
Contact:

Re: intterupt to specific part of program possible?

Post by wtulp »

Hello Benj,

Thanks for the reply.

The lights on/off is done with a loop (is it possible to jump out the loop with a intterupt?)
Or is it maybe better not to work with loops at all?

Other question:
The interrupts for portB (B4-B7) is triggered when a switch is turned on or off. (is this right?)
Is it possible that the intterupt only triggered when a switch is turned off.
(I use the processor PIC16F877a)

Post Reply