cancel
Showing results for 
Search instead for 
Did you mean: 

RTC clock source

Moamen Ayman
Associate III
Posted on October 03, 2016 at 01:46

Hello, I'm a little confused about choosing the better clock source for the RTC, is it better to drive it through HSE with 4MHz 10ppm frequency tolerance or using additional 32.768KHz LSE with also 10ppm tolerance? do the two choice will cause same accuracy or when using LSE crystal is better with respect to resulted accuracy? 

thanks in advance

#clive1
7 REPLIES 7
Posted on October 03, 2016 at 02:45

Not sure which STM32 specifically you are targeting.

The LSE has the advantage that it will be run in low power mode, LSI typically doesn't.

If you aren't using power down modes, I'd probably lean towards using a 4 MHz TCXO on HSE, and have all my clocks synchronous, and stable across temperature variations.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Walid FTITI_O
Senior II
Posted on October 03, 2016 at 12:57

Hi ayman.moamen, 

To select the right oscilator to use on your STM32 platform, I recommend that you check the application note

http://www.st.com/content/ccc/resource/technical/document/application_note/c6/eb/5e/11/e3/69/43/eb/CD00221665.pdf/files/CD00221665.pdf/jcr:content/translations/en.CD00221665.pdf

''Oscillator design guide for STM8S, STM8Aand STM32 microcontrollers'' ( table5 for LSE and Table6 for HSE)

-Hannibal-
Moamen Ayman
Associate III
Posted on October 03, 2016 at 13:46

I'm using stm32f407vgt6 chip and I don't use low power mode in this design. Can I deduce from your answer that the frequency stability and accuracy are the same by either using HSE or LSE as long their tolerances specified in datasheet are same? and if the power is run out from VDD and the RTC then  will work depending on a coin battery, will the HSE still provide clock for the RTC module or at this moment I have to use LSE source?

Posted on October 03, 2016 at 15:03

ppm is a fraction of a percentage. As you divide down the variation gets physically smaller, but as a percentage it remains the same.

If powering from VBAT you'd have to use LSE to maintain time in the RTC

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Moamen Ayman
Associate III
Posted on October 03, 2016 at 19:33

I understand that ppm is percentage but I was asking about if synchronizing the whole system at a same clock is better or with RTC it doesn't matter.

Now I found those two crystals on digikey and I'm choosing between them for the LSE source:

1-first one has 5ppm tolerance, 5pf load capacitance

http://www.digikey.com/product-detail/en/citizen-finedevice-co-ltd/CFS-20632768HZFB/300-8763-ND/2217074

so by using formula provided by ST sheet, CL1&CL2 are 15pf and Rxet is 324KOhm (I assumed stray capacitance of PCB is 5pf as used in the sheet because I don't know how to calculate it)

2-second one has 20ppm tolerance, 6pf load capacitance

http://www.digikey.com/product-detail/en/epson/C-002RX-7680K-E:PBFREE/SER3205-ND/1022093

then CL1&CL2 are 2pf and Rxet is 2.43MOhm (I assumed stray capacitance of PCB is 5pf as used in the sheet because I don't know how to calculate it)

I know load capacitance affects the power consumption but if first one with 5pf wont significantly draw more power than second one with 6pf so I should use the first one which is more accurate (5ppm) known that I use coin battery(2032) for the RTC module. and could you please check the values I calculated for CL1&CL2 and Rext?

and is there a simple way to calculate thestray capacitance of PCB Cs?

I attached screen shoots for the formulas of calculating CL1&CL2 and Rext from ST sheet.

________________

Attachments :

external_resistance.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I11b&d=%2Fa%2F0X0000000bh4%2FqHAHUjuECZzypsi_7H2tFntQ7soStaIxR.3UZE.fM8s&asPdf=false

load_capacitance.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I11W&d=%2Fa%2F0X0000000bh0%2FYojSJOQcg8o6LKHu2Rvct0ihtOH4rM407W_gWiF4Kxk&asPdf=false

osillactor_circuit.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I11M&d=%2Fa%2F0X0000000bh1%2FqF060MWbxK7qAgS.qdXMdO5iu15oZY23eJA1Pi.MzQQ&asPdf=false
Moamen Ayman
Associate III
Posted on October 04, 2016 at 22:50

Posted on October 05, 2016 at 01:31

I can't take responsibility for specific part selections. You'll need to read the App Note, and review the schematic and BOM for the assorted STM32 DISCO, NUCLEO and EVAL boards.

I personally prefer to keep the number of clock sources to a minimum, as they will all diverge. I don't know how critical time is to your application, nor the cost and power trade-offs you have in play. Generally I recommend finding high-running parts (ie high volume, high spec, lower cost) from the vendor, these will typically be magic-number parts like 25 MHz Ethernet, 12 MHz USB, or 44 MHz WiFi type that might sell in the millions of units.

STM32 parts don't like 9 or 12pF LSE crystals, you want 6-7pF parts, the former are very prevalent.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..