Page 1 of 1
Timer not working
Posted: Sun Dec 31, 2017 1:13 pm
by howard123
Hello all
The TMR3 on my PIC device does not work when used as a timer. Reassigning to identical TMR1 or TMR5 does however work.
Great new year everyone.
Howard
PIC18F45K22
FC 7.3.0.5
Re: Timer not working
Posted: Tue Jan 02, 2018 1:39 pm
by Benj
Hi Howard,
I've had a look through the Flowcode chip definition and so far I haven't spotted a reason for timer 3 to be different from timers 1 or 5. Can you post a demo program that exhibits the problem.
Re: Timer not working
Posted: Wed Jan 03, 2018 5:57 pm
by howard123
Hi Ben
Here is that code
thanks
Howard
Re: Timer not working
Posted: Fri Jan 12, 2018 2:04 pm
by howard123
Hi Ben
It may be of use to you to know that I have duplicated this problem on a different chip type from the same family.
In this example I have enabled each timer, TMR1 TMR3 TMR5, one at a time to deliver about 30Hz. These are the results..
TMR1 correctly flashes the attached LED at 1Hz
TMR3 does not work.
TMR5 incorrectly flashes the LED at 4Hz.
Many thanks
Howard
PIC18F46K22
Re: Timer not working
Posted: Fri Jan 12, 2018 2:31 pm
by Benj
Hi Howard,
Thanks for that. I'm having another look for you now.
I have looked at the Microchip errata document for the device and it does mention the timers 1, 3, 5 several times so it could be it's a silicone bug. I'll have another look through the code just to be sure.
Maybe try FOSC/4 instead of FOSC as the clock source?