Fine tuning a crystal in code

Go To Last Post
97 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I’m thinking of making a clock (which would always be subject only to room temperature) using a 32.768 kHz xtal driving a counter. The xtal has 20 ppm frequency tolerance which I interpret as meaning my clock could be off by as much as (20/1,000,000) x (seconds in a year) seconds/year = 10 minutes and 30 seconds per year. If I measure my specific crystal’s deviation from the nominal frequency, to seven digits of precision (100 times better than 20/1,000,000), and use the difference as a correction factor in my code, will I achieve a corresponding increase in accuracy? What affects the frequency more, or even as much as, temp and age (an order of magnitude smaller effect than temperature, but I could correct for that, too, if necessary)? Anything else I’m missing? Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If the clock is AC powered, you get much better long-term accuracy counting ac cycles.   Otherwise, you'd have to calibrate your xtal counts very slightly or even "pull" the xtal..  I think temp & age are most important.  Capacitance trim & drive level, perhaps secondary.

 

https://www.semtech.com/uploads/documents/xo_precision_std.pdf

 

https://www.electro-tech-online.com/threads/xtal-frequency-accuracy.134608/

 

also:

 Humidity and pressure can have an even greater effect measured in parts per billion, but these environmental influences are easily overcome by hermetically sealed packaging for the crystal, either in a vacuum or with an inert gas such as nitrogen.

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:
I’m thinking of making a clock (which would always be subject only to room temperature) using a 32.768 kHz xtal driving a counter. The xtal has 20 ppm frequency tolerance which I interpret as meaning my clock could be off by as much as (20/1,000,000) x (seconds in a year) seconds/year = 10 minutes and 30 seconds per year. If I measure my specific crystal’s deviation from the nominal frequency, to seven digits of precision (100 times better than 20/1,000,000), and use the difference as a correction factor in my code, will I achieve a corresponding increase in accuracy?
 

Yes, it will be best right after you calibrate, of course....

 

lautman wrote:
What affects the frequency more, or even as much as, temp and age (an order of magnitude smaller effect than temperature, but I could correct for that, too, if necessary)? Anything else I’m missing? Thanks.

32kHz xtals have strong parabolic tempcos, but they usually centre on room temp, so if you measure temperature too, you can apply a table or calculated correction.

Xtals have something of a stress-memory effect, so what you get can be more related to the temperature swings over the last 24 hrs for example.

That means you cannot keep adding more and more digits, by better and better temperature sense ...  The TCXOs that are out there, give an indication of what you can get to, usually low single digit ppms

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Study the spec sheet for the watch crystal.
I would guess that a $0.05 crystal from Ebay has no part number.
.
My current Casio wristwatch gains several seconds in a month. Previous watches have been accurate within a few seconds in a YEAR.
.
Be realistic. 20ppm is not perfect. But I doubt if you will achieve 0.2ppm in the long term.
.
David. (who just corrects his wristwatch by comparing with my MSF wall clock)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:

...The xtal has 20 ppm frequency tolerance...If I measure my specific crystal’s deviation from the nominal frequency, to seven digits of precision ...will I achieve a corresponding increase in accuracy?

 

I'm sure you know this but, for the benefit of anyone else reading this topic, precision and accuracy are not the same thing. Precision is simply a measure of the number of digits used to measure something, but that measurement can still be in error (ie not accurate)

 

If you want absolute accuracy than buy a cheap GPS module with a 1pps output.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm doing a clock right now.

 

I'm adding a WiFi NTP'sync'ed ESP8266 to the M162 serial port (remember 3v3 level conversion).

 

With that setup i expect to be in the low 100ms offset , depending on if i use a "sync pin" from the ESP to the AVR , or just xmit the clockdata wo. "a sync strobe"

 

/Bingo

 

Clock on ebay  (I like the ones w. mostly green leds , and red for the 5,10,15,....)  - Mostly red is not good for me.

 

The MCU can easily be swapped w. a M8515 or M162(My choice) - You just need to invert the reset circuit  (Remove a cap , cut a track , move a resistor , and solder a wire)

https://www.ebay.com/itm/Assembl...

 

 

 

Edit: @OP

Maybe have a look here (maybe google xlate german to english) , danni explais the accurate second

https://www.mikrocontroller.net/...

 

 

Last Edited: Tue. May 21, 2019 - 11:33 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Anybody try tuning the 60KHz time signal? There used to be a module to receive it, but that seems to have vanished.

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

picked up one of these recently have not had time to explore it yet!

https://www.amazon.com/CANADUINO...

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Torby wrote:

Anybody try tuning the 60KHz time signal? There used to be a module to receive it, but that seems to have vanished.

 

I made one once but I found that the cheap receiver was not very sensitive and easily disturbed by electrical noise. In the end I resorted to syncing in the middle of the night when the signal was best.

 

To the OP's question, use a TCXO. You will spend so long faffing about with calibration and trying to implement the code it's not worth it. I know because I have done it. I had a calibration stage during PCB test, and then a temperature sensor sampled once a minute. The samples were exampled at the end of the day, the cumulative error calculated and a correction applied. It was okay but not as good as a TCXO.

 

You can get a TCXO for under a Euro.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mojo-chan wrote:
In the end I resorted to syncing in the middle of the night when the signal was best.

Yes, VLF propagation is best at night, as long as you are not experiencing night time thunderstorms.

 

For my clock, I used a GPS module and display the time received from it, it auto sets, so no buttons are required for setting just a switch for DST, or you can code for that too.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

mojo-chan wrote:

In the end I resorted to syncing in the middle of the night when the signal was best.

 

Yes, VLF propagation is best at night, as long as you are not experiencing night time thunderstorms.

 

For my clock, I used a GPS module and display the time received from it, it auto sets, so no buttons are required for setting just a switch for DST, or you can code for that too.

 

Jim

 

 

I find GPS reception indoors to be quite bad during the day too. It varies a lot, and of course helps if you have assistance like phones do. It's a shame because it would be ideal otherwise.

 

I tried RDS on FM as well, which works reasonably well but you have to be careful as some stations seem to have really inaccurate clocks. I want to try ESP32/NTP but everything ESP seems to be Arduino based - I just want something I can talk to with SPI, or write ARM code for.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When you consider that there are many MSF / WWV / DCF77 domestic wall clocks available in your local town,   they must get a reliable sync signal and run off a small battery.

 

I have always assumed that they attempt to sync at long intervals.   Once synced,  they operate as free running clocks.

The trick is to validate the signal.   Only synchronise on a good signal.   This means that your brand new clock takes a little while to "get started".    But once synced,  it only needs to get one valid signal in a 24 hour period.

 

I have made two MSF receivers (from kits).   The kits were more expensive than buying a ready-made wall clock that runs for 18 months on one AA cell.

And they had a worse performance !

 

David.

Last Edited: Tue. May 21, 2019 - 03:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 

 

WWVB kit here (quite pricey)

https://www.universal-solder.ca/...

 

 

Chronoverter  (Boost your reception by adding a local xmitter)  -  Legal aspects have been discussed on the timenuts mailinglist.

https://unusualelectronics.co.uk...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As a silly question:

 

U.S.A. is a big country.   One WWV transmitter will struggle to give good coverage.

 

Do you have reliable WWV kitchen Wall Clocks?

Or do you have to live in nearby states to get any reception?

 

MSF moved from Rugby to Cumbria.   i.e. 200 miles away instead of 100 miles from Wormshill.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

david.prentice wrote:

U.S.A. is a big country.   One WWV transmitter will struggle to give good coverage.

 

Do you have reliable WWV kitchen Wall Clocks?

 

Yes although I live in an adjacent state, (appx 650mi away), coverage at night covers most of North America from Ft Collins CO, but will vary by location.

 

Jim

the recent addition of phase modulation in addition to legacy AM modulation has improved reception ability.

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Tue. May 21, 2019 - 03:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
If the clock is AC powered,

It will be battery powered, so no AC, I'm afraid.

avrcandies wrote:
I think temp & age are most important. 

That Semtech article makes the point that even the form of the ageing effect varies so much from part to part that it can't even be modeled, which was news to me.  Apparently manufacturers of high-precision xtals deal with this by burning them in for months since ageing is most extreme in the early life of a xtal.  At least in their graph, it's only about +/- 3-4 ppm, so I'm just going to have to live with it.

avrcandies wrote:
but these environmental influences are easily overcome by hermetically sealed packaging for the crystal, either in a vacuum or with an inert gas such as nitrogen.

Overkill for this project.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
Be realistic. 20ppm is not perfect. But I doubt if you will achieve 0.2ppm in the long term.

Sure, but 2 ppm (~6 minutes/year) would be sufficient.  It looks like I might be able to get close, even without temperature compensation, assuming temperature doesn't swing too much in the anticipated office environment this will live in.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
If you want absolute accuracy than buy a cheap GPS module with a 1pps output.

Won't work in this battery-powered application.  Also, GPS access is spotty inside buildings and can't be depended on.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bingo600 wrote:
I'm adding a WiFi NTP'sync'ed ESP8266 to the M162 serial port (remember 3v3 level conversion).

Unfortunately, I'm battery-powered so frequent WiFi access is a no-go.  Even if it were power-feasible, I can't be sure I'll have WiFi access.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As I understand the OP, accuracy is not the goal, just the sync of all 4 units, so they show the same time.

That should be fairly easy to do using a clock sync protocol over a wired network.

See: https://en.wikipedia.org/wiki/Be...

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mojo-chan wrote:
use a TCXO.

Yeah, this is my backup.  I haven't thought that much about it yet as I'm still trying to figure out if I can get a regular xtal to work with sufficient accuracy.  The larger issue is I'm trying to keep this battery-powered AND have no physical interface (e.g. pushbuttons).  I'm leaning toward a Particle Photon or EPS8266, either of which would broadcast a hotspot and web page for five minutes after the battery is installed.  Configuration will be performed via the web page.  Then the radio shuts down and the processor sleeps until awakened by an RTC (ideally, one per minute) and updates the time variables and display (e-ink).  The advantage of the Photon over the ESP8266 is that it already has an RTC driven by its own 32.768 xtal.  This is the xtal I'd be trying to correct. 

 

If I go to a TCXO, that's an additional part (and cost), and I can't use it to drive a counter while the rest of the MCU sleeps (like an AVR) with either the Photon or an ESP8266.  So I'd need an RTC with a TCXO built in, capable of interrupting the MCU awake.  Maybe those exist, but, as I said, I haven't gone on the hunt yet.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

When you consider that there are many MSF / WWV / DCF77 domestic wall clocks available in your local town,   they must get a reliable sync signal and run off a small battery.

I've found signal reception for those things very hit-or-miss at various times and locations over the course of my life.  I have such a clock now and it seems to do OK, but figuring out how to implement it, and then implementing it, is another layer of complexity I'd prefer to avoid.  I know nothing about RF.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

RTC with a TCXO = DS3231

 

But notice (On your hunt for cheap's)

https://www.eevblog.com/forum/be...

https://blog.heypete.com/2017/09...

 

Edit: Seems like the M isn't totally useless

From
https://thecavepearlproject.org/...

 

Hi Edward! I note the caption for the photo at the top says “Stay away from the -M variant of this chip, as they are not temperature compensated.” and links to my site.

It appears I may have been unclear in my posting, so please allow me to clarify: the timekeeping functionality of the M variant of the DS3231 *is* temperature compensated (though at +/- 5ppm rather than +/- 2ppm for the crystal, non-M version).

The only thing that is *not* temperature compensated is the signal on the 32 kHz pin for reasons I don’t know. Internally, the timing circuits use the temperature compensated signal.

/Bingo

Last Edited: Tue. May 21, 2019 - 04:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
One WWV transmitter will struggle to give good coverage.
WWVB, WWVH for Hawai'i

IIRC, the ones of Japan have radio time for west Pacific; am guessing the coverage is some of APAC.

david.prentice wrote:
Do you have reliable WWV kitchen Wall Clocks?
Yes

david.prentice wrote:
Or do you have to live in nearby states to get any reception?
No though time of day does matter.

 


USA : Time and Frequency Services | NIST

 

edit : 

China, BPC, 68.5KHz

Japan, JJY, 40KHz and 60KHz

 

edit2 : RCC watches are reliable though range is highly variable (3 to 1)

What is the range ... | About WAVE CEPTOR / Atomic Timekeeping | WAVE CEPTOR, Atomic Timekeeping | Timepieces(Watches) | CASIO

via WVM60-9A - Wave Ceptor | Casio USA

other Casio watches have RCC

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. May 22, 2019 - 05:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

As I understand the OP, accuracy is not the goal, just the sync of all 4 units, so they show the same time.

Sorry if I've been unclear.  I'd like to achieve at least ~6 minutes/year accuracy, so accuracy to that degree is important.  I will be making a number (possibly as many as 100) of these clocks (for sale), but they won't be sync'd to one another.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Take a look

https://blog.heypete.com/2017/07/29/a-look-inside-the-ds3231-real-time-clock/

 

This is probably more than $1 ....but maybe next year??  

https://www.mouser.cn/datasheet/2/268/Microchip_CSAC_Datasheet_900-00744-000E-1592509.pdf

 

Its now "from" Microchip!!!??.....they should make it with a built-in AVR!!!!   I want to cook my bacon for 30.00000000 seconds. 

 

Digikey is out of stock & the price is slightly high

https://www.digikey.com/product-detail/en/microsemi-corporation/090-02984-001/090-02984-001-ND/6805273

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. May 21, 2019 - 05:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

This is probably more than $1 ....but maybe next year??  

file:///C:/Users/norm/Downloads/Microchip_CSAC_Datasheet_900-00744-000E.pdf

 

Can i request access to your C: fileshare , to read the DS wink

 

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

This is probably more than $1 ....but maybe next year??  

file:///C:/Users/norm/Downloads/Microchip_CSAC_Datasheet_900-00744-000E.pdf

A "file://" link is not going to work but I found a datasheet of the same name at this online location:  https://www.mouser.cn/datasheet/2/268/Microchip_CSAC_Datasheet_900-00744-000E-1592509.pdf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

.

Last Edited: Tue. May 21, 2019 - 04:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:
Also, GPS access is spotty inside buildings and can't be depended on.
GPS L2C should ease that issue within a few years; interim - GNSS instead of GPS might be a work-around.

GPS.gov: New Civil Signals

...

L2C broadcasts at a higher effective power than the legacy L1 C/A signal, making it easier to receive under trees and even indoors.

...

 

Fourth Civil Signal: L1C

...

The design will improve mobile GPS reception in cities and other challenging environments.

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Torby wrote:
There used to be a module to receive it, but that seems to have vanished.
Am no longer able to locate C-MAX at Digi-Key.

Technology - Advantage of the CME8000

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

in the anticipated office environment this will live in.

 

So, perhaps another option, if this is an office environment, but the clocks are positioned where no Mains power is easily accessible:

 

Simply have a Mains powered module that does have a GPS and then transmit your own time or time synch signal inside the building.

 

Would work if the Office setting has a window.

 

JC 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mojo-chan wrote:
I made one once but I found that the cheap receiver was not very sensitive and easily disturbed by electrical noise.
Radio time's AFE is simple and inexpensive; filtering can be done in the time or frequency domains.

Though the following uses a dsPIC33F's NCO, the same may be possible by a PIC's NCO as radio time DSP isn't that intensive :

(PDF) Inexpensive SDR-based longwave radio controlled clock for time dissemination in industrial wireless sensor networks

...

They [RCC, Radio Controlled Clock] also represent a lower-cost complement to GPS receivers, which offer better accuracy but do not allow indoor reception.

...

Interesting to notice, it [DCF77] uses both amplitude and phase modulation for maximizing time accuracy.

...

Unfortunately, the simple AM modulation with the small bandwidth available greatly suffers from external disturbances (including storms in the nearby of the transmitter) and it could be difficult to accurately detect the second mark in the time code, reducing the obtainable time accuracy at the receiver on the order of 0.1 s.

...

This choice [DCF77 PM] enables the use of a correlation receiver [7], which, despite its simplicity, mitigates inaccuracies in precisely detecting the second marker.

...

In this paper, a new architecture for wireless sensors is introduced, where the SDR paradigm is applied for sensor and radio signals, as shown in Figure 3. [Figure 3 - RCC AFE into MCU's ADC, data exchange AFE into MCU's ADC, sensor AFE into MCU's ADC]

...

This solution can be complemented by a local transmitter mimicking the DCF77 transmitter, in order to accommodate locations with bad or no reception at all.

...

In addition, there is also a small portion of the spectrum reserved for radio-amateur in the LF region (135.7-137.8 kHz in Europe) which only requires output power less than 1 W [no license?].

...

Figure 4 The (V)LF time transmitter disciplined by a GPS reference clock source.

...

 

A relatively inexpensive SDR that reaches through all radio time signals :

SDRplay RSP1A 1kHz - 2000Mhz Wideband SDR Receiver

The AFE in the SDR USB dongles is likely more than adequate for radio time.

 


8-bit PIC® and AVR® Microcontrollers - Brochure

 

edit : USD instead of GBP : RSP1A – SDRplay

 

edit2 : sounds 5-by-5 for approx 2800km by the precursor to RSP1A :

https://youtu.be/bgoj5k-44Xg (2m26s)

search is WWVB SDR

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. May 22, 2019 - 05:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
... and then transmit your own time or time synch signal inside the building.
That's what the dsPIC33F SDR WSN does on a amateur radio band (unlicensed?)

ISM is also available (no license though restricted ERP)

Bluetooth 5 with optional mesh links rooms in a building or structure; likewise with an internal PA to reach outside (campus that contains buildings and structures)

Topology Options | Bluetooth Technology Website

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:
I know nothing about RF.
That's easy and there are "cookbooks"; amazing what you can do with one low noise bipolar transistor and some R(L)C.

There'll be more effort in the decoding of phase modulation though all that's DSP (MCU source code, it's relatively simple)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


By the way, you can call the USA time standard at 303-499-7111 & listen to WWV live.

This number has been in use for at least 45 years...way back when I called it often (read about it in pop science mag), not knowing about long distance charges & our folks got a Huge phone bill. 

 

===

Wow the internet is pretty amazing... in 5 minutes I was able to locate the article I read back in March, 1973...they forgot to mention it cost $$$ to call every few hours

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. May 21, 2019 - 08:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:

mojo-chan wrote:
use a TCXO.

Yeah, this is my backup.  I haven't thought that much about it yet as I'm still trying to figure out if I can get a regular xtal to work with sufficient accuracy.  The larger issue is I'm trying to keep this battery-powered AND have no physical interface (e.g. pushbuttons).  I'm leaning toward a Particle Photon or EPS8266, either of which would broadcast a hotspot and web page for five minutes after the battery is installed.  Configuration will be performed via the web page.  Then the radio shuts down and the processor sleeps until awakened by an RTC (ideally, one per minute) and updates the time variables and display (e-ink).  The advantage of the Photon over the ESP8266 is that it already has an RTC driven by its own 32.768 xtal.  This is the xtal I'd be trying to correct. 

 

If I go to a TCXO, that's an additional part (and cost), and I can't use it to drive a counter while the rest of the MCU sleeps (like an AVR) with either the Photon or an ESP8266.  So I'd need an RTC with a TCXO built in, capable of interrupting the MCU awake.  Maybe those exist, but, as I said, I haven't gone on the hunt yet.

I guess it comes down to just how low power do you chase ?

parts like RV-3028-C7, are RTC, and claim an initially impressive 'Time accuracy: Factory calibrated to ±1 ppm @ 25°C'  but their focus is lowest (sub 1uA) power, so they have no Temp Correct.

They give –0.035*(T-T0)2 ppm ±10% as the parabola. Any temp correct is going to need to wake up, and run long enough to measure T and calculate the fix.

 

There are RTC.TCXO : 

Parts like  AB-RTCMK-32.768kHz, spec 3ppm initial and 5ppm over temp(max)

 

The larger RTC.TCXO 

Typical accuracy:
 PCF2129AT: 3 ppm from -15 C to +60 C
 PCF2129T: 3 ppm from -30 C to +80 C

 

They all seem to spec aging of around ±3ppm/year 

 

Addit: I see there is also 

https://www.microcrystal.com/en/products/real-time-clock-rtc/rv-8803-c7/

    • ±1.5 ppm 0 to +50°C
    • ±3.0 ppm -40 to +85°C
    • ±7.0 ppm +85 to +105°C
  • Low power consumption: 240 nA @ 3 V. (best in class)

 

and a different approach, could be to use a part like SIT1566AC-JV-18E-32.768E, which is ±3ppm max, & claims typ 1st year aging of ±1 ppm TA = 25°C, Vdd = 1.8V  (4.5μA No load)

feeding a 74AHC1G42xx tiny logic divider, (or a tiny MCU) to give 1 or 2 pps, that wakes up, or power ups, a host MCU.

 

Last Edited: Tue. May 21, 2019 - 11:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I built one.  I used a  mega8535, 32kHz Xtal, and its 'RTC' inputs.  From my experience:

 

a) As a clock, it sucked.  It lost about seven and a half seconds per DAY.  I had to write a calibration routine that, tested every odd hour, occasionally jumps from xx:00:14 to xx:00:16 without passing through :15.  See to it that whatever interface you use to set the clock can set the calibration too.

 

b) It's room-temp, but still wildly temperature sensitive.  However it seems to average out in this not-very-well controlled room.

 

c) Use a real RTC chip.  I won't build another clock without one.  Some RTC chips handle daylight savings time, some don't.  A once-per-second 'tick' output is standard.  RTC chips also do temperature compensation.

 

