On a sunny day (Wed, 17 Nov 2010 15:35:57 -0800 (PST)) it happened "robertwessel2@yahoo.com" <robertwessel2@yahoo.com> wrote in <868808a3-8dd9-4e66-a943-6980747e04f8@d20g2000yqg.googlegroups.com>:>On Nov 17, 2:06�pm, jacko <jackokr...@gmail.com> wrote: >> On Nov 17, 7:24�pm, "robertwess...@yahoo.com" >> >> >> >> >> >> <robertwess...@yahoo.com> wrote: >> > On Nov 17, 12:50�pm, John Devereux <j...@devereux.me.uk> wrote: >> >> > > Jim Stewart <jstew...@jkmicro.com> writes: >> > > > Rob Gaddi wrote: >> >> > > >> Way too expensive. Just plug into the mains and learn to count to = >60 or >> > > >> 50 as the case may be. Doing so without electrocution is left as a= >n >> > > >> exercise for the reader. >> >> > > > Have you ever successfully done this? �I ask >> > > > because I've never seen an implementation that >> > > > was more accurate than a $2 crystal and clock >> > > > chip. >> >> > > Don't 90% of the worlds digital alarm clocks work like this? I though= >t >> > > "they" precisely controlled the long term cumulative frequency error = >of >> > > the mains for this very reason? >> >> > Of course they do, although the reason the power networks are so >> > carefully synchronized has little to do with the power companies� >> > interest in the accuracy of your clocks. �Each powerplant is a (very) >> > large AC generator. �They basically just wire up all the power plants >> > in a single grid in parallel - if the phases were not precisely >> > synchronized it wouldn't work any better than a device in which you >> > inserted some of the batteries upside down. �Moving power between >> > grids is trickier, simply because they are not synchronized. �High >> > voltage DC is somewhat popular for that task, and people still use >> > motor/generator sets. >> >> > Some electromechanical clocks take advantage of the same by using >> > synchronous motors to drive the clock mechanism. >> >> > But there is a ton of noise on the mains, which requires some care if >> > you want to get a good 60Hz (or 50Hz) pulse. >> >> You can either low pass the mains signal scaled down, or square up the >> mains signal using a schmitt inverter, and then use a monostable >> counter set to just lower than the required frequency and ignore any >> state changes for one counter period. Another option is to scale down >> the mains and compare the half wave rectifications of the positive and >> negative by a potential divider and a neutral comparator... BE CAREFUL >> and maintain any NEEDED isolation. > > >It can be simpler and more reliable to just have your own 60Hz* timer >(or more precisely, a reasonable multiple of that from which you can >derive the 60Hz signal), and then use what you pull off the mains to >correct for drift. That makes it easy to deal with various sorts of >missed zero crossings (since you know where it's supposed to be, plus >or minus a percent or two), and, as you mentioned, you can use that >same internal timer to filter much of the noise that you can see >between the zero crossings. It also leads to a setup where you can >run a device without depending on the mains (obviously practical only >if there's another power source), but you might get a bit of time >drift while the power is out. I believe that's what the "better" line >powered alarm clocks (the one's with a backup battery) do, and at >least the clock is powered by the battery, even if the display is not. > >*60Hz chauvinism not to be taken too seriouslyIIRC in some Olympic games, I think it was fencing, they used timers from Europe brought to the US. The timers were running fast. They had to go back to the stopwatches.
Real Time Clock Code (RTC) for PIC family
Started by ●November 17, 2010
Reply by ●November 18, 20102010-11-18
Reply by ●November 18, 20102010-11-18
On 18.11.2010 00:13, Michael A. Terrell wrote:> Really? Watch batteries last me about a year.Then the Chinese (or whoever else makes the cheap wrist watches these days) must have forgotten how to design them properly. Unless you abuse your watch for a flashlight, there's no reason a simple LCD watch shouldn't last several years on a single cell.> TV remote batteries last a few months, far short of the three to four > year, 'Use By date' on the labels.I don't think I've ever replaced the batteries in any ordinary remote more than twice --- by that time, either the device being controlled, or the remote itself, were usually done for. The only exception is that programmable universal remote --- that one eats batteries like there's no tomorrow.
Reply by ●November 18, 20102010-11-18
Hans-Bernhard Br�ker wrote:> > On 18.11.2010 00:13, Michael A. Terrell wrote: > > > Really? Watch batteries last me about a year. > > Then the Chinese (or whoever else makes the cheap wrist watches these > days) must have forgotten how to design them properly. Unless you abuse > your watch for a flashlight, there's no reason a simple LCD watch > shouldn't last several years on a single cell.I live in Florida. The humidity is quite high and it kills them.> > TV remote batteries last a few months, far short of the three to four > > year, 'Use By date' on the labels. > > I don't think I've ever replaced the batteries in any ordinary remote > more than twice --- by that time, either the device being controlled, or > the remote itself, were usually done for.I've never had a set last more than six months, and I don't watch much TV.> The only exception is that programmable universal remote --- that one > eats batteries like there's no tomorrow.-- For the last time: I am not a mad scientist! I m just a very ticked off scientist!!!
Reply by ●November 18, 20102010-11-18
Hans-Bernhard Br�ker:> Unless you happen to be in the enormously lucky position of having e-ink > displays at your disposalOr cholesteric LCDs: http://www.kentdisplays.com/
Reply by ●November 19, 20102010-11-19
On Nov 19, 1:31=A0am, "F. Bertolazzi" <TOGLIe...@MAIUSCOLEtdd.it> wrote:> Hans-Bernhard Br ker: > > > Unless you happen to be in the enormously lucky position of having e-in=k> > displays at your disposal > > Or cholesteric LCDs:http://www.kentdisplays.com/Seem to have loads of pins... for a pic a spi version would be better, with a character ROM.
Reply by ●November 20, 20102010-11-20
On Nov 17, 9:21=A0am, Jim Stewart <jstew...@jkmicro.com> wrote: > Rob Gaddi wrote: > > Way too expensive. Just plug into the mains and learn to count to 60 or > > 50 as the case may be. Doing so without electrocution is left as an > > exercise for the reader. > > Have you ever successfully done this? =A0I ask > because I've never seen an implementation that > was more accurate than a $2 crystal and clock > chip. A synchronous motor clock does exactly this and is dead accurate. 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. The trick is to not count 'noise' but it's as easy as Rob implies. During a power failure it substitutes its own 120 Hz to keep counting during power failures. For about $11 you can get a WWVB receiver from Digikey to set it and take care of DST. G=B2 G=B2
Reply by ●November 20, 20102010-11-20
On Sat, 20 Nov 2010 17:43:12 -0800 (PST), Glenn Gundlach <stratus46@yahoo.com> wrote:><snip> >For about $11 you can get a WWVB receiver from Digikey to >set it and take care of DST.Are you referring to 561-1014-ND? Jon
Reply by ●November 21, 20102010-11-21
On Nov 20, 7:22=A0pm, Jon Kirwan <j...@infinitefactors.org> wrote: > On Sat, 20 Nov 2010 17:43:12 -0800 (PST), Glenn Gundlach > > <stratu...@yahoo.com> wrote: > ><snip> > >For about $11 you can get a WWVB receiver from Digikey to > >set it and take care of DST. > > Are you referring to 561-1014-ND? > > Jon Yep. I've got a few for the clock project(s). During the day in LA the 'data' is just noise but at night it looks just like page 25 of http://tf.nist.gov/general/pdf/1383.pdf The processor is a Freescale 68HC908JK8 running assembly. The code is mostly written which isn't very hard with NIST providing 'sync' references on the nine second marks. It looks good in the simulator but I haven't actually run it for real. 'Real soon now'. The 'noise reduction' of the power line reference simply uses one of the timers to disable interrupts until a few microseconds before the expected interrupt happens. Keeps fine time. G=B2
Reply by ●November 21, 20102010-11-21
On Thu, 18 Nov 2010 14:49:15 +0000, Jan Panteltje wrote:>>*60Hz chauvinism not to be taken too seriously > > IIRC in some Olympic games, I think it was fencing, they used timers > from Europe brought to the US. The timers were running fast.Using mains-based timers for sports timing seems odd, even if fencing doesn't require millisecond precision like e.g. the 100m sprint. Mains frequency is only accurate over long periods. The instantaneous frequency can vary; they just make sure that the error doesn't accumulate. This is fine for an ordinary clock, where it doesn't matter if it runs fast or slow by a fraction of a percent, so long as it doesn't gain or lose over time, but it isn't what you want for accurate timing over a short period. AFAICT, large grids maintain frequency to within 200-330ppm. Better than an RC oscillator but worse than a typical microprocessor crystal, and signifcantly worse than a watch crystal.
Reply by ●November 22, 20102010-11-22
Em 20/11/2010 23:43, Glenn Gundlach escreveu:> On Nov 17, 9:21 am, Jim Stewart<jstew...@jkmicro.com> wrote: > > Rob Gaddi wrote: > > > Way too expensive. Just plug into the mains and learn to count to > 60 or > > > 50 as the case may be. Doing so without electrocution is left as > an > > > exercise for the reader. > > > > Have you ever successfully done this? I ask > > because I've never seen an implementation that > > was more accurate than a $2 crystal and clock > > chip. > > A synchronous motor clock does exactly this and is dead accurate.But it's also a damn good low pass filter. . .> 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. . .> 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.> 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? -- Cesar Rabak GNU/Linux User 52247. Get counted: http://counter.li.org/