Hello,
The Timer2 interrupt of the PIC16F1779 MCU is not working for me in Flowcode10.
Martin (medelec35) sent me a modified 16F1779.fcdx file that I tested with.
viewtopic.php?t=3215
I would be happy if you could investigate it.
Thanks,
Sasi
As a supplement, I would like to add that interrupts implemented using Timer0 and Timer1 work fine.
PIC16F1779 Timer2 Interrupt problem [SOLVED]
-
- Posts: 117
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 12:11 pm
- Has thanked: 39 times
- Been thanked: 14 times
PIC16F1779 Timer2 Interrupt problem [SOLVED]
Last edited by Sasi on Tue Jul 22, 2025 2:43 pm, edited 1 time in total.
-
- Matrix Staff
- Posts: 2033
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 634 times
- Been thanked: 684 times
Re: PIC16F1779 Timer2 Interrupt problem
Hi Sasi.
I have look at a simulator and its not setting bit7 for T2CON ON
Looking at fdc for 16F1779, all of the code for timer 2 interrupt is wrong as microchip changed the rules with this family.
I have made a lot of changes, hopefully timer 2 will work, but I can't test it as not got 16F1779
If it does work, I will change the affected fcds
I have look at a simulator and its not setting bit7 for T2CON ON
Looking at fdc for 16F1779, all of the code for timer 2 interrupt is wrong as microchip changed the rules with this family.
I have made a lot of changes, hopefully timer 2 will work, but I can't test it as not got 16F1779
If it does work, I will change the affected fcds
- Attachments
-
- 16F1779.fcdx
- (24.7 KiB) Downloaded 43 times
Martin
-
- Matrix Staff
- Posts: 2033
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 634 times
- Been thanked: 684 times
Re: PIC16F1779 Timer2 Interrupt problem
Thank you for your patience and feedback, I have figured out what the issue is.
In the original code the clock source was left out.
I have now set the clock source to Fosc/4
Now you should see Timer2 working.
In the original code the clock source was left out.
I have now set the clock source to Fosc/4
Now you should see Timer2 working.
- Attachments
-
- 16F1779.fcdx
- (24.83 KiB) Downloaded 30 times
Martin
-
- Matrix Staff
- Posts: 2033
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 634 times
- Been thanked: 684 times
Re: PIC16F1779 Timer2 Interrupt problem [SOLVED]
That's great!
I'm glad I got it working for you.
Now that I have got used to setting up fdcx for 16F1779, I have gone a bit further by allowing you to select a Timer 2 source, rather than fixing the source.
Now you will have complete control with timer 2
I'm glad I got it working for you.
Now that I have got used to setting up fdcx for 16F1779, I have gone a bit further by allowing you to select a Timer 2 source, rather than fixing the source.
Now you will have complete control with timer 2
- Attachments
-
- 16F1779.fcdx
- (25.34 KiB) Downloaded 45 times
Martin