On Sunday 15 June 2003 07:29, Olin Lathrop scribbled: > Don't look to the app notes for examples of well written code. I've se= en > too much bad coding to trust any of them. Personally, I think they are= a > waste of time at best, downright misleading at worst. I'll actually have to agree with this, as I've found other (unrelated) ap= p=20 notes w/code that was obviously not tested, and could not even compile. > That won't prove anything. The problem is subtle and small, so it may = not > occur, or you may not notice if it does occur a few times. Eventually = it > may cause long term time drift. Trust the data sheet, ignore the app > notes. > ... > It *might* be OK to write the high byte when you know a carry from the = low > byte can't happen. However, the data sheet is unclear on this, and I > wouldn't count on it. Unfortunately, the datasheets have had their share of errors as well. I = think=20 the key here is to find out *why exactly* Microchip indicated that writin= g to=20 TMR1H should be done carefully. I may have to give them a call this week= =2E =20 So far, in about 14 hours of testing, it's keeping excellent time. But t= his=20 technique aside, I do like, and can agree with being more trusting of the= =20 technique that monitors the upper bit(s) on TMR1H. Should be easy to=20 setup/test, as I was doing that already (a separate app) with my own coun= ter=20 register, and just need to strip out a bunch of code and read TMR1H inste= ad. Cheers, -Neil. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu