STM32L475 LSE crystal oscillator doesn't tune correctly - gmCrit value on datasheet is very low
Please help if you can, but please do me the courtesy of reading in full before replying:
We have a product using STM32L475 with a 32768Hz clock on the LSE. When I attempt to tune the crystal oscillator to within the performance spec of the crystal . I am unable to get the accuracy stated in the crystal datasheet. Either the crystal runs way too fast or it doesn't start reliably.
I am using app note AN2867 (Crystal oscillator design guide). The crystal is an Abracon ABS07-32.768KHZ-7-T : Cl =7pF, Cs =1.1pF, ESR=70k, +/-20ppm). Errors range from >150ppm (for CL1 =CL2 = 6.8pF) to > 250ppm (CL1=CL2=4.7pF).
If I increase the CL1, CL2 values I can improve on the accuracy, however, the oscillator fails to start reliably. Using the equation in section 4.2 of AN2867, with the crystal specs as mentioned above, I get a gmCrit value of 0.779uA/V, which, the AN states should be 5x lower than the STM32 gm value. Thus the gm value should be at least 3.9uA/V.
However, even if I select LSEDRV[1:0] = 11 (High drive capability), this only gives me 2.7uA/V. And I would prefer not to waste that much current.
You may say at this point, choose a better crystal. And I have looked, but to find a crystal with 20ppm (i'd have liked 10) accuracy and both low enough ESR and capacitance to make it work, is pretty hard. If we assume Cstray on the PCB plus the stray capacitance of the pin comes to more than 6pF already, the lowest we can go is a crystal with Cl of 6pF. And there aren't many that have lower ESR than 70kΩ.
So I looked at what the STM32L476 DISCO board uses. Surprise surprise, they use a cheap 12.5pF crystal , but, despite what AN2867 says, they are using 4.7pF capacitors with their cheap crystal, i.e. they are running their crystal very fast indeed.So they also haven't solved this.
Is there in fact ANY crystal that works well with the L4 range on the LSE? Or are there errors in AN2867 or my calculations? Because right now, the calculations seem to show there is a problem, and I am seeing that problem on the PCB. And before you ask, I have tested this on multiple boards, there is adequate shielding on the PCB around the crystal, no contamination (I clean after each soldering), and I am using a GPS disciplined oscillator to check the frequency measurement is spot on.
Please help!
