Interrupt Not Working for PIC16F1824
Moderator: Benj
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Interrupt Not Working for PIC16F1824
Hi guys,
I having problem to use interrupt for PIC16F1824. I choose INT ( RB0/INT selection ) but the flowcode simulation fail.
From the datasheet of PIC16F1824, the INT is on RA2 pin not RB0 pin ( as normal case ).
Second thing is there's no Interrupt on change (IOC) for this IC ( in flowcode v4.5 ) but IOC can be found on the datasheet.
Actually I'm in middle doing some project to use PIC16F1824 n PIC12F1840 but having problem on the interrupt issue. If PIC16F1824 can be solved, please settle for PIC12F1822 too ( same family with PIC16F1824).
Second question,
How to set the right freq for PIC16F1824. Let say I use internal clock and I want 32 Mhz clock, need I to set clock speed to 8000000Hz ( under top menu -> VIEW -> PROJECT OPTION ) and have 'PLL ENABLE' in CONFIGURE menu ? or how ?
Hope it's can be solved.
Thanks in advance.
I having problem to use interrupt for PIC16F1824. I choose INT ( RB0/INT selection ) but the flowcode simulation fail.
From the datasheet of PIC16F1824, the INT is on RA2 pin not RB0 pin ( as normal case ).
Second thing is there's no Interrupt on change (IOC) for this IC ( in flowcode v4.5 ) but IOC can be found on the datasheet.
Actually I'm in middle doing some project to use PIC16F1824 n PIC12F1840 but having problem on the interrupt issue. If PIC16F1824 can be solved, please settle for PIC12F1822 too ( same family with PIC16F1824).
Second question,
How to set the right freq for PIC16F1824. Let say I use internal clock and I want 32 Mhz clock, need I to set clock speed to 8000000Hz ( under top menu -> VIEW -> PROJECT OPTION ) and have 'PLL ENABLE' in CONFIGURE menu ? or how ?
Hope it's can be solved.
Thanks in advance.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi,
I have solved the simulation problem and later on have a look on the internal clock issue..
For the time being I have posted here the sample Flow chart and modified FCD file which you have to put in Program files>Matrix Multimedia>Flowcode V4>FCD
folder and replace the existing one..
Hope this will help
Enamul
I have solved the simulation problem and later on have a look on the internal clock issue..
For the time being I have posted here the sample Flow chart and modified FCD file which you have to put in Program files>Matrix Multimedia>Flowcode V4>FCD
folder and replace the existing one..
Hope this will help

Enamul
- Attachments
-
- 16F1824.fcd
- (10.76 KiB) Downloaded 529 times
-
- RB0.fcf
- (6.5 KiB) Downloaded 575 times
Last edited by Enamul on Mon Jul 16, 2012 12:13 pm, edited 2 times in total.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi,
I will post your rest of the problem regarding Interrupt on change...later on
Enamul
To use internal 32 Mhz clock, you have to use the attached config setting and I have added modified Code for 32 MHz internal clock..How to set the right freq for PIC16F1824. Let say I use internal clock and I want 32 Mhz clock, need I to set clock speed to 8000000Hz ( under top menu -> VIEW -> PROJECT OPTION ) and have 'PLL ENABLE' in CONFIGURE menu ? or how ?
I will post your rest of the problem regarding Interrupt on change...later on
Enamul
- Attachments
-
- RB0.fcf
- (6.5 KiB) Downloaded 557 times
-
- RB0_CONFIG.jpg (138.14 KiB) Viewed 28227 times
Last edited by Enamul on Sun Jul 15, 2012 8:33 pm, edited 1 time in total.
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Re: Interrupt Not Working for PIC16F1824
Hi Enamul,
Thanks a lot for your help.
Anyway, if you have time, would you please fix for PIC12F1840 too as I need to use it urgently.
Or you can show me how to fix it, I will try to do it on my own ( for INT, IOC and other interrupt related ).
Sorry to trouble you so much.
Thanks a lot for you kindness.
Thanks a lot for your help.
Anyway, if you have time, would you please fix for PIC12F1840 too as I need to use it urgently.
Or you can show me how to fix it, I will try to do it on my own ( for INT, IOC and other interrupt related ).
Sorry to trouble you so much.
Thanks a lot for you kindness.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi,
I am glad that it helps you. I am now looking at 12f1840 and try to post as soon as possible..
Enamul
I am glad that it helps you. I am now looking at 12f1840 and try to post as soon as possible..
Enamul
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi,
Here goes the modified FCD file for 12f1840 PIC and this is also corrected for RA2INT...
Please use same config option..and I forget to put ; on the c code of last post...please add that in RB0 last program..
Enamul
Here goes the modified FCD file for 12f1840 PIC and this is also corrected for RA2INT...
Please use same config option..and I forget to put ; on the c code of last post...please add that in RB0 last program..
Enamul
- Attachments
-
- 16F1824.fcd
- (10.76 KiB) Downloaded 570 times
-
- RA2_INT_12F1840.fcf
- (5.5 KiB) Downloaded 540 times
Last edited by Enamul on Mon Jul 16, 2012 12:13 pm, edited 2 times in total.
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Re: Interrupt Not Working for PIC16F1824
Hi Enamul,
Thanks for your help n fast respond.
I will test it when the IC arrived ( I just ordered it ).
Thanks again for all your help.
Thanks for your help n fast respond.
I will test it when the IC arrived ( I just ordered it ).
Thanks again for all your help.
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Re: Interrupt Not Working for PIC16F1824
Hi Enamul,
If you have time ( and you want to do it of course ), please fix for other PIC16F182x n PIC12F1822 on interrupt:
1. INT
2. IOC
Thanks in advance for your help ( if you do it or not
) .... btw, it's not urgent (take your time).
If you have time ( and you want to do it of course ), please fix for other PIC16F182x n PIC12F1822 on interrupt:
1. INT
2. IOC
Thanks in advance for your help ( if you do it or not

- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi,
That's nice. Please let me know after testing in hardware.
Please re-download RB0 and RA2_INT_12f1840 program because earlier c code semicolon (;) was missing
I'm now looking at port change on interrupt. This will take some time to configure. I will post whenever I can sort out the issue.
Thanks!
Enamul
That's nice. Please let me know after testing in hardware.
Please re-download RB0 and RA2_INT_12f1840 program because earlier c code semicolon (;) was missing
I'm now looking at port change on interrupt. This will take some time to configure. I will post whenever I can sort out the issue.
Thanks!
Enamul
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi,
I have made correction to PIC12f1822 fcd file and attached here with the sample program...
I will post rest later on..
Enamul
I have made correction to PIC12f1822 fcd file and attached here with the sample program...
I will post rest later on..
Enamul
- Attachments
-
- 12F1822.fcd
- (9.74 KiB) Downloaded 584 times
-
- RA2_INT_12F1822.fcf
- (5.5 KiB) Downloaded 529 times
Last edited by Enamul on Mon Jul 16, 2012 12:14 pm, edited 1 time in total.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
HI,
I think you mean 16f182x means 16f1823, 16f1825-29. I have made changes to 16f1823 & 25 and attached here. I have checked PIC 16f1826 and 27...those are already fine as they have mapped on RB0...
I will also add 1828 and 1829 in the other post..as I can't add more than 3 in attachment.
Enamul
I think you mean 16f182x means 16f1823, 16f1825-29. I have made changes to 16f1823 & 25 and attached here. I have checked PIC 16f1826 and 27...those are already fine as they have mapped on RB0...
I will also add 1828 and 1829 in the other post..as I can't add more than 3 in attachment.
Enamul
- Attachments
-
- 16F1823.fcd
- (5.99 KiB) Downloaded 480 times
-
- 16F1825.fcd
- (10.11 KiB) Downloaded 463 times
Last edited by Enamul on Mon Jul 16, 2012 12:15 pm, edited 1 time in total.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi,
Here goes 16f1828 and 29...
Hope these will help
Enamul
Here goes 16f1828 and 29...
Hope these will help

Enamul
- Attachments
-
- 16F1829.fcd
- (10.38 KiB) Downloaded 456 times
-
- 16F1828.fcd
- (10.33 KiB) Downloaded 431 times
Last edited by Enamul on Mon Jul 16, 2012 12:16 pm, edited 1 time in total.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi,
I have managed to change FCD file for PORTA change on interrupt for PIC 16f1824..I have added that in FCD file but now its available in interrupt list. In the beginning of flowchart you have to define the pins whether rising edge or falling edge..In the sample program I have configured all rising and all falling edge detection..
It will not simulate but you can test on hardware and let me know how it works!
Enamul
I have managed to change FCD file for PORTA change on interrupt for PIC 16f1824..I have added that in FCD file but now its available in interrupt list. In the beginning of flowchart you have to define the pins whether rising edge or falling edge..In the sample program I have configured all rising and all falling edge detection..
It will not simulate but you can test on hardware and let me know how it works!
Enamul
- Attachments
-
- 16F1824.fcd
- (10.76 KiB) Downloaded 450 times
-
- RA_Change_ON_INT.fcf
- (7 KiB) Downloaded 448 times
Last edited by Enamul on Mon Jul 16, 2012 12:16 pm, edited 1 time in total.
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Re: Interrupt Not Working for PIC16F1824
I'm really happy with your contribution. Thanks a lot buddy.
Btw, I only have PIC16F1824 right now and PIC12F1840 coming soon ... so I will let you know once I test it ( give me 1 or 2 days ).
My very best regards
Zuki.
Btw, I only have PIC16F1824 right now and PIC12F1840 coming soon ... so I will let you know once I test it ( give me 1 or 2 days ).
My very best regards
Zuki.
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Re: Interrupt Not Working for PIC16F1824
Hi Enamul,
I test your PIC16F1824 ( both ... with INT n IOC ) but not succesfull ( on my hardware .. confirm working hardware ).
I make 2 flowcode file ... 1) with INT 2) Just push A2 and A4 LED light ON (while push A2 button).
With your FCD, it' not working on hardware (both testing no. 1 n no. 2) but no problem on flowcode simulation n flowcode compilation ( error free ).
With older FCD, test no. 2 working 100% on hardware n simulation.
Attached the older FCD (working for test no. 2 on my hardware ).
I test your PIC16F1824 ( both ... with INT n IOC ) but not succesfull ( on my hardware .. confirm working hardware ).
I make 2 flowcode file ... 1) with INT 2) Just push A2 and A4 LED light ON (while push A2 button).
With your FCD, it' not working on hardware (both testing no. 1 n no. 2) but no problem on flowcode simulation n flowcode compilation ( error free ).
With older FCD, test no. 2 working 100% on hardware n simulation.
Attached the older FCD (working for test no. 2 on my hardware ).
- Attachments
-
- 16F1824.fcd
- (10.11 KiB) Downloaded 460 times
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Re: Interrupt Not Working for PIC16F1824
This 2 flowcode files.
- Attachments
-
- PIC_000043_007.fcf
- (7 KiB) Downloaded 447 times
-
- PIC_000043_006.fcf
- (7 KiB) Downloaded 467 times
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi,
I was working late last night. That's why wake up late. It's nice that you have tested RA2 for int and normal I/O. I have edited ansel register which causes the pins to become analogue and that's why it works in simulation but not in hardware.I have updated all the FCD I have posted and modified so that it works both for simulation and hardware. As I don't have those IC in hand I can't test in hardware. Please use the attached FCD and let me know how it works?
I mean it should work both for simulation and hardware..
Enamul
I was working late last night. That's why wake up late. It's nice that you have tested RA2 for int and normal I/O. I have edited ansel register which causes the pins to become analogue and that's why it works in simulation but not in hardware.I have updated all the FCD I have posted and modified so that it works both for simulation and hardware. As I don't have those IC in hand I can't test in hardware. Please use the attached FCD and let me know how it works?
I mean it should work both for simulation and hardware..

