OCXO Clock - Page 1
Forum section: electronics / projects

author: Ionforbes
author_rank: Contributor
timestamp: May 18, 2022, 09:13:17 pm
content: Just finished this personal project, thought I'd share. It's a clock based on an AOCJY 100MHz ovenised crystal, chosen since it was cheap NOS on eBay. Not much too it, the clock is divided with an ICS542 and three 4017 decade counters (74 series, they are fast enough if only just). Then an ATMega808 to count the pulses and run the display. I used four E10301s from Toyo, chosen for the rectangular segments which have a nice vintage aesthetic. Power supply is just a plain old linear one. The 3.3V supply isn't shown on the diagram but is just an LM1085.

author: CaptDon
author_rank: Super Contributor
timestamp: May 21, 2022, 12:53:15 am
content: Could have used a lower frequency crystal and saved some divider chips. A 1Mhz crystal OCXO rated 10PPM is no more accurate than a 100Mhz crystal OCXO rated 10PPM after you divide down to 1PPS. I think I would have just used one of those single I.C. single 32,768Hz crystal answers. I think you can even get the I.C. with the crystal on board.

author: KE5FX
author_rank: Super Contributor
timestamp: May 21, 2022, 01:15:44 am
content: My guess is that the ovenized 100 MHz Abracon will do better than most 32.768 kHz clock crystals.... granted that I haven't seen a lot of formal specs for 32 kHz rocks.That said, the sweet spot is traditionally 5 MHz. You can get better long-term stability from 5 MHz OCXOs than you can obtain from crystal oscillators at lower or higher frequencies. 10 MHz parts are now available that are basically just as good, but that's a fairly recent thing.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 21, 2022, 02:03:55 am
content: Quote from: KE5FX on May 21, 2022, 01:15:44 amNo kidding... it's ±30 ppb. Getting that kind of stability with just a crystal and a simple oscillator around it is not going to be possible.Of course, the OP can just cross fingers the part is genuine.The circuit could also be simplified using an integrated clock divider, although the OP's approach has the benefit of using only "jellybean" parts. Or using a small FPGA or CPLD to replace the dividers and the MCU.

author: KE5FX
author_rank: Super Contributor
timestamp: May 21, 2022, 03:56:41 am
content: Of course, the same reasoning ("There are too many divider stages, use a different oscillator, get a real CPU/FPGA") culminates in the inevitable conclusion, "Just order a cheap alarm clock from Amazon."SometimesUsually, making something from junk lying around the workbench is the goal in itself.

author: Someone
author_rank: Super Contributor
timestamp: May 21, 2022, 05:25:42 am
content: Quote from: KE5FX on May 21, 2022, 03:56:41 amWell yeah, but no effort seems to be made here at all to use what was available. That ATmega will take an external clock <= 20MHz. Prescaler + 16bit timer counter won't get to 1s directly without another stage or two, but neither has the OP explained wtf they are doing with the input on PD0.

author: Zero999
author_rank: Super Contributor
timestamp: May 21, 2022, 08:31:08 am
content: Quote from: Someone on May 21, 2022, 05:25:42 amAll that's required is a single 74AC4040 to get the 100MHz signal down to a frequency the ATmega can handle.

author: KE5FX
author_rank: Super Contributor
timestamp: May 21, 2022, 09:05:53 am
content: Quote from: Zero999 on May 21, 2022, 08:31:08 amA ripple counter?! They would throw you off the time-nuts list and ban your IP at the firewall.

author: Zero999
author_rank: Super Contributor
timestamp: May 21, 2022, 09:17:02 am
content: Quote from: KE5FX on May 21, 2022, 09:05:53 amGood point. It depends on whether you're bothered about jitter, of it's just long term stability which is important.

author: Someone
author_rank: Super Contributor
timestamp: May 21, 2022, 10:40:23 am
content: Quote from: KE5FX on May 21, 2022, 09:05:53 amPossibly, but many single chip counter topologies could get 100MHz down below the 20MHz the ATmega can use directly: ripple, synchronous binary, Johnson, binary decade , etc. From there to 1s is the "interesting" bit, don't know if there are any direct cascades in those particular ATmega model.Jitter don't matter when your output is a 7-segment display.

author: Someone
author_rank: Super Contributor
timestamp: May 21, 2022, 10:41:38 am
content: Quote from: Zero999 on May 21, 2022, 08:31:08 amIf you want to make it "easier" on the micro side then knocking some factors of 5 out of the 100MHz would be more productive than factors of 2.

author: jpb
author_rank: Super Contributor
timestamp: May 21, 2022, 12:25:31 pm
content: Some time ago I acquired a cheap VFOV405 ultra low power 16.384MHz OCXO from ebay with the idea of building it into a clock - I still hope to do so some day (one of several projects which are currently stacked up probably until I retire!)It is tiny (16 x 15.3 x 10 mm) and only draws about 0.17W (typical) during steady state. The output is also cmos which makes it convenient. At that frequency it is close to something a PIC could handle as a clock but is a nice power of 2 (500 x 32768Hz).

author: Ionforbes
author_rank: Contributor
timestamp: May 21, 2022, 02:04:09 pm
content: Quote from: CaptDon on May 21, 2022, 12:53:15 amIndeed, 100MHz is very fast, but it was £30 on eBay, a brand new one at a more manageable frequency would be much more expensive.Quote from: Someone on May 21, 2022, 05:25:42 amJust using thee external interrupt to count pulses until one second has passed. I'm not a very skilled programmer so reducing the frequency to something very low was the safer option.Quote from: Zero999 on May 21, 2022, 08:31:08 amHad I known this part existed. Plus I already had some 4017s on a tape.

author: Zero999
author_rank: Super Contributor
timestamp: May 21, 2022, 10:00:39 pm
content: Quote from: Someone on May 21, 2022, 10:41:38 amThe 74AC161/163 or 74VHC161/163 can be set to divide by 10 to give jitter free 10MHz.http://www.inf.furb.br/~maw/eletdigital/downloads/pdf/74161.pdfhttps://www.onsemi.com/pdf/datasheet/mc74ac161-d.pdf

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 22, 2022, 04:57:09 pm
content: Some 15 years ago I built a wall clock around an ATmega running from a regular 11.0592MHz crystal, and it synchronizes once a day with an DCF clock.First, the base frequency was off by quite a bit. Something in the neighborhood of 10 minutes per day.This was a surprise at first discovery, but the pierce Oscillator as used in uC's is not the best.https://en.wikipedia.org/wiki/Pierce_oscillatorSuch a static error is quite easy to correct for in software, but after that I still experience quite a lot of drift. It has a very noticeable temperature component in it, but it also depends on moon phases, planets alignment and unknown factors.In the end I'm quite happy with the project. I learned quite a lot about the limitations of cheap crystals.I could quite easily use an TCXO (About EUR 10 from Ali) and see how good they are (They claim 100ppb), but as it has been running like this for more then 10 years it probably does not have a high priority for me

author: edavid
author_rank: Super Contributor
timestamp: May 22, 2022, 05:27:33 pm
content: Nice project! I can't resist kibitzing though:1. I can't imagine not having minus setting buttons for hours and minutes. I hate having to go all the way around.2. I would use an enclosed fuseholder - especially considering you are in 230V land.3. Why run the CPU from 5V instead of 3.3V?4. The 4017s are 74HC4017s, right?5. Do you actually use the battery backup? If so, that must be quite a hefty NiCd pack. I don't see how the trickle charge resistor is going to work.

author: Ionforbes
author_rank: Contributor
timestamp: May 22, 2022, 05:47:06 pm
content: Good point, forgot to mention I omitted the battery when I realised I'd have to poke around inside while it's live in order to replace them. It's hard enough fumbling with AA holders, wouldn't want to do that centimetres from 240V! Yes they are 74HC4017s. And now that you mention it, I see no reason why I couldn't have runeverythingfrom 3.3VEdit: Here's a picture of it closed up