Russell McMahon email (remove spam text)
> To get a period of 250 out of TMR2 you set the PR2 register to 249!
And bingo, Bob's your uncle.
251/250 too long = 1 in 250 = 1 extra second per 4 minutes 10 seconds.
I think Bob, and Andrew Warren with a more general take on the same thing,
have hit the nail on the head.
> > > I initialized TMR2 with prescaler 4, postscaler 1:1 and period 250.
> > > ....
> > > clock lags behind about a second in 4 minutes. IMHO, the error is
> > > too big to fix it only in software. So there must be something else
> > > wrong.
http://www.piclist.com hint: To leave the PICList
See also: www.piclist.com/techref/microchip/time.htm?key=clock
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the