Enamul
- Attachments
-
- 16F1824.fcd
- (10.76 KiB) Downloaded 396 times
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Re: Interrupt Not Working for PIC16F1824
Hi Enamul,
Thanks for the contribution.
I just test PIC16F1824 FCD and so far it's work fine (hardware n simulation) ... for A2INT interrupt. For IOC on Port A still not doing yet.
I will test it for IOC for PIC16F1824 n IOC and A2INT for PIC12F1840 on next week as I need to finish my urgent project this week.
I will let you know the result later once I test it.
NOTE: If you want to do, is it possible to make FCD for PIC16F1503 ? as I have some stock on this PIC but flowcode 4.x not support. If you cannot/don't want to make it, it's ok to me as you help me a lot already. Sorry to trouble you on so many PICs.
Thanks a lot for your help.
Zuki.
Thanks for the contribution.
I just test PIC16F1824 FCD and so far it's work fine (hardware n simulation) ... for A2INT interrupt. For IOC on Port A still not doing yet.
I will test it for IOC for PIC16F1824 n IOC and A2INT for PIC12F1840 on next week as I need to finish my urgent project this week.
I will let you know the result later once I test it.
NOTE: If you want to do, is it possible to make FCD for PIC16F1503 ? as I have some stock on this PIC but flowcode 4.x not support. If you cannot/don't want to make it, it's ok to me as you help me a lot already. Sorry to trouble you on so many PICs.
Thanks a lot for your help.
Zuki.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi Zuki,
It's just not only making FCD file, I have to make PIC16F1503.h and FCD both.
I will work on my off time to make that..Is that ok?
Enamul
It's just not only making FCD file, I have to make PIC16F1503.h and FCD both.
As those file should include all the functionality of the ic, it will take time..NOTE: If you want to do, is it possible to make FCD for PIC16F1503 ? as I have some stock on this PIC but flowcode 4.x not support.
I will work on my off time to make that..Is that ok?
Enamul
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Re: Interrupt Not Working for PIC16F1824
Your respond already make me so happyEnamul wrote:Hi Zuki,
It's just not only making FCD file, I have to make PIC16F1503.h and FCD both.As those file should include all the functionality of the ic, it will take time..NOTE: If you want to do, is it possible to make FCD for PIC16F1503 ? as I have some stock on this PIC but flowcode 4.x not support.
I will work on my off time to make that..Is that ok?
Enamul



Take your time ... I don't need it urgent ... just to make use of my ready stock of PICs
Thanks for all help.

- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi Zuki,
I have seen a problem in Ben post...
http://www.matrixmultimedia.com/mmforum ... fcd#p36603
You can see there...
I will make a try to use Hitech C, I guess that will help to compile PIC 16f15xx family..If I can sort the issue I will post that..
Enamul
I have seen a problem in Ben post...
http://www.matrixmultimedia.com/mmforum ... fcd#p36603
You can see there...
Which means that you can't compile it using Flowcode as V5 yet not compatible with these ICs so v4 also not compatible because of Boostc compiler.I have had a look at the compiler that comes with Flowcode v5 for PIC and unfortunately it does not currently support the 16F15xx range of devices.
I will make a try to use Hitech C, I guess that will help to compile PIC 16f15xx family..If I can sort the issue I will post that..
Enamul
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Re: Interrupt Not Working for PIC16F1824
No problem.
If you can make it happen .. that's very good. But if it's not possible then ok.
Just hope for the best ...
If you can make it happen .. that's very good. But if it's not possible then ok.

Just hope for the best ...

- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi Zuki,
I have made a new FCD file for PIC 16f1824 which has the facility to set rising edge and falling edge from port int properties. I hope this will help you and you don't need to deal with C code any more.By the way I am working on 16f1503..
Thanks,
Enamul
I have made a new FCD file for PIC 16f1824 which has the facility to set rising edge and falling edge from port int properties. I hope this will help you and you don't need to deal with C code any more.By the way I am working on 16f1503..
Thanks,
Enamul
- Attachments
-
- 16F1824v2.fcd
- Changed as per your request but remember to rename to 16f1846.fcd
- (11.44 KiB) Downloaded 483 times
-
- TEST.fcf
- simple FC to test INT
- (5.5 KiB) Downloaded 474 times
Last edited by Enamul on Fri Jul 20, 2012 4:25 pm, edited 1 time in total.
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
Re: Interrupt Not Working for PIC16F1824
Hi Enamul,
Thanks for the FCD.
I will test it by next week as I too busy this week. I will post the result.
Hope you can make FCD for PIC16F1503 too ...
BTW, can you change the name of new FCD to ie. PIC16F1824_v2 ( I will change it to PIC16F1824) or something like that so I won confuse.
Just for keep track
Thanks for the FCD.
I will test it by next week as I too busy this week. I will post the result.
Hope you can make FCD for PIC16F1503 too ...



BTW, can you change the name of new FCD to ie. PIC16F1824_v2 ( I will change it to PIC16F1824) or something like that so I won confuse.

Just for keep track

- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Interrupt Not Working for PIC16F1824
Hi Zuki,
I have already made FCD for the PIC 16f1503 and checking everything to post..
Enamul
I have already made FCD for the PIC 16f1503 and checking everything to post..
I have tried both v4 and v5 and seen that the chip can be added to target chip list..Just wait for a while..Hope you can make FCD for PIC16F1503 too ...

Enamul