cancel
Showing results for 
Search instead for 
Did you mean: 

RTC Oscillator not stable

FabianHladik
Associate II

Hello,

In one of our new PCBs we use a STM32L476VET6. For the RTC we use an external Oscillator (shown in the Picture)

FabianHladik_0-1731585469263.png

The drive power is set to the highest level.

In our setup, the RTC only works at room temperature and with no probe connected. As soon as the oscillator is heated up to 65°C, it stops working. Same behaviour with the freezer spray. When a Probe for the oscilloscope is connectet to OSC_32_IN, the Oscillator also stops.

We measured the frequency of the oscillator using the MCO-Output on PA8. This way we found out, that the frequency is within the specified range of the oscillator. When using a slightly higher load capacity the frequency drops out of the specified range. When the load capacitence is lowered (we tried 15pF) , the frequency rises higher than the specifiaction of the oscillator. This makes us certain, that the right load-capacitence is used.

We also tested the oscillation-safety-factor by adding a resistor, three times the ESR of the oscillator in series to it. This also works but only at room temperature.

We also repeated the tests on a new, untreated PCB with the same results.

This is the Layout:

FabianHladik_1-1731586045292.png

Note that there is a gound plane underneath the oscillator and the capacitors.

In an other project we used a STM32L4R5ZGT6 with the same oscillator and capacitor, the highest drive-level and a similar layout. The only difference is the processor. But with this setup, the oscillator can be heated up to 80°C and cooled with the freezer spray without the oscillator stopping.

Please help us find the problem.

Thanks in advance.

 

 

 

10 REPLIES 10
waclawek.jan
Super User

> Note that there is a gound plane underneath the oscillator and the capacitors.

Don't. Have a dedicated return from the capacitors to the GND (VSS) pin closest to XTAL pins. You can try this by drilling out the via or otherwise disconnecting the common area to which the capacitors are soldered, and patch in a short wire to that GND pin.

Read AN2867.

JW

Hi,
Here is the layout from our older project (using the STM32L4R5ZGT6)

FabianHladik_1-1731652794710.png

Gnd for the capacitors is also provided using a via to the GND layer. There is not even a GND-shield around the oscillator.  Still it is very stable (at least it doesnt stop oscillating when treated with heat or cold).

In the newer project (using the STM32L476VET6) the oscillation just stops when the temperature changes. When an oscilloscope is connected to the OSC32_OUT - pin the peak-peak voltage is approx 200mV. As soon as the oscillator is heated, the voltage starts to decline until it reaches 0 and the oscillator stops.

Maybe someone from ST can give us exact information, if there is any difference in the "internal schematic" of the low speed quarz of the STM32L4R5ZGT6, compared to the STM32L476VET6

Hi,

did you check: setting drive level high -> look in (debug, sfr ) whats real setting in rcc lsedrive (in rcc_bdcr).

(iirr Cube set wrong bits for drive level, but i dont remember cube version and cpu type. So just check..to be sure.)

 

AScha3_0-1731659150036.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Hi,

We checked, the drive-levle is HIGH with both bits on "1"

waclawek.jan
Super User

> When an oscilloscope is connected to the OSC32_OUT - pin the peak-peak voltage is approx 200mV.

What oscilloscope probe? Note, that standard probes significantly load the oscillator.

> Gnd for the capacitors is also provided using a via to the GND layer.

Have you tried to avoid this as I've recommended above?

JW

Elwood
Associate

We are having a very similar issue with the RTC on the STM32L462RET6. We don't see specific behavior changes at high or low temperature but the 32.768kHz crystal oscillator will stop periodically and we lose time. We have needed to use long term testing to catch the issue and while monitoring the LSCO output with a scope and we see a temporary "flat-line" when the oscillator stops. The STM32 is in shutdown mode while this is happening and our wakeup time is dependent on the RTC. When the crystal oscillator stops we lose time and wake up late (up to 1 hour behind in a 6-hour window in the worst case). We have tried different crystals with both 6pF and 12pF load capacitance. We have tried tuning the load caps to get as close as possible to our target frequency. We have changed the drive strength from Low to High in all increments. We plan to improve our GND scheme in the next layout iteration but I am not convinced that this will solve the problem. No matter what configuration we have tested, we always end up with an oscillator stopping, although some changes may affect the frequency of failure (i.e High Drive seems more reliable than Low). 

Were you able to solve this problem or determine the root cause? 

I definitively recommend following the layout recommendations of AN2867, especially keeping the ground return from capacitors separate from any other ground and connecting to the nearest VSS pin of the mcu; however, if you're redesigning hardware anyway, you may want to consider using an oscillator instead of plain crystal (by e.g. making space for it in the layout).

There have been reports of the LSE being sensitive to low (sub-0deg.C) temperatures, too, and although this is definitively something specific to individual families/models (given silicon layout/technology dependence), you may perhaps include that into your testing, too.

JW

Elwood
Associate

Thanks for the reply Jan, we are definitely following your logic. We have redesigned the layout with a ground keep-out under the crystal to minimize stray capacitance and an isolated ground return path to the MCU from the load caps. We also put in a population option for a powered oscillator which we have already prototyped and we have not seen any RTC stops or failures when using the dedicated oscillator. It is more expensive and less efficient to use an external oscillator, but it may be required for proper RTC operation.

I have provided details of our experiments to STM and am waiting for a response from them about this and will post here again if I learn anything from that.

I had exactly the same problem few years ago and it was solved successfully. First, there should be no ground or Vdd (or any other signal) plane in ANY layer under the crystal AND its connections to MCU pins. Second, set drive strength to high.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice