RTC chips that behave nicely with crystals

169 views
Skip to first unread message

David Forbes

unread,
Nov 2, 2016, 2:20:17 AM11/2/16
to neonixie-l
Folks,

I am attempting to make my new scope clock ready for production. I
noticed that the prototype has horrible timekeeping ability - it loses a
couple seconds per day. It uses a DS1307 RTC chip, which has no means of
adjusting the 32kHz crystal to run at the correct speed.

The Maxim alternative is the DS3231 chip with internal oscillator, which
costs several dollars more.

I previously have used a PIC processor or 74HC4060 oscillator circuit
that features external load capacitors instead of an RTC, so I've been
able to adjust the crystal rate with a little SMT trimmer capacitor on
the X1 pin. I can adjust it to a second a week, which is decent.

Are there any other RTC chips out there that allow one to trim the
crystal frequency, or do I need to build an external oscillator from a
74HC04 and do it brute force?

--
David Forbes, Tucson AZ

Nick

unread,
Nov 2, 2016, 2:29:49 AM11/2/16
to neonixie-l
The DS323x series are simple great chips - they may be a few $ more, but it's not all about cost - lower component count, greater accuracy (actually, phenomenal accuracy).

What's not to like?

Nick

Quixotic Nixotic

unread,
Nov 2, 2016, 3:48:48 AM11/2/16
to neoni...@googlegroups.com
A few more $$$s? You can buy a - DS3231 module with additional memory chip for as little as $0.42 inc. free shipping. See https://goo.gl/OHVP8G. That is 35 UK pence. How do they do it? I do not know.

John S

Paolo Cravero

unread,
Nov 2, 2016, 4:07:51 AM11/2/16
to neoni...@googlegroups.com
Hello.
(In the cheap Chinese modules) DS1307 are not accurate. In a DIY clock for my own personal use (bedside clock ;) ) I estimated the drift and corrected it in software, daily. That can be done since it runs 24/7. I had also found an algorithm that computes the total drift from the set timestamp, when the delta was presumably zero, storing values in EEPROM.

DS3231 seems to be much more stable and has some calibration/drift routines too (I must read the datasheet). The little extra cost is certainly worth.

One word of caution. All DSx RTC modules I got from China were configured to charge the backup button cell (LIR2032). If you usually install CR2032's don't forget to remove the diode or resistor coming from Vcc. If you design your own circuits, that's a non-issue.

If you need a vintage look, I have a couple of 2.097152 MHz XTALs in HC33/U case laying around (that's 2^21).

Paolo

Terry S

unread,
Nov 2, 2016, 9:26:24 AM11/2/16
to neonixie-l
I can only guess that the parts are counterfeit, for some reason RTCs are among the favorite parts for the Chinese to fake.

Jonathan Peakall

unread,
Nov 2, 2016, 10:24:26 AM11/2/16
to neoni...@googlegroups.com
Agreed, most likely fakes. I like these RTCs and use them in my projects. A buddy of mine bought some cheap ones and they were inaccurate. I think they were indeed fakes.
--
You received this message because you are subscribed to the Google Groups "neonixie-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+...@googlegroups.com.
To post to this group, send email to neoni...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/e6cceccf-f66d-465d-992b-4c6e21c76165%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gregebert

unread,
Nov 2, 2016, 11:50:09 AM11/2/16
to neonixie-l
Keep the DS3231; it's very accurate.  One of my clocks uses it, and it has drifted about 10 seconds since daylight savings started more than 6 months ago. My wristwatch demo board has been running 1.5 years and it's also within a few seconds. If you want anything better, you'll probably need GPS or a rubiduim time standard.

I got a few laughs from a $1 Chinese RTC board; wickedly inaccurate. I just swapped the DS3231 with a genuine Maxim device and use that in my clock.

I recall most crystals are accurate to around 10ppm, which is about 1 second per day. My interpretation of that is the manufacturing tolerances result in multiple batches of crystals that will fall within 10ppm of their rated frequency; I suppose you can pay more for cherry-picked units that are more accurate.  I doubt individual crystals drift back-n-forth, so you could add some offset to your software and fine-tune it to each crystal if you dont want to use RTC/GPS/Internet time.

John Rehwinkel

unread,
Nov 2, 2016, 1:34:45 PM11/2/16
to via neonixie-l
> Keep the DS3231; it's very accurate. One of my clocks uses it, and it has drifted about 10 seconds since daylight savings started more than 6 months ago. My wristwatch demo board has been running 1.5 years and it's also within a few seconds. If you want anything better, you'll probably need GPS or a rubiduim time standard.

There are 10MHz rubidium standards available fairly cheaply in the surplus market (a glut of them appeared in a big round of upgrading cellular phone transmitters).

> I got a few laughs from a $1 Chinese RTC board; wickedly inaccurate.

Probably the "DS3231" in that was a cheap microcontroller emulating the protocol and running from an on-board RC oscillator.

> I just swapped the DS3231 with a genuine Maxim device and use that in my clock.

Yeah, the rest of the components are likely acceptable, as they're not important for timing.

> I recall most crystals are accurate to around 10ppm, which is about 1 second per day. My interpretation of that is the manufacturing tolerances result in multiple batches of crystals that will fall within 10ppm of their rated frequency; I suppose you can pay more for cherry-picked units that are more accurate. I doubt individual crystals drift back-n-forth, so you could add some offset to your software and fine-tune it to each crystal if you dont want to use RTC/GPS/Internet time.

Crystals have both drift and temperature sensitivity. The temperature sensitivity can be dealt with by operating them at a fixed temperature in an oven (bulky and power hungry) or adjusting the frequency (or compensating for it in software) depending on temperature (this is what the DS3231 does). The temperature sensitivity also depends on the angle from the quartz crystallographic axes the crystal is cut (the usual "AT" cut has a cubic S-curve of temperature sensitivity with a flattish part typically around 25°C). Drift can be reduced by preprocessing the crystals in various ways (including "swept" quartz, where the crystal is subjected to a strong electric field at high temperature to remove imperfections and impurities). As you might imagine, in the pursuit of ever-higher accuracy, a bewildering amount of science and engineering is involved.

- John

gregebert

unread,
Nov 2, 2016, 2:29:49 PM11/2/16
to neonixie-l
I did my 'rubidium standard' on the cheap... checks against my cellphone are as accurate as I'll ever need for clocks. Apparently the cellphone software periodically queries the real time from the cellular infrastructure, not just at power-on.

OK, joke-of-the-day for the most accurate clock I've ever owned.....
We have a battery-powered kitchen clock that makes bird-tweet sounds at the top-of-the-hour (a different bird each hour, mind you). That doggone clock is dead-on, month-after-month. It's a freak of nature. For awhile, it was actually more accurate than my big nixie clock (see my google icon) that uses the 60Hz AC line as a time reference.

Charles MacDonald

unread,
Nov 2, 2016, 3:25:08 PM11/2/16
to neoni...@googlegroups.com
On 16-11-02 01:34 PM, John Rehwinkel wrote:

>> I got a few laughs from a $1 Chinese RTC board; wickedly inaccurate.

I have a small cheep Chinese clock on the Kitchen table, iit drifts
about a minute a week slow. I keep it becasue it has the date which is
hard to see on my MAIN kitchen clock, mounted on the wall, which takes
orders from a US government transmitter in Colorado.

--
Charles MacDonald Stittsville Ontario
cm...@zeusprune.ca Just Beyond the Fringe
No Microsoft Products were used in sending this e-mail.

Jon

unread,
Nov 2, 2016, 3:42:53 PM11/2/16
to neonixie-l

They have to be fakes - that's $0.42 including free international shipping, so the board and components are costing pennies! Maxim budgetary pricing for the chip alone is $3.85 @ 1K scale. Another evidence point for the old maxim that if it seems too good to be true... it probably is.

But the genuine articles are well worth the money - I've used DS3232 extensively and it's the first chip on the schematic in any new clock design.

Jon.

David Forbes

unread,
Nov 2, 2016, 9:55:30 PM11/2/16
to neoni...@googlegroups.com
Greg,

This is for a product, so I am not interested in one-off or
selected-component solutions. I have a rubidium Nixie clock at home that
I use to set and check my Nixie watches. I find that the typical 20PPM
watch crystal can be adjusted to keep time to 1PPM if it's kept at room
temperature on your wrist.

It sounds like the DS3231 is well liked among clock makers. I am just
perturbed that their $1 DS1307 can't be made to run as well as their $5
product, all because they wanted to save a penny for volume
manufacturers by adding internal capacitors to its oscillator circuit.

On 11/2/2016 8:50 AM, gregebert wrote:
> Keep the DS3231; it's very accurate. One of my clocks uses it, and it
> has drifted about 10 seconds since daylight savings started more than 6
> months ago. My wristwatch demo board has been running 1.5 years and it's
> also within a few seconds. If you want anything better, you'll probably
> need GPS or a rubiduim time standard.
>
>
> I recall most crystals are accurate to around 10ppm, which is about 1
> second per day. My interpretation of that is the manufacturing
> tolerances result in multiple batches of crystals that will fall within
> 10ppm of their rated frequency; I suppose you can pay more for
> cherry-picked units that are more accurate. I doubt individual crystals
> drift back-n-forth, so you could add some offset to your software and
> fine-tune it to each crystal if you dont want to use RTC/GPS/Internet time.


gregebert

unread,
Nov 3, 2016, 6:17:06 PM11/3/16
to neonixie-l
Is the scope clock an assembled PCB/finished-product, or a kit ? 

Either way, I'd leave an unpopulated spot on the PCB for the DS3231 and you could sell the 3231 version for a premium. Heck, that's partly what Maxim is doing (I'll concede there's higher silicon/packaging/test costs for the 3231 vs 1307). I'm sure there are other add-ons you could come-up with (nicer case, faceplate, knobs, etc) for a "limited edition" version at a higher price.

I cant speak for others, but if I have the option to pay a bit more for a nicer product, I'll usually do it.

I'm not a fan of daughter cards, but that's another option.

Dekatron42

unread,
Nov 4, 2016, 1:32:33 AM11/4/16
to neonixie-l
Have you read Application note 58. "Crystal Considerations with Maxim Real-Time Clocks (RTCs)" for the RTCs? I don't know if it will help you but it mentions a lot of things to think about when using these RTCs with built in load capacitors, it mentions layout designs and other things related to overshoot on pins.


/Martin

David Forbes

unread,
Nov 4, 2016, 12:03:44 PM11/4/16
to neoni...@googlegroups.com
Martin,

Yes, I have read that app note. I know all about good layout practice.
It does not address my problem that the capacitors are built in. I even
sent a query to the Maxim app engineers. They had no solutions, other
than spending lots more money for their high-end product.
> --
> You received this message because you are subscribed to the Google
> Groups "neonixie-l" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to neonixie-l+...@googlegroups.com
> <mailto:neonixie-l+...@googlegroups.com>.
> To post to this group, send email to neoni...@googlegroups.com
> <mailto:neoni...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/neonixie-l/ddb193d4-c66f-4b47-acc9-2668f907f27a%40googlegroups.com
> <https://groups.google.com/d/msgid/neonixie-l/ddb193d4-c66f-4b47-acc9-2668f907f27a%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


Steve Wiseman

unread,
Nov 13, 2016, 7:07:54 PM11/13/16
to neoni...@googlegroups.com
On 4 November 2016 at 16:03, David Forbes <dfo...@dakotacom.net> wrote:
> Martin,
>
> Yes, I have read that app note. I know all about good layout practice. It
> does not address my problem that the capacitors are built in. I even sent a
> query to the Maxim app engineers. They had no solutions, other than spending
> lots more money for their high-end product.

I take it you picked a crystal to match their spec (12.5pF, 45KOhm)?
If so, how much do you trust it? Did you try others?
Maxim, while sometimes a bit weaselly, do tend to mean what they say
on datasheets.
If you want that cheap RTC, but your own trimmable oscillator, then
why not? Silicon's cheap, and if you've got the board space, why not
do that, and drive the RTC's Xin? It'll cost a little power, of
course.
Or, for cheapness, just trim at high level in software, bang a
leap-second in or out at midnight, if these things are reliably off...
Accumulate them and apply however many you need when you wake, as long
as you can store the time that you went to sleep.
That said, DS3231 avoids a lot of this messing about. I use and like it.

Steve
Reply all
Reply to author
Forward
0 new messages