Timer not working

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

Moderator: Benj

Post Reply
howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

Timer not working

Post 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

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

Re: Timer not working

Post 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.

howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

Re: Timer not working

Post by howard123 »

Hi Ben
Here is that code
thanks
Howard
Attachments
TMR3 test.fcfx
(75.04 KiB) Downloaded 202 times

howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

Re: Timer not working

Post 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
Attachments
TMR3 test 2.fcfx
(10.98 KiB) Downloaded 195 times

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

Re: Timer not working

Post 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?

Post Reply