cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0x1 Accurate LSE Clocks

marcie
Associate
Posted on October 21, 2015 at 17:40

Hello!

We are trying to generate a clock signal around 1.024MHz.  We currently have a 32768 watch crystal connected up and are hoping to get at least the 0.5% accuracy as alluded to in the reference guide:

Multispeed internal RC oscillator (MSI), trimmable by software, able to generate 7 frequencies (65 kHz, 131 kHz, 262 kHz, 524 kHz, 1.05 MHz, 2.1 MHz, 4.2 MHz). When a 32.768 kHz clock source is available in the system (LSE), the MSI frequency can be trimmed by software down to a ±0.5% accuracy

However, we're currently seeing quite a lot of jitter on the 32kHz signal, even when it's routed directly out to TP1.  If we need to switch to a 32kHz crystal we can, we just need to understand where all the jitter is coming from.

Is there any 'gotcha' setting we need to look into in order to use the crystal to trim the frequency better?  Is it because we're trying to get to 1.024MHz with the watch crystal instead of the x16 value of 1.048MHz?

Thanks!
2 REPLIES 2
Posted on October 21, 2015 at 19:18

A random watch crystal, or one with known characteristics.

Many of the STM32 are very sensitive to the LSE design, requiring 6 pF crystals, not the 9-12 pF ones, they have supposedly changed some of the newer designs where you can configure higher drive currents. Probing the crystal directly will give problematic results. Always output a copy via MCO or TAMPER pins as appropriate for the chip.

If you're committing to using a crystal, why not just use one that's a multiple of 1.024 MHz (8.192 MHz?) to clock via HSE?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
marcie
Associate
Posted on October 21, 2015 at 19:28

This application is very sensitive to power consumption so using the HSE is not an option.

We were using one of the TAMPER outputs to measure the clock.