On Nov 22, 8:43=A0am, Cesar Rabak <csra...@bol.com.br> wrote: > Em 20/11/2010 23:43, Glenn Gundlach escreveu: > > > On Nov 17, 9:21 am, Jim Stewart<jstew...@jkmicro.com> =A0wrote: > > =A0 > =A0Rob Gaddi wrote: > > =A0 > =A0> =A0Way too expensive. Just plug into the mains and learn to count to > > 60 or > > =A0 > =A0> =A050 as the case may be. Doing so without electrocution is left as > > an > > =A0 > =A0> =A0exercise for the reader. > > > =A0 > =A0Have you ever successfully done this? =A0I ask > > =A0 > =A0because I've never seen an implementation that > > =A0 > =A0was more accurate than a $2 crystal and clock > > =A0 > =A0chip. > > > A synchronous motor clock does exactly this and is dead accurate. > > But it's also a damn good low pass filter. =A0. =A0. > > > The > > power grid wouldn't work if the generators all weren't in phase. > > Counting zero crosses is easy. In my clock I added 1 diode before the > > main filter cap so I have 120Hz ripple. Run that into a comparator to > > create an interrupt for the processor and just count to 120 and bump > > the seconds, minutes, hours, days, months and years. > > Put your zero crossing detector in the same circuit than an ordinary > blender (if you're _really_ bold, get one SCR phase controlled ;-) and > see the accuracy of your clock go to the drain. . . Would a variable speed power drill plugged into the same outlet fill the bill ? I had the problems you're describing when I first fired it up in 2001. My solution was to use one of the built in timers to disable the 120 Hz interrupt for 92% of the time. I just looked at the 120Hz on the scope while running the drill. The phase and pulse width shifts up to 200 uSec. but there were no extra pules. > > The trick is to not count 'noise' but it's as easy as Rob implies. > > It's not that easy, except if the application has low expectancies about > the accuracy of your clock display. > Noise is under control and not messing things up. > > During a power failure it substitutes its own 120 Hz to keep counting during power > > failures. > > Which for reasonable periods of time has to be as good as the primary > source. . .> > > For about $11 you can get a WWVB receiver from Digikey to > > set it and take care of DST. > > At this stage, isn't it more appropriate to use the WWW receiver to get > the hour information altogether?Agreed but the signal is only reliable at night. For the rest of the day the power line is easiest.> -- > Cesar Rabak > GNU/Linux User 52247. > Get counted:http://counter.li.org/G=B2
Real Time Clock Code (RTC) for PIC family
Started by ●November 17, 2010
Reply by ●November 22, 20102010-11-22
Reply by ●December 3, 20102010-12-03