16F1825 IOC problem

Moderator: Benj

Post Reply
DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

16F1825 IOC problem

Post by DirkB »

Hello,

have found a bug. If you activate several interrupts,
only the last one of the activated interrupts will work.
All others ioc-interrupts will be deactivated.

regards

Dirk

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: 16F1825 IOC problem

Post by stefan.erni »

Hi Dirk

I'm working with different IOC and a Pic. I use a PIC32MZ. There its working. Can you post your program. So we can have a look.

regards

Stefan

DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Re: 16F1825 IOC problem

Post by DirkB »

Hello Stefan,

I wrote a little test program, only with two interrupts.
It is absolutely reproducible. But I even need 5 interrupts.

Grüsse

Dirk
Attachments
InterruptTest.fcfx
(11.94 KiB) Downloaded 180 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: 16F1825 IOC problem

Post by stefan.erni »

Hoi Dirk

Should not you change ON_B and ON_A somewhere? Otherwise, all Int will be set port A2 to 0

Gruss
Stefan

DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Re: 16F1825 IOC problem

Post by DirkB »

Hi Stefan,

he he, yes, sorry. I was right before with an Display
together and for the test accidentally deleted with.

Here the right program.

Liebe Grüsse

Dirk
Attachments
InterruptTest.fcfx
(12.63 KiB) Downloaded 197 times

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: 16F1825 IOC problem

Post by Benj »

Hi Dirk,

Aha I see what you're doing now. You cannot re-enable the same interrupt multiple times. You need to enable the interrupt for all the pins it could be used with in a single icon. Inside the interrupt macro you can determine which pin triggered the interrupt by saving the state of the pins during the prevous interrupt and comparing.

DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Re: 16F1825 IOC problem

Post by DirkB »

Hi Ben,

argh….., i am the bug. Is there no way to get
an own macro for every single int-pin?

regards

Dirk

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: 16F1825 IOC problem

Post by Benj »

Hi Dirk,
argh….., i am the bug. Is there no way to get
an own macro for every single int-pin?
Using a single IOC interrupt you can only enable it once for the selected pins. As I say you can then check to see which pin fired the interrupt and then call another pin specific macro from here if you wish. Note that while you are inside the interrupt macro the interrupt cannot fire again.

It really depends what you're doing but something like this might help.

IOC interrupt Macro - Store pin states in a variable and check to see which pin cause the last interrupt, store this in a variable too. Return ASAP.

Main - Poll the variables and action them as nessisary.

Post Reply