Mine is DC (wall-wart) powered, so I have no comment on efficiency (it also uses LED displays, which slurp down 20mA per segment!).  It's still on my desk now, actually.  With the cal routine (set to 7.5) it's plenty good enough to keep up with the computer's clock (from NTP).  It's always off by a few seconds, but I don't care much.  Overall, 7.5 seems a good calibration number, but I got there by poking at it over the course of weeks watching it gain and lose.  I imagine a different Xtal would need a different number.

 

Have fun!  I like my little dual clock/timer (two displays, two MCUs, one crystal.  One provides the 'second' tick to the other (and a double-tick when the cal fires!)).  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I genuinely appreciate the effort, but they won't all be in the same building.  One clock/person/building.  The people won't know each other and will be unrelated.  Think of random people going to Amazon and buying an example of the same clock.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Scroungre wrote:
I built one.  I used a  mega8535, 32kHz Xtal, and its 'RTC' inputs. 

Thanks for sharing your experience.  Did you happen to use a frequency counter to measure the difference between nominal and actual frequency, or did you just run the clock for long periods and note the drift?  I have a 9-digit frequency counter and was hoping I could measure the difference (at room temperature anyway) accurately enough to correct for most of the error.  If there's too much temperature sensitivity, though, that may not matter.  I'll only be displaying hours and minutes, so adding or subtracting a few seconds/day shouldn't

cause the time jump around.

 

I'm currently thinking about the Photon and its built-in RTC or an ESP8266 and a DS3231 (higher integration + higher cost + lower accuracy vs. the opposite).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who-me wrote:
I guess it comes down to just how low power do you chase ?

Jeez, Who-me!  Thanks for all the research!  You're embarrassing me.  ;-)  I really like the Micro Crystal RV-8803 except for the funky package.  Trying to track down a breakout board but no luck so far.  I can always design one myself if necessary.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:

Who-me wrote:
I guess it comes down to just how low power do you chase ?

Jeez, Who-me!  Thanks for all the research!  You're embarrassing me.  ;-)  I really like the Micro Crystal RV-8803 except for the funky package.  Trying to track down a breakout board but no luck so far.  I can always design one myself if necessary.

:) 

Arrow shows this

https://www.arrow.com/en/products/rv-8803-c7-on-board-32.768khz-3ppm-ta-qc/micro-crystal-ag

 

or, you can experiment with a 'dead bug' assembly, using a single strand from eg ribbon cable as a 'bond wire' per pad.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:

Scroungre wrote:

I built one.  I used a  mega8535, 32kHz Xtal, and its 'RTC' inputs. 

 

Thanks for sharing your experience.  Did you happen to use a frequency counter to measure the difference between nominal and actual frequency, or did you just run the clock for long periods and note the drift?

 

I ran it and watched.  I had plenty of time.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not sure what that Arrow thing is, but Mouser has an eval board (maybe it's the same as the Arrow thing).  The board's only $15 so I'll get one.  As for the dead bug approach, way too small a part for my ability.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:

... I have a 9-digit frequency counter and was hoping I could measure the difference (at room temperature anyway) accurately enough to correct for most of the error. 

That should be fine, if it is a reciprocal counter (most 9 digit ones will be?)

I'd suggest measure both GPS 1pps and your 32KHz divided CLKOUT, so you remove the counter timebase tolerance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:

Not sure what that Arrow thing is, but Mouser has an eval board (maybe it's the same as the Arrow thing).  The board's only $15 so I'll get one.  As for the dead bug approach, way too small a part for my ability.

Sounds good. Its cheaper than Arrow, and maybe you could get two, so you can temperature vary one, and compare how it corrects / responds ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who-me wrote:

That should be fine, if it is a reciprocal counter (most 9 digit ones will be?)

I'd suggest measure both GPS 1pps and your 32KHz divided CLKOUT, so you remove the counter timebase tolerance.

I don't know what a reciprocal counter is, but mine can display frequency or period.  Not sure what you're getting at with the timebase tolerance, but I don't have a GPS source anyway.  I'm sure just measuring the TCXO with the counter will provide enough validation.  It has to be way better than the uncompensated RTC on the Photon (though I'll be checking it, too).  1.5 ppm at 0-50C (no normal room is going to fluctuate that much) is only 47 seconds/year, and that's worst case.  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:

Who-me wrote:

That should be fine, if it is a reciprocal counter (most 9 digit ones will be?)

I'd suggest measure both GPS 1pps and your 32KHz divided CLKOUT, so you remove the counter timebase tolerance.

I don't know what a reciprocal counter is, but mine can display frequency or period. 

If it displays 100.002235Hz  then it is a reciprocal counter, which just means it measures whole cycles, in some (> Gate time), and then does Cycles/dT to get Cycles/Second

 

 

lautman wrote:

Not sure what you're getting at with the timebase tolerance, but I don't have a GPS source anyway. 

GPS modules are not expensive, and they do give you a known reference, otherwise, you merely hope your counter timebase (Crystal/TCXO/OCXO?) is correct.

eg a GPS unit here says my Reciprocal counter is about 1.6ppm high

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who-me wrote:
If it displays 100.002235Hz  then it is a reciprocal counter, which just means it measures whole cycles, in some (> Gate time), and then does Cycles/dT to get Cycles/Second

It's a reciprocal counter.

 

Who-me wrote:
GPS modules are not expensive,

Any you recommend?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The "challenge" w. GPS , is that indoor reception can be very difficult.

 

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That’s more of an issue for someone randomly placing a clock. In this instance, the GPS would be used in a lab to drive a frequency counter, so care could be taken to place the antenna somewhere it gets an adequate signal, e.g. on a window or even outside if the cable can be so routed.

Pages