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
16F1825 IOC problem
Moderator: Benj
-
- 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
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
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
-
- Posts: 116
- Joined: Wed Feb 08, 2012 2:45 pm
- Has thanked: 7 times
- Been thanked: 11 times
- Contact:
Re: 16F1825 IOC problem
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
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 188 times
-
- 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
Hoi Dirk
Should not you change ON_B and ON_A somewhere? Otherwise, all Int will be set port A2 to 0
Gruss
Stefan
Should not you change ON_B and ON_A somewhere? Otherwise, all Int will be set port A2 to 0
Gruss
Stefan
-
- Posts: 116
- Joined: Wed Feb 08, 2012 2:45 pm
- Has thanked: 7 times
- Been thanked: 11 times
- Contact:
Re: 16F1825 IOC problem
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
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 202 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: 16F1825 IOC problem
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.
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.
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: 116
- Joined: Wed Feb 08, 2012 2:45 pm
- Has thanked: 7 times
- Been thanked: 11 times
- Contact:
Re: 16F1825 IOC problem
Hi Ben,
argh….., i am the bug. Is there no way to get
an own macro for every single int-pin?
regards
Dirk
argh….., i am the bug. Is there no way to get
an own macro for every single int-pin?
regards
Dirk
- 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
Hi Dirk,
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.
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.argh….., i am the bug. Is there no way to get
an own macro for every single int-pin?
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.
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