Hi Guys
Have programmed a MAIN loop which flashes a LED at 500ms intervals and a MACRO second loop that flashes the same LED at 100ms
The MAIN loop has a switch connected to a Interrupt on change pin (12F629 pin A0)
At power up the MAIN 500ms loop runs as it should,
When the switch is operated the program instantaneously jumps to the fast LED 100ms flashing BUT try as I might I cannot get back to the slow 500ms loop when the switch is then turned off, have tried putting a Disable interrupt under the Enable
interrupt etc. etc. but no joy
Any help appreciated
Stylo.
Cannot Disable an Enabled “Interrupt on pin change”
Moderator: Benj
- 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: Cannot Disable an Enabled “Interrupt on pin change”
Hi Stylo,
Please attach your project file and we will have a look for you.
Please attach your project file and we will have a look for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Cannot Disable an Enabled “Interrupt on pin change”
Hi Benj
Thank for coming back.
Project file attached as requested.
Thank for coming back.
Project file attached as requested.
- Attachments
-
- Interrupt_test, 5.8.19_2nd .fcfx
- (11.32 KiB) Downloaded 189 times
- 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: Cannot Disable an Enabled “Interrupt on pin change”
Hello,
Does this do what you need it to? This will wait until the end of the flash before checking the state of the pin. Do you need the change to be immediate and break the flash mid delay?
Does this do what you need it to? This will wait until the end of the flash before checking the state of the pin. Do you need the change to be immediate and break the flash mid delay?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Cannot Disable an Enabled “Interrupt on pin change”
Hi Benj
Thanks for the input.
Yes, the change must be immediate!
Best if I explain the function of this program.
This is a small part of a 10 up rocket launcher, ( EDIT. To clarify, this is an amateur rocket launching box for my sons hobby )
On power up the power LED and a sounder operate at say 1 flash per sec, But if an ARM switch is operated the output must IMMEDIATELY jump to the fast ARMED LED flash and sounder as an instant warning that the fire button (Not shown) has been activated.
Going back to the unarmed stand by mode (Switch off) reverts back to the 1 flash per second.
Timing speed of this change over is not important.
Hope this helps.
Regards Stylo
Thanks for the input.
Yes, the change must be immediate!
Best if I explain the function of this program.
This is a small part of a 10 up rocket launcher, ( EDIT. To clarify, this is an amateur rocket launching box for my sons hobby )
On power up the power LED and a sounder operate at say 1 flash per sec, But if an ARM switch is operated the output must IMMEDIATELY jump to the fast ARMED LED flash and sounder as an instant warning that the fire button (Not shown) has been activated.
Going back to the unarmed stand by mode (Switch off) reverts back to the 1 flash per second.
Timing speed of this change over is not important.
Hope this helps.
Regards Stylo