Timer not working

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

howard123
Posts: 66
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 25 times
Been thanked: 27 times
Contact:

Timer not working

Postby howard123 » Sun Dec 31, 2017 1:13 pm

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

User avatar
Benj
Matrix Staff
Posts: 14216
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4355 times
Been thanked: 4095 times
Contact:

Re: Timer not working

Postby Benj » Tue Jan 02, 2018 1:39 pm

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.

howard123
Posts: 66
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 25 times
Been thanked: 27 times
Contact:

Re: Timer not working

Postby howard123 » Wed Jan 03, 2018 5:57 pm

Hi Ben
Here is that code
thanks
Howard
Attachments
TMR3 test.fcfx
(75.04 KiB) Downloaded 35 times
These users thanked the author howard123 for the post:
Benj (Fri Jan 05, 2018 1:14 pm)
Rating: 5.26%
 

howard123
Posts: 66
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 25 times
Been thanked: 27 times
Contact:

Re: Timer not working

Postby howard123 » Fri Jan 12, 2018 2:04 pm

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
Attachments
TMR3 test 2.fcfx
(10.98 KiB) Downloaded 31 times
These users thanked the author howard123 for the post:
Benj (Fri Jan 12, 2018 2:27 pm)
Rating: 5.26%
 

User avatar
Benj
Matrix Staff
Posts: 14216
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4355 times
Been thanked: 4095 times
Contact:

Re: Timer not working

Postby Benj » Fri Jan 12, 2018 2:31 pm

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?
These users thanked the author Benj for the post:
howard123 (Mon Jan 15, 2018 11:29 am)
Rating: 5.26%