Thank you Jinx. I didn't see this until now, because for some reasons it scored as spam in Eudora. Your clock is very precise. But the board is done and I don't feel like redoing it. Anyway, I am not using the Timer1 counter as the clock itself, rather, I add a 64bit value (typically 0x0000000100000000 if the 32768 source was perfect) each second (i.e. each 32768 xtal ticks). Later, I will be able to change that 0x0000000100000000 to a slightly more or less, to compensate for the non-perfectly-32768Hz frequency of the xtal. Adding temperature compensation would turn it into an almost atomic clock ;) but I don't have the time for that now, maybe for the next board. Cheers, Mario At 20.52 2008.05.21, you wrote: >> Maybe it's important to add that it's a dsPIC (30F5011 to be exact) >> and that I want it to be precise > >Mario, if you want short- and long-term accuracy, may I suggest >the attached circuit. You can get 1 minute per year stability. By >my reckoning that's about 1 part in 12,000,000, or keeping a 32k >crystal stable to 0.0026Hz > >In a back-up situation with a 12V SLA, I use 150k/22k as a voltage >divider to get ~1.7V for the clock driver and a 5V LDO to power the >CMOS and a 12F675 time-keeper. Shown is part of the circuit for >a battery-powered remote logger -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist