2020-06-17 07:54 AM
Have several boards with problems keeping time accurately. We calibrate each board in factory test, but some boards have very large errors in the 1 Hz calibration signal and very jittery frequency readings. To make it more interesting, when there is less activity on the PCA the calibration clock output tends to stabilize at a frequency that can be calibrated.
We have tried changing the 32 KHz crystal and load cap's, but that does not seem to have any effect. Boards that exhibit this problem can loose several minutes of time in 24 hours - not acceptable for a modern clock!
Clues:
Anyone have any ideas what we can try to get around this problem? Thanks for any advice here!
2021-07-20 08:45 AM
Those unconnected guard track ends are not ideal but I don't see a problem with them and they may be a good thing. A solid 0V plane under the crystal and the 0V the first inner layer below it should have been okay comparing with what Franck has done. But just an aperture in the power planes beneath the crystal's own plane is often recommended, but I do not think you need to do that. The significant thing is that I do not see an 0V connection to the crystal.
That does not give you anything clearer.
2021-07-20 09:10 AM
Hi JOwen,
Yeah, 20% error seems crazy. I am even surprised that your oscillator starts.
Maybe you want to check the software side:
hrtc.Init.AsynchPrediv = 127;
hrtc.Init.SynchPrediv = 255;
2021-07-20 09:18 AM
Hi Andrew,
Sure I would have preferred the oscillator closer to the pins (was not possible in this case). On this layout, the length of the track between the oscillator and MCU pins is 20mm.
But remember that it is a 32kHz oscillator, so not as critical as a 20Mhz oscillator.
And yes, you can use those pictures on your blog without restriction.
2021-07-20 09:56 AM
Ha! I know! But it is the same software that gave about 1 Hz with a 6 pF cap and 1.5 pf load capacitors.
2021-07-20 10:01 AM
2021-07-20 12:21 PM
> This is really a moot point at this time, I've already added an external RTC to get a reliable clock.
But you are still annoyed by the problem, aren't you? Otherwise you wouldn't perform that experiment today morning... ;)
Hardware appears to be as good as it gets at this point. The "repair by changing chip" still sounds strange. This is a new info, though:
> I have a 2.2uF and a 0.01 uF cap on VBATT by the CPU. VBATT comes from a 2032 battery through a diode and 1K resistor.
"Changing chip" may have the "side effect" of resetting the backup domain, so the question is, whether you attempted to reset the backup domain on the "faulty" boards/chips beforehand, and/or checked/read out the related RCC and RTC registers' content. The idea is, that there are interconnections in the backup domain registers, e.g. after [inadvertently] setting incorrect LSE drive or RTC clock source, there may be some reason that it can't be undone/changed until a backup domain reset.
JW
2021-07-20 01:28 PM
Thanks for the explanation on the smt part.
2021-07-21 05:12 AM
I have not tried to reset the backup domain registers directly. Our code probably sets them up on boot. Except for drive strength, I was not aware of any other register settings that would affect the basic frequency of the RTC. By the way, I tried different drive settings. Different drive strength settings caused a slight shift in frequency, but over all there was not much difference or improvement to the problems I've been seeing.
2022-09-03 12:19 AM
I just noticed something in one of the app notes that could support this theory. Apparently changing the drive level requires stopping the LSE starting with Rev V, so tests of different drive levels will be invalid if they do not involve explicitly stopping the LSE, resetting the backup domain, or removing the battery.
The errata does not mention this and the reference manual says that you can change it on the fly (at least in some limited cases).
RM0433: "The driving capability can be changed dynamically from high drive to medium high drive, and then to medium low drive."
AN5312: "On RevV the driving capability cannot be changed when the LSE oscillator is ON."
The CubeMX generated initialization code just sets the drive level at every startup, so it will be ineffective if a prior program already started the LSE. It may not even be possible to reliably determine the current drive level if the write updates the register but not the actual drive level. (Update: Tried it; fortunately the write does not change the register in that case)
FWIW, my initial tests on one board did not reveal any problems with STM32H753ZI, medium-high drive, either ECS-.327-7-12R-TR or CM8V-T1A-32.768KHZ-7PF-20PPM-TA-QC, and 4.7 pF caps.