RTC crystals - tricks for getting this voodoo nonsense to work? - Page 1
Forum section: electronics / general

author: Howardlong
author_rank: Super Contributor
timestamp: December 19, 2016, 11:15:05 pm
content: I've never had a lot of luck with 32kHz crystals on either microcontrollers or standalone RTCs. When they oscillate first time it's largely been a bit of luck, whether or not I follow the reference design layouts and parts.This is not to be confused with the higher speed crystals in the MHz also commonly found on microcontrollers, which seem to be reasonably easy to get to work.Sometimes they start oscillating by poking the crystal pads with your finger or metal tweezers, sometimes they don't, or they stop oscillating when you wonder off. Sometimes they're unstable. Occasionally they work straight away (unusual). Well, after a second or so: it seems a second or so delay on start up is normal.I have used a method where I cut the track between oscillator input and the input load cap plus crystal, inject a synthesised 32kHz signal into the oscillator, tune the freq for max output amplitude, and then tune both the load caps for maximum smoke. I use a low capacitance probe, and correct for that after tuning.It usually works, but not always. Occasionally I just give up, as I have tonight with a PCF2123 RTC.Are there any other tricks folks use for getting RTC oscillators to work? I've read half a dozen app notes so far, but it seems a bit of a black art.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: December 19, 2016, 11:37:14 pm
content: Can't say I've ever had much of a problem on the few occasions I've used them.Definitely use a x100 probe, and even that will skew them a bit. Even when properly set up they can take a few seconds to start from powerup.Minimise capacitance across the 2 pins.A tip I got ages ago for xtals in general is they are happiest when the amplitude on both sides is similar.Don't try tuning frequency with the caps - just tweak for max reliability, do any minor adjustment in software, measuring from a digital output derived from the oscillator, not he osc pins themselves.

author: Howardlong
author_rank: Super Contributor
timestamp: December 20, 2016, 01:34:33 pm
content: Thanks for the replies. This is really about low frequency RTC crystals, in general I don't have many problems with MCU clock crystals. My recent experiences are mostly on several PIC24 secondary oscillators (there appear to be several versions judging by the differing config and OSCCON settings available), TI's CC3100 and CC3200 RTC and in the past couple of days the PCF2123.I suspect a lot of it is due to the inherent low power of these oscillators as RTCs are commonly sub microamp, with the PCF2123 I'm using being an impressive 100nA (even more impressive if I can get it to oscillate!). All of those I'm using are Pierce style oscillators, with using an on chip inverter (180 deg phase shift), the crystal and a pair of load crystals.As I understand it, the quoted crystal load capacitance should equal theseriestotal of the load caps (plus any parasitic capacitance). The one piece of good news about these low frequency crystals is that at least any parasitic inductance is going to be negligible.Supposedly, to start oscillating, on the PCF2123 it has an AGC which provides more loop gain when it's not oscillating in an attempt to start up. I can get it to oscillate if I apply some "finger parasitics", but it stops as soon as I remove said digit.A useful app note I'd already found washttp://ww1.microchip.com/downloads/en/AppNotes/00949a.pdfwhich covers how to probe and optimise the load caps.I did spend a bit of time over the weekend with Microchip's LCD Explorer board as that has an RTC using a crystal on the PIM riser board. However when I analysed it, although it works, it's incredibly jittery, so I strongly suspect it doesn't keep good time.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: December 20, 2016, 01:52:09 pm
content: Quote from: Howardlong on December 20, 2016, 01:34:33 pmOne data point - PIC24FJ64GA002http://www.digikey.com/product-detail/en/abracon-llc/ABS25-32.768KHZ-T/535-9166-2-ND/67536122pfThis has kept good time over several years.

author: CJay
author_rank: Super Contributor
timestamp: December 20, 2016, 02:39:11 pm
content: I'd definitely get rid of the load caps on crystal with the PCF2123 as it's got its own built in so as long as your PCB and crystal are suitable it should run.And there should be no need to touch the crystal to measure frequency as after power on reset the PCF2123 should output a buffered 32KHz on the CLKOUT pin until it's told not to by the application CPU's software configuration routines.

author: Howardlong
author_rank: Super Contributor
timestamp: December 20, 2016, 06:50:39 pm
content: OK, I got the PCF2123 working, I changed the crystal. Crystal p-p is only about 200mV.ABS07-32.768KHZ-7-T, Farnell part no. 1838935. The CLKOUT is pretty jittery but seems reasonable over time. It can also take a few of seconds to start up. Default part settings are 500nA, without any pullups or probes, all inputs held low. I guess I need to switch off a bunch of other bits and pieces like CLKOUT to see the headline figure of 100nA.