Firstly, I'm not running off battery power. After much fiddling with config bits I have discovered that with the PIC running on XT mode, it runs a lot faster than it should if it is using the 32.768KHz clock. Also, on INTRC mode it runs too fast. On EXTRC, LP or HS mode it doesn't run at all. The reason I'm trying to use the 32.768KHz clock as the system clock is that I don't have a clue how to make a delay by checking a clock - The only method I know is many embedded loops. Any pointers to good tutorials / examples about using a non-system clock for a 1 second delay would be extremely welcome. BTW, does anyone know why the ICD2 sometimes refuses to program unless the PIC power is turned off for a second - it works fine for a while, and after a few programs, needs a reset, then it works fine again. On 5/8/05, Byron A Jeff wrote: > On Sun, May 08, 2005 at 03:11:51PM +0100, Dave Turner wrote: > > Oh, i didn't know the RC could be so innacurate. > > RC is never used for timing sensitive applications. At the nominal 1% > a RTC will drift 36 seconds an hour. > > 1% represents 10000 PPM. Most crystals are in the range of 20 PPM. > > And each of these will drift differently based on temperature. > > My conclusion is that an external source is the best bet. Jinx has posted > about the $2 USD battery powered clock modules. Also one can use the WWVB > 60 KHz clock signal broadcast from Colorodo. Finally the easiest and most > stable tick source is the 60 Hz AC signal out of the power outlet. A > transformer and an optosiolator will give you 216000 ticks per hour like > clockwork. > > When I get back to my sunrise/sunset controller I plan to use the power > outlet signal to keep accurate time. The 32Khz crystal will be my backup > during power outages as this project has a gel-cell battery backup. > > BAJ > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist