Real Time Clock Code (RTC) for PIC family

On a sunny day (Wed, 17 Nov 2010 15:35:57 -0800 (PST)) it happened " snipped-for-privacy@yahoo.com" wrote in :

IIRC 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.

Reply to
Jan Panteltje
Loading thread data ...

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 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 to
Hans-Bernhard Bröker

I live in Florida. The humidity is quite high and it kills them.

I've never had a set last more than six months, and I don't watch much TV.

--
For the last time:  I am not a mad scientist!  I m just a very ticked
off scientist!!!
Reply to
Michael A. Terrell

Hans-Bernhard Bröker:

Or cholesteric LCDs:

formatting link

Reply to
F. Bertolazzi

k

Seem to have loads of pins... for a pic a spi version would be better, with a character ROM.

Reply to
jacko

On Nov 17, 9:21=A0am, Jim Stewart 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. >

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 to
Glenn Gundlach

Are you referring to 561-1014-ND?

Jon

Reply to
Jon Kirwan

On Nov 20, 7:22=A0pm, Jon Kirwan wrote: > On Sat, 20 Nov 2010 17:43:12 -0800 (PST), Glenn Gundlach >

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

formatting link

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 to
Glenn Gundlach

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 to
Nobody

But it's also a damn good low pass filter. . .

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. . .

It's not that easy, except if the application has low expectancies about the accuracy of your clock display.

power

Which for reasonable periods of time has to be as good as the primary source. . .

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.
 Click to see the full signature
Reply to
Cesar Rabak

jacko:

Well, for a Peripheral Interface Controller anything would be better than faking an MCU.

Reply to
F. Bertolazzi

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.