2025-08-04 1:24 AM
I tried to use internal RTC with LSE clocking in device which has GSM/GPRS module (GSM part decoupled from MCU part by ferrite beads in power lines and resistors in data lines). In first PCB revision (no separate ground region under crystal) I noticed significant RTC slowdown at GPRS transactions (0.2-0.4 seconds at each GPRS data transaction, when I soldered wires to GSM part ground and VCC pads - clock slowdown is increased). I've fixed board layout according to design recommendations (separate ground regions, ground traces around quarts lines, extra ferrite bead in CPU power line) but it doesn't affect clock instability at all.
Vcc is decoupled to ground after ferrite bead by 22pF and 100nF capacitors, before ferrite bead there's a 100uF tantalum capacitor after LDO. Vbat is decoupled by 100nF capacitor and 2x22pF capacitors (there are places for different external RTC modules). Quartz is one with 12.5pF load, load capacitors are 22pF each (I experimented with smaller values - nothing was changed). Driving strength is set to high. PC13 is set as output, low level.
Here's piece of board with quartz, power and Vbat lines. X10 is place for ground shield (shielding doesn't change anything on earlier board prototype).
What's wrong with it? Is there any option to make it stable in high-EMI environment? when I've tested older board revision, there was clock slowdown even when device's GSM module was switched off but there was a second such device with GSM placed in 10-20cm near it.
External RTC MEMS module will be a good solution, but I expected to use internal one...
2025-08-04 11:22 AM - edited 2025-08-04 11:24 AM
> It would be odd for LSE to be intermittent.
I wouldn't be that surprised to see the oscillator to fail and restart.
> clock scope trace
That would require an active scope probe, should LSE be probed directly; or LSE be output at a LSCO pin. Other indirect methods may be available, too, but not that convincing perhaps.
Nonetheless, probing the circuit may change its behaviour, too, if it's radiated EMI.
> something else concrete
Do you suspect this?
>> and once per hour synchronize time with NTP
(perhaps together with some bug making it not just "once per hour"?)
JW
2025-08-04 11:12 PM - edited 2025-08-04 11:17 PM
>(perhaps together with some bug making it not just "once per hour"?)
it's actually once per hour. I've logged current time (each 10 seconds) and time sync events to UART. also when I noticed clock troubles there was no periodic NTP sync, just initial one at GPRS connect - I've implemented it later as quick solution for fixing time drift.
Also, as I said, when only CPU part is powered, and GSM part is completely off (so no NTP sync or other GSM activity is present) - there are also troubles when other same device is working near tested one. and clock troubles disappeared when I switched off other device.
2025-08-05 12:08 AM
Here's example chart. dots - clock deviation compared to PC system clock; green lines - interaction with GSM module (AT commands and GPRS data transmission), red line (among bunch of green lines) - initial clock sync.
2025-08-10 9:43 AM
As I expected RX8130CE and MAX31343ETAY external RTCs work perfectly with near-zero time drift (less than 1 second per hour; they have no centiseconds so I can't tell real clock drift). It's an enough cheap solution - but I confused that internal RTC/LSE is so sensitive for EMI...
So I have a question: is LSE from other STM32 MCU series have same high sensitivity for EMI, or it's bug of STM32G0 series (and possibly some others with similar LSE schematic)?
2025-08-10 10:03 AM
I can't tell about LSE sensitivity to GSM signal, but also the ADC is disturbed by nearby RF, we had problems with Wi-Fi transmission on same board, so we removed it, to get good ADC values.
Maybe same with RTC, as there is no level or sensitivity given in ds.
I just assume, drive level of most separate RTC chips is higher and so less sensitive to any RF.
I decided just to use crystal oscillators for HSE and LSE, to get rid of the problems with crystal drive level etc.
Or a separate RTC chip, as you have now.
2025-08-10 11:45 AM
What LSE are you using? Does it line up with the recommendations?
How to select a compatible crystal and load capaci... - STMicroelectronics Community
2025-08-11 12:28 AM
I used Strong SM146-32.768K-12.5-20-E, it's gm crit is near 1.7 uA/V. I tried some other crystals with same effect.