cancel
Showing results for 
Search instead for 
Did you mean: 

LSE crystal doesn't work on low temperatures

oscargomezf
Associate II
Posted on June 26, 2018 at 10:03

Hi everyone,

I'm working on an STM32F1 platform. I have a problem with the LSE crystal. I'm using this one ABS07-120-32.768kHz-T by Abracon. The problem is with temperatures below 5�C. I made some calculations according to the Application Note AN2867:

According to the  datasheet ABS07-120-32.768kHz-T:

C0=1.20pF, ESR=55kohm (Max 60kohm), CL= 6pF and F= 32.768KHz

And according to the datasheet (page 62/136) del STM32F103RF:

gm = 5uA/V

gmcrit = 4 * ESR * (2?F)^2 * (C0 + CL)^2 = 4 * 60000*(2 * pi * 32768)^2 * (1.2*10^(-12) + 6 *10^(-12) )^2 = 0.0000005273947973 A/V = 0.5273947973 uA/V

gain margin = gm/gmcrit = 5 / 0.5273947973 = 9.48 (60k)

So we meet that the gain margin = gm / gm_crit >= 5.

Considering Cin=Cout=3pF (STM32 processor), CSTRAY=1pF, C1=C2=x and CL=6pF, we get C1=C2:

CL = (Cin + C1)*(C2 + Cout)/(Cin + C1 + C2 + Cout) + CSTRAY

6 = (3 + x)*(3 + x)/(6 + 2*x) + 1

x=7pF

C1=C2=6.8pF

So I think that the selection of the crystal and C1/C2 is right, but when I tried to init the platform inside a thermal chamber the crystal it seems to be that it wasn't able to oscillate because I was checking this function and it's blocked in the while:

while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)

Does anyone help me out?

Best regards.

#lse-startup #stm32f1-clock
21 REPLIES 21
AvaTar
Lead
Posted on June 26, 2018 at 10:19

I'm not a hardware guy, but what temperatures are you talking about ?

Are they covered by the LSE crystal's datasheet, i.e. are you within guaranteed limits ?

I was checking this function and it's blocked in the while:

while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)

You could consider a fall-back to LSI, perhaps checking the die temperature.

Posted on June 26, 2018 at 10:33

while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)

 It's startup of the LSE oscillator, right?

Try to use a longer timeout. It's not unusual for the LSE to start tens of seconds - I wouldn't shy to be use several minutes as timeout. The chamber might serve as a Faraday cage, screening off electromagnetic noise, which helps the oscillator startup.

JW

Posted on June 26, 2018 at 10:51

Hi AvaTar,

The problems began with temperatures below 5ºC.

I can't use the LSI because I need as much precision as possible. I'm using the RTC.

Posted on June 26, 2018 at 10:56

Hi waclawek.jan,

1. According to: ' It's startup of the LSE oscillator, right? Try to use a longer timeout. It's not unusual for the LSE to start tens of seconds - I wouldn't shy to be use several minutes as timeout.'

I dind't understand you. I'm waiting in the loop in an infinite way.

2.The chamber might serve as a Faraday cage, screening off electromagnetic noise, which helps the oscillator startup.

I've opened the chamber and take out the PCB to normal temperature environment and it took a long time to start working again

Posted on June 26, 2018 at 11:03

I can't use the LSI because I need as much precision as possible. I'm using the RTC.

I know.

But your firmware needs to deal with such issues, usually called 'rainy day scenarios'.

You can either:

 - throw the game away

 - run with reduced accuracy

 - try to get a crystal / design that works at that temperatures

 - the 'Radio oscillator' method

The latter is to put the device in a thermically isolated box, and heat it up to, say, 20°C. Better RF receivers and transmitters keep their oscillator frequency stable that way.

Posted on June 26, 2018 at 11:33

Hi AvaTar,

You're right. I only want to try to understand If I did all the calculations 

in a proper way, 

because I think that the fact to be up to 5ºC, it isn't too cold to don't work.
Posted on June 26, 2018 at 12:02

And if the chamber is not cooled (i.e. it's room temperature inside), and you place the PCB inside it, will it start?

JW

[EDIT] Another thing to try is to start the oscillator at room temperature and then - while running - cool it down. Will it stop?

What I am trying to tell is that startup and stable run are two separate issues. Crystals are electromechanical and sure temperature influences their properties - and temperature influences also properties of capacitors, and also the gain of the amplifier in the STM32 - and this may not be captured by two or three parameters (numbers) completely. As Avatar said, you might want to experiment with different manufacturers/crystals.

Posted on June 26, 2018 at 12:10

As said, I am missing the experience to assess the issue, I am more of a software guy.

Might be the design, the quartz, or tolerances. Even ceramic caps have temperature drifts, perhaps other types help. I remember that RF oscillator design includes careful selection of NTC and PTC components, to avoid/minimize drift.

Danish1
Lead II
Posted on June 26, 2018 at 21:43

I typically guess 5 pF for the stray capacitance, even with a fairly tight pcb layout. Where did you get your 1 pF from? What is the total length of pcb trace from each processor pin to the crystal in mm?

I note AN2867 suggests calculating the correct stray-capacitance from the frequency-error when you put 'any-old-capacitor' in the circuit. I don't believe that works in practice because the crystal centre-frequency has a tolerance and the next crystal off the production-line might be out in the opposite direction!

AvaTar said:

I remember that RF oscillator design includes careful selection of NTC and PTC components, to avoid/minimize drift.

The cut of the crystal will be such as to minimise frequency drift over the rated frequency-range (when loaded with the right capacitance). And the capacitors of a few pF should be ceramic C0G / NP0 with little or no change in capacitance over temperature.

 - Danish