TMR1 and 12F1840

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

TMR1 and 12F1840

Post by Jan Lichtenbelt »

Using timer1 with 12F1840 gives and error that the Timer1 Clock Source Selection bit TMR1CS in Timer1 Control Register T1CON is an unknown identifier.

What to do?


Jan Lichtenbelt

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: TMR1 and 12F1840

Post by Benj »

Hi Jan,

Here is an updated FCD file.
12F1840.fcd
(9.76 KiB) Downloaded 266 times
Let me know how you get on.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: TMR1 and 12F1840

Post by Jan Lichtenbelt »

Hi Ben,

Thanks, this one works correctly.

Jan


PS. TMR1CS has been replaced by TMR1CS1

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: TMR1 and 12F1840

Post by Jan Lichtenbelt »

I still have problems, even with the new FDC file (using Flowcode V4.5)

The Timer1 does not work and I do not know why. But I solved the problem with an additional C-code t1con=0x01; directly after the enable macro. This enables the Timer1, with precsaler 1:1 ansd clock source Fosc/4. If you need other prescaler values or trigger on external pin, see datasheet chapter 21.11.

Kind regards,

Jan Lichtenbelt

Post Reply