Hi
I have a development board which has the led board attached to it. I have 10 boards I am teaching on to my class. we have an interrupt on pin rb0 for a pic 16f84a set up to a push button. all the programs work in the flow-code simulator and I have set all the configs from flowcode 6. when we download to board the interrupt button does not interrupt the program. I have tried this multiple times with not one board working.
eb-006-00-9 development board interupt
-
- Posts: 30
- Joined: Sat Mar 05, 2016 11:15 am
- Been thanked: 3 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: eb-006-00-9 development board interupt
Hello,
Please can you attach your program and I will make sure there is nothing there that could be causing issues.
Regarding your hardware please can you confirm that you have a wire connected from +V on the EB006 through to the +V on the switch board. This wire supplies power to the switches so they essentially won't work without this in place.
If you're using your own switch circuitry then please can you confirm you are using a similar setup to that shown on the link below for the "active high" type switch.
https://www.matrixtsl.com/wikiv7/index. ... e#Examples
Please can you attach your program and I will make sure there is nothing there that could be causing issues.
Regarding your hardware please can you confirm that you have a wire connected from +V on the EB006 through to the +V on the switch board. This wire supplies power to the switches so they essentially won't work without this in place.
If you're using your own switch circuitry then please can you confirm you are using a similar setup to that shown on the link below for the "active high" type switch.
https://www.matrixtsl.com/wikiv7/index. ... e#Examples
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
-
- Posts: 30
- Joined: Sat Mar 05, 2016 11:15 am
- Been thanked: 3 times
Re: eb-006-00-9 development board interupt
hi
the board is powered as the first two lights come on from the main program. when I press the button the lights don't go to the interrupt routine
the board is powered as the first two lights come on from the main program. when I press the button the lights don't go to the interrupt routine
- Attachments
-
- Trafficlightsfc.fcfx
- (11.65 KiB) Downloaded 313 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: eb-006-00-9 development board interupt
Hi scollins22,
its not a good idea to place an interrupt enable within the continuous loop in main.
Interrupt enables should only be enabled once.
Only activated again, if interrupt disabled has bee used.
Interrupt macros should be as short as possible with no delays if possible and no components that contain delays e.g LCD.
Best way if you can is just set a flag when interrupt has been detected.
Then in main detect the flag being set, if so the call the macro that contains function required after interrupt has been triggered.
Take a look at the attached flowchart.
If still not working, have you tried a 1 sec flasher to make sure your hardware is running at the correct speed?
Martin
its not a good idea to place an interrupt enable within the continuous loop in main.
Interrupt enables should only be enabled once.
Only activated again, if interrupt disabled has bee used.
Interrupt macros should be as short as possible with no delays if possible and no components that contain delays e.g LCD.
Best way if you can is just set a flag when interrupt has been detected.
Then in main detect the flag being set, if so the call the macro that contains function required after interrupt has been triggered.
Take a look at the attached flowchart.
If still not working, have you tried a 1 sec flasher to make sure your hardware is running at the correct speed?
Martin
- Attachments
-
- Trafficlightsfc V2.fcfx
- (16.51 KiB) Downloaded 359 times
Martin
- 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: eb-006-00-9 development board interupt
Hello,
You have the interrupt enable as part of your main loop. This will be constantly resetting the interrupt registers. Probably best to move this to before your loop.
Here is a re-worked version of your program with all the large delays ect removed from the interrupt macro.
You didn't answer my question regarding your switch wiring?
Edit: Whoops Martin beat me to it
But our solutions are very similar.
You have the interrupt enable as part of your main loop. This will be constantly resetting the interrupt registers. Probably best to move this to before your loop.
Here is a re-worked version of your program with all the large delays ect removed from the interrupt macro.
You didn't answer my question regarding your switch wiring?
Edit: Whoops Martin beat me to it

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
-
- Posts: 30
- Joined: Sat Mar 05, 2016 11:15 am
- Been thanked: 3 times
Re: eb-006-00-9 development board interupt
Thanks guys your responses are great. I have just got into work so looking through them. Thanks very much to all who have helped me. The forum is great thanks guys