2016-10-02 04:46 PM
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 #clive12016-10-02 05:45 PM
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.2016-10-03 03:57 AM
Hi ayman.moamen,
To select the right oscilator to use on your STM32 platform, I recommend that you check the application note ''Oscillator design guide for STM8S, STM8Aand STM32 microcontrollers'' ( table5 for LSE and Table6 for HSE)-Hannibal-2016-10-03 04:46 AM
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?
2016-10-03 06:03 AM
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 RTC2016-10-03 10:33 AM
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=falseload_capacitance.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I11W&d=%2Fa%2F0X0000000bh0%2FYojSJOQcg8o6LKHu2Rvct0ihtOH4rM407W_gWiF4Kxk&asPdf=falseosillactor_circuit.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I11M&d=%2Fa%2F0X0000000bh1%2FqF060MWbxK7qAgS.qdXMdO5iu15oZY23eJA1Pi.MzQQ&asPdf=false2016-10-04 01:50 PM
2016-10-04 04:31 PM
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.