eb-006-00-9 development board interupt

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

Moderators: Benj, Mods

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

eb-006-00-9 development board interupt

Postby scollins22 » Thu May 18, 2017 12:49 pm

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: 12064
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 3110 times
Been thanked: 3192 times
Contact:

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

Postby Benj » Thu May 18, 2017 1:02 pm

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

Postby scollins22 » Fri May 19, 2017 10:26 am

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 73 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 7049
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 1890 times
Been thanked: 2714 times
Contact:

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

Postby medelec35 » Fri May 19, 2017 3:02 pm

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 85 times
These users thanked the author medelec35 for the post:
Benj (Fri May 19, 2017 3:29 pm)
Rating: 5.88%
 
If your hardware is not working as expected, try looking here first:
http://www.matrixmultimedia.com/mmforum ... =26&t=6936

User avatar
Benj
Matrix Staff
Posts: 12064
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 3110 times
Been thanked: 3192 times
Contact:

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

Postby Benj » Fri May 19, 2017 3:29 pm

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 86 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.
These users thanked the author Benj for the post:
medelec35 (Fri May 19, 2017 7:20 pm)
Rating: 5.88%
 

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

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

Postby scollins22 » Mon May 22, 2017 10:09 am

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