On Thu, Jul 19, 2001 at 06:44:57AM +0100, Simon-Thijs de Feber wrote: > Hello all, > > I was wondering what the exact behaviour of the timer > is. > > Firts I set the timer interrupt and pre-scalers. > When i need the timer I write 0x00 to it and it starts > to run. This isn't correct. The writing of the 0 doesn't start the timer. The timer enable bit is in a control register. Since I use 16F87X parts now, I can't tell you exactly where that register is located. But once enabled the timer will run on its own. > Gives an interrupt on 0xFF->0x00. I handle the > interrupt. Right. > > But what then ???????? > > I noticed that i have to write 0x00 to it again to > start it ! > > Is this correct ??? Nope. The timer should continue running. In fact to maintain accurate time it's best to leave it free running. If you write to the timer it loses some of its resolution in the write delay. In my last project, I use two of the three timers in the 16F877. Both are free running. Once they are initialized, there are no other writes to the timer registers. BAJ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body