Shop OBEX P1 Docs P2 Docs Learn Events
Accuracy of DS1302 — Parallax Forums

Accuracy of DS1302

MoskogMoskog Posts: 554
edited 2009-08-22 22:31 in Accessories
I use the RTC with the recommended 32kHz, 6pF·crystal bought from Parallax. The crystal is soldered to the legs on the RTC and then bended over the top of it. The two·legs of the·RTC is then cut·so they don't go through the·PC board.
The RTC was syncronized with a radio clock on August 1. Yesterday the RTC-time was 38 seconds ahead of the time recieved by the radio clock.· 38 second too fast by 11 days. Is this an error I should expect of·a RTC like this or is it really bad?

·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-12 15:53
    That's an error of about 0.004% or 40ppm. It's not bad. There's a certain crystal to crystal fixed manufacturing variation that you can measure and compensate for. You can also measure ambient temperature and compensate for that (or you can use a thermostatically controlled oven to keep the crystal at a stable temperature). If you look at the Mouser catalog, you'll see that most ordinary crystals are quoted as accurate to +/-50ppm with temperature variations over the usual 0-70C range of +/-50ppm and you're well within that.

    See this datasheet: www.vishay.com/docs/35043/xt38t.pdf

    Post Edited (Mike Green) : 8/12/2009 4:02:00 PM GMT
  • phil kennyphil kenny Posts: 233
    edited 2009-08-12 15:57
    Accuracy of the crystal sold by Parallax is 20 ppm (parts per million)
    according to their data sheet.

    Being off by 38 seconds in 11 days is about 40 ppm, so your crystal
    seems to be off by more than the data sheet states, assuming that
    the temperature stayed reasonably constant.

    20 seconds error in 11 days would be 20 ppm.

    phil

    Post Edited (phil kenny) : 8/12/2009 4:02:34 PM GMT
  • MoskogMoskog Posts: 554
    edited 2009-08-13 16:47
    Thanks, Mike and Phil. So an error like this is what to be expected with this kind of hardware.

    But·it means I have to adjust the clock every third week or so because·I really need·this RTC to be as accurate as possibly, though one minute error or so is acceptable.

    My radio clock I mention above gets its signal from the DCF77, a time transmitter located in Frankfurt, Germany some 1500 km away. The time·information is transmitted by binary signals on 77.5 kHz, more on Wikipedia:

    http://en.wikipedia.org/wiki/DCF77

    Now I wonder.. does it exist any kind of RTC that is made to receive this signals [noparse][[/noparse]from DCF77] and also is easy to interface with the BS? Or, will a BS of any kind be able to handle such signals if connected to a 77.5 kHz receiver and then be able to adjust the RTC itself? Maybe·eliminate the need of the whole RTC and just·depend on the received signals?

    Any ideas, you smart people out there?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-13 16:59
    Dallas Semiconductor sells a 32KHz temperature compensated oscillator meant to be used instead of a plain 32KHz crystal for a real time clock. They indicate that you should see errors of +/- 1 minute per year. There are modules used for receiving time standard signals, since they're used in alarm clocks and wristwatches, but I have no experience with them. There have been past do-it-yourself articles in magazines like Circuit Cellar on this topic, but you'll have to research it yourself.

    Look through these: para.maxim-ic.com/en/results.mvp?fam=osc_mod&285=32.768kHz&980=TCXO
  • MoskogMoskog Posts: 554
    edited 2009-08-13 17:12
    Yes, that extremely accurate temperature compensated oscillator·looks extremely interesting to me.

    Thanks again Mike!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-08-13 17:30
    Hello everyone,

    This subject comes up pretty frequently actually. I wish Maxim would publish more information in the datasheet for the DS1302 so customers would understand why this happens. The typical issue with the clock accuracy is that the clock is running fast, as is the case here. This is usually caused by improper mounting of the crystal in the system. There are very specific PCB layout requirements in place to ensure best crystal accuracy. When these aren’t followed, that accuracy goes right out the window. According to the engineers at Maxim/Dallas, when the crystal is not shielded from stray noise (following previously mentioned guidelines) it is possible for the oscillator circuit to occasionally get an extra pulse here and there. This adds clock cycles causing the clock to run fast over time. Mounting the crystal on top of the IC may be great for prototyping, but it adversely affects the overall accuracy.

    I am linking the AppNote which discusses the various reasons for clock accuracy issues. Starting on Page 3 under Crystals and Accuracy and continuing on through page 5 it discusses everything from improper crystal load tuning to RFI interference, etc. I hope this helps. Take care.

    http://pdfserv.maxim-ic.com/en/an/AN504.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • MikeKMikeK Posts: 118
    edited 2009-08-22 20:01
    For what it's worth, the DS1307-based clocks I've built have been off by about 1 minute per month. They're built on perfboard, with no wires running near or under the crystal, but w/o the ground plane recommended by the app note.
    Mike
  • Tracy AllenTracy Allen Posts: 6,657
    edited 2009-08-22 22:31
    One could stick copper tape on top of the IC to make a ground plane, tied to the chip Vss. The main thing is to isolate the xtal leads from high speedI2C or SPI or CPU data lines.

    A big factor is the parabolic temperature coefficient of the 32kHz xtal. Without compensation the xtal slow down as the temperature moves much above an below the turn point, around 25 degrees C. Watches don't drift too much when worn on a wrist, because the body is a constant temperature oven. For extended temperature operation with better precision, there are real time clocks like the Dallas DS3232 and the DS32C35, which have the txco (temperature compensated crystal oscillator) built into the package A similar clock from Intersil is the ISL12020M, and from Microcrystal (division of Swatch) is the RV-3029-C2. I reproduce the temperature compensation graph from the latter, because it shows nicely the effect of compensation compared to the natural parabolic curve of the crystal.

    attachment.php?attachmentid=63120

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
    466 x 263 - 53K
Sign In or Register to comment.