Page 1 of 1

Interrupt routine not being called

Posted: Sun Oct 29, 2017 11:54 am
by Zane
Hi,

The project i have been working on has failed to work with some real basic functionality i have used numerous other times. I have gone back to basics and created a simple flowchart. Even with this i cannot get the expected results in simulation or on hardware.

The flowchart is set up with an interrupt for timer0. When this overflows it should call an interrupt routine. In this routine it should toggle the LED A3 each time the routine is accessed. In the main loop there is another LED A2 that is also toggled each program cycle. If this section of code for toggling LED A2 is disabled the interrupt routine is never called and neither LED will flash. However if the code for flashing the LED in the main loop is enabled the interrupt routine is called and both LEDs flash.

I have tried opening the same flowchart in FC6 without the section of code for the LED A2 being present in the main loop and the interrupt routine is called without any issues.

I have tried completely uninstalling FC7 and reinstalling again but this has had no effect.

I cannot seem to find an explanation for what is going unless there is an some issue with my PC or an oversight on my behalf :?:

Thanks

Re: Interrupt routine not being called

Posted: Sun Oct 29, 2017 12:30 pm
by medelec35
Hi Zane,
I have reported it as a bug here on 13th April 2017.
It seems different settings take a different time to start the interrupt triggering process.
For example your flowchart on my PC takes just under 3 minutes to start flashing LED's within the interrupt macro
Then they just keep flashing indefinitely.
So just leave your flowchart running on maximum speed for a few minutes.
Not Ideal I know.
Hopefully this will be fixed in the next update?

Martin

Re: Interrupt routine not being called

Posted: Sun Oct 29, 2017 12:42 pm
by medelec35
As you can see, simulation does work after a time period has elapsed:
Interrupt Simulation bug.png
(66.72 KiB) Downloaded 2229 times
Hardware should work as normal.

Martin

Re: Interrupt routine not being called

Posted: Sun Oct 29, 2017 1:16 pm
by Zane
Hi Martin,

Thanks for your reply. Looks like i have been dealing with two separate issues here which has put me off a bit. One is the above issue and the other is the chip i am using. It is a PIC12f1840. It is not possible to drive the output A3. When it is written to nothing happens. I have tried another chip with the same result. I have tried toggling A2 to prove the chip is working, which it is. I will put another post up about this. Thanks for your help.

Cheers

Zane

Re: Interrupt routine not being called

Posted: Sun Oct 29, 2017 1:25 pm
by medelec35
Hi Zane,
Zane wrote:is not possible to drive the output A3.
If you look at the datasheet for 12F1840, it will show A3 as an input only:
12F1840 pins.png
(18.78 KiB) Downloaded 2219 times
Martin

Re: Interrupt routine not being called

Posted: Sun Oct 29, 2017 1:30 pm
by Zane
Hi Martin,

Thanks for that :oops: pointing out the obvious that i should have spotted

Cheers

Re: Interrupt routine not being called

Posted: Sun Oct 29, 2017 1:46 pm
by medelec35
Your welcome.
Just remember any microcontroller with MCLR can only be an input pin , if it has a dual function purpose.

Martin