Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16 bit timer

Status
Not open for further replies.

2camjohn

Member
I moved some of my routines from an 8 bit timer to the 16 bit timer on the 16f819.

From my understanding the timer works exactly the same except it overflows after 65536 ticks instead of 256.


So I expected to see the routine slow down alot (with the same prescalar it should run 256 times slower than an 8 bit timer). But it doesnt.

Am I misunderstanding how 16 bit timers work(I thought it just had to count upto 16 bits instead of 8 )?

Is there anything else I should know?


Cheers
John
 
The 16 bit timers don't use the prescaller in the OPTION register. Timer 1 and 2 have there own prescallers.

Mike.
 
2camjohn said:
Just to confirm a 16 bit timer will only create an overflow once it has incremented 65536 times???

Cheers
John

Yes, in your case, with the prescaler set to 8, it will be 8*65536.

How are you testing for overflow? With TMR1IF?

Mike.
 
Status
Not open for further replies.

Latest threads

Back
Top