eb-006-00-9 development board interupt

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
scollins22
Posts: 30
Joined: Sat Mar 05, 2016 11:15 am
Been thanked: 3 times
Contact:

eb-006-00-9 development board interupt

Post by scollins22 »

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.

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: eb-006-00-9 development board interupt

Post by Benj »

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

scollins22
Posts: 30
Joined: Sat Mar 05, 2016 11:15 am
Been thanked: 3 times
Contact:

Re: eb-006-00-9 development board interupt

Post by scollins22 »

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
Attachments
Trafficlightsfc.fcfx
(11.65 KiB) Downloaded 279 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: eb-006-00-9 development board interupt

Post by medelec35 »

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
Attachments
Trafficlightsfc V2.fcfx
(16.51 KiB) Downloaded 306 times
Martin

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: eb-006-00-9 development board interupt

Post by Benj »

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.
Trafficlightsfc.fcfx
(16.66 KiB) Downloaded 323 times
You didn't answer my question regarding your switch wiring?

Edit: Whoops Martin beat me to it :D But our solutions are very similar.

scollins22
Posts: 30
Joined: Sat Mar 05, 2016 11:15 am
Been thanked: 3 times
Contact:

Re: eb-006-00-9 development board interupt

Post by scollins22 »

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

Post Reply