Shop OBEX P1 Docs P2 Docs Learn Events
internal clock accuracy? — Parallax Forums

internal clock accuracy?

Hey guys,
I'm planning to build a digital clock with the propeller. It's gonna have a real-time clock and everything.
I've read in the forums that an external crystal provides greater accuracy. However, I just want to use the internal clock if I can.
Will it be okay if I just use the less-accurate internal crystal for my clock? Or is accuracy a huge deciding factor in my project?
Also, if I have to use an external crystal, do I need capacitors? I've played with arduinos a lot and they all require 22pf caps for the external crystal. However, most of the schematics for the propeller I've seen on google don't have caps for the external clock.

TL;DR: Is the internal crystal okay for time-critical projects, like a digital clock? Do I need capacitors for an external crystal?

THANKS!!!

Comments

  • kwinnkwinn Posts: 8,697
    The internal oscillator for the propeller is an RC circuit, not a crystal, so not very accurate. In a stable temperature environment it might be accurate enough to keep reasonably accurate time ( +- a few minutes per month ) if the calibration ( clock cycles per second ) was averaged over a long period of time.
    If you were powering the clock from the AC line rather than a battery you could always use that as the timekeeping signal.
  • You say, "gonna have a real-time clock...." By that, do you mean an actual RTC chip? If so, it will set the system accuracy.
  • You don't need external capacitors for an external crystal. The Propeller provides the capacitance. Look at the description of the XTAL1, XTAL2, and XTAL3 constants in the Propeller Manual for details (page 29). The crystal is usually calibrated for a specific capacitance value.
  • You say, "gonna have a real-time clock...." By that, do you mean an actual RTC chip? If so, it will set the system accuracy.

    Yeah, an RTC chip. I will use the DS1307 and a 32kHz crystal. Sorry, but what do you mean by "it will set the system accuracy?"
  • pico wrote:
    Sorry, but what do you mean by "it will set the system accuracy?
    The accuracy of your clock will depend upon the accuracy of the RTC's 32 kHz crystal, not on the Prop's internal RC oscillator.

    -Phil
  • jmgjmg Posts: 15,145
    pico wrote: »
    Yeah, an RTC chip. I will use the DS1307 and a 32kHz crystal. Sorry, but what do you mean by "it will set the system accuracy?"
    If you have a 32kHz crystal, you do not need to have a Prop Xtal too, but unless you plan huge volumes of this, why skip the Prop Xtal ?

    The cheapest RTC's do not have temperature compensation, so with a Prop Xtal, you can use one crystal to check the other.
    The RTC uses Cap/Battery to keep time across power outages, and the Prop Xtal is enabled frequently to re-calibrate.

    If you calibrate after assembly using a GPS 1pps, you are then down to the aging drift and ambient temperature changes.

    What display do you plan ?

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2018-01-14 19:29
    jmg wrote:
    so with a Prop Xtal, you can use one crystal to check the other.
    That could be like the blind leading the blind! I've seen cases where the Prop's crystal frequency has to be fudged a bit to eliminate the "creepy crawlies" in a video signal, due to the crystal being off a bit.

    So you have to decide, "How good is good enough?" For the best accuracy, eliminate the RTC and add a GPS module -- assuming you get reception where the system will operate.

    -Phil
  • jmgjmg Posts: 15,145
    jmg wrote:
    so with a Prop Xtal, you can use one crystal to check the other.
    That could be like the blind leading the blind! I've seen cases where the Prop's crystal frequency has to be fudged a bit to eliminate the "creepy crawlies" in a video signal, due to the crystal being off a bit.
    Of course, that's why you calibrate using GPS, to correct for zero offsets. You can take tens-of-ppm down to tempco-ppm levels.

    That leaves Crystal temperature curves, like

    AT-CUT :
    attempcurve2.gif

    and 32kHz xtals, are much worse over full range, but possibly tolerable over a narrow temperature band...
    d-5.jpg

    and nice plots here
    https://vectronblog.com/2017/03/31/when-is-a-crystal-not-a-crystal-tuning-forks/


    Has anyone plotted Prop RC stability with temperature, to use that as a low cost temperature sense ?
  • jmg wrote:
    and 32kHz xtals, are much worse over full range, but possibly tolerable over a narrow temperature band...
    That's why digital wristwatches are so accurate. Body temp moderates any other variations they might be sensitive to.

    -Phil
  • Cluso99Cluso99 Posts: 18,069
    Why use an RTC chip as well as a prop?

    Just use a COG to do the RTC. For this, you will need a good xtal (no caps reqd) on the prop. Don't forget to connect all power and all ground pins, and bypass capacitors at each power/ground pair. That is 2 pairs for a DIP, 4 pairs for the QFP chip.
  • jmgjmg Posts: 15,145
    edited 2018-01-15 02:48
    Cluso99 wrote: »
    Why use an RTC chip as well as a prop?

    Possible reasons would be
    * Time keeping over power interrupt / outages
    * Lower total system power

    but if neither of those matter to the OP, then yes, they could skip the RTC and use the Prop, with Xtal.

    Addit: I see Mouser has ±10ppm Tolerance ±10ppm Frequency Stability Crystals, showing as new, in HC49/4H packages. Stock of 4MHz which would give lower Icc than 5MHz
  • Wow, thanks guys! I've joined the parallax community just about a week ago and the help you guys give me is tremendous. Thank you all.
    Your replies all helped me a lot!
  • jmg wrote:
    and 32kHz xtals, are much worse over full range, but possibly tolerable over a narrow temperature band...
    That's why digital wristwatches are so accurate. Body temp moderates any other variations they might be sensitive to.

    -Phil

    Except they get removed at night, the body core temperature is regulated, not the extremities, and watches are cooled by the surroundings as well as heated by the arm!
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2018-01-16 23:58
    The SiT1566 offers +/- 3ppm in a 32768Hz TCXO MEMs oscillator in a tiny (1.5mm x 0.8mm!) package. I haven't tried that yet.

    One that I've actually used as a reference for a crystal-less gadget operating from a CR2032 is the Abracon ASTMK0.001KHZ, also MEMs and small, but not microscopic, it has an frequency curve comparable to a tuning fork crystal and a convenient 1Hz output for referencing the Prop RC modes.
    495 x 435 - 108K
    522 x 399 - 55K
Sign In or Register to comment.