16 bit timer

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.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…