What sort of PIC are you using? I've been playing with an '877, where timer1 has a built in oscillator. I used a 32768 Hz watch xtal, and get timer overflow every 2 seconds. By preloading the timer, you can get other values, or by polling the counter you can measure time in 1/32768 ths of a second. larry At 03:41 PM 11/26/2002 +0200, you wrote: > > You appear to have the dread "quoted printable" set > >What does it mean? I'll look into it... > > > Sherlock Holmes tells us that therefore the code is wrong! > > (probably :-) ) > >Code is wrong! ;-) > > > Most probable cause is that you haven't allowed for the time > > spent in the ISR when reloading the counter. > >No, that's not it. I chose TMR2 where there is no need to reload any >counters. Compare value PR2 is loaded only once when initializing >interrupts. > >But datasheet says: "Timer2 increments from 00h until it matches PR2 and >then resets to 00h on the next increment cycle." > >So, instead of PR2 value 250 I should use 249. > >Am I right? > >Tauno > >-- >http://www.piclist.com#nomail Going offline? Don't AutoReply us! >email listserv@mitvma.mit.edu with SET PICList DIGEST in the body Larry Bradley Orleans (Ottawa), Ontario, CANADA -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body