PIC16F1779 Timer2 Interrupt problem [SOLVED]

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
Sasi
Posts: 117
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 39 times
Been thanked: 14 times

Flowcode v10 PIC16F1779 Timer2 Interrupt problem [SOLVED]

Post by Sasi »

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
16F1779.fcdx
(24.2 KiB) Downloaded 36 times
PIC16F1779_TMR2_INT_test.fcfx
(11.68 KiB) Downloaded 51 times
As a supplement, I would like to add that interrupts implemented using Timer0 and Timer1 work fine.
Last edited by Sasi on Tue Jul 22, 2025 2:43 pm, edited 1 time in total.

medelec35
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

Post by medelec35 »

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
Attachments
16F1779.fcdx
(24.7 KiB) Downloaded 43 times
Martin

Sasi
Posts: 117
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 39 times
Been thanked: 14 times

Re: PIC16F1779 Timer2 Interrupt problem

Post by Sasi »

Hi Martin,
I tried it on hardware (Curiosity HPC Board), but unfortunately the Timer2 interrupt does not work with the modification.
Sasi

medelec35
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

Post by medelec35 »

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.
Attachments
16F1779.fcdx
(24.83 KiB) Downloaded 30 times
Martin

Sasi
Posts: 117
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 39 times
Been thanked: 14 times

Re: PIC16F1779 Timer2 Interrupt problem

Post by Sasi »

Great! Now the Timer2 Interrupt works. :D
Thank you very much.
Regards,
Sasi

medelec35
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]

Post by medelec35 »

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
Attachments
16F1779.fcdx
(25.34 KiB) Downloaded 46 times
Martin

Sasi
Posts: 117
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 39 times
Been thanked: 14 times

Re: PIC16F1779 Timer2 Interrupt problem [SOLVED]

Post by Sasi »

Clock Source Select also works. :D
Thanks!
If you have time to work on the DAC and CCP issues, I would be happy to help you with the testing.
Sasi

Post Reply