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!
2020-06-17 08:56 AM
Sounds like digital noise gets coupled into the oscillator, whatever the path is (I'd start with suspecting ground routing).
Have you tried to experiment with the oscillator drive strength (RCC_BDCR.LSEDRV)?
What is PCA?
JW
2020-06-17 10:16 AM
What you describe sounds like crosstalk on the OSC line pair picked up from other circuitry on the board. Check to make sure you have no traces running parallel to the OSC pair, and no traces cross underneath. Bring up your other peripherals one at a time, watching the RTC frequency to determine when the crosstalk occurs.
You have checked to make sure the capacitors are matched to the crystal? Do you have a load resistor on one of the OSC lines?
Jack Peacock
2020-06-17 10:41 AM
Thanks for the responses.
I have tried different drive strengths for the low frequency crystal. Did not seem to affect the operation except for a slight change in frequency - but everything was operating normally when I was testing drive strength. The PCA is a custom board for industrial controls equipment.
We did have trouble with this crystal originally with some boards not wanting to start up (oscillate). I had used a 10 pF load cap crystal, but apparently this CPU prefers a lower capacitance crystal. I wound up using the same crystal (6 pF load capacitance) and load caps (1.5 pF caps) as used on an eval board and have not had any trouble starting up since. I do NOT have a resistor in series with the crystal. Do I need one? The eval board I have did not have any resistance installed (0 ohm resistor).
Routing on the top of the board is clean, but there are other traces on other layers below the crystal (see pictures). I'll try to keep that area clear (all layers) on the next version and maybe put a ground pour on the layer just under the top layer.
2020-06-17 11:50 AM
I'd be more wary of the exact ground routing from the capacitors, keeping it separated from any digital ground and connecting it the shortest possible way to the nearest VSS pin.
JW
2020-06-17 11:59 AM
Yes, I'm starting to suspect I need to isolate the crystal more from surrounding traces. AN2867 recommends a separate ground plan under the crystal along with guard traces and I did not do that in this design.
2020-06-30 04:43 AM
Got more information on this. About 2.5% of the boards made have the problem of an unstable RTC frequency. Changing the 'H743 CPU fixed them (changing the crystal and cap's did not fix them).
After looking at the layout some more, I'm not convinced that the problem is caused by layout. The layer under the top layer is ground, so the crystal should be fairly well protected from other traces. I'm still going to try to improve the layout with guard traces and an isolated ground plane below the crystal, but the current layout would be considered good for most CPU's.
Can someone tell me what crystals/load caps/drive strengths they have used that seemed to work well on the H7 micros?
Although I am using a crystal and load cap's used in ST's eval board, maybe they are marginal for this CPU. If someone had a combination that worked well, I would rather use it than what I'm currently using. For reference, I'm currently using 1.5 pF load caps with a NX3215SA-32.768KHZ-EXS00A-MU00 crystal (6 pF load capacitance). The drive strength is set to high, but setting it to low did not fix the problem on boards with the jittery clock.
2020-06-30 09:15 AM
> Changing the 'H743 CPU fixed them
Today, I've fixed a problem (not 'H7 and not crystal/LSE related) by removing a mcu, washing the board beneath it and putting back the same mcu (read: removed soldering or PCB manufacturing residuum).
JW
2020-06-30 11:58 AM
> Changing the 'H743 CPU fixed them
Oh, and you are surely familiar with the Errata, namely 2.2.14 LSE oscillator driving capability selection bits are swapped, which pertains to rev.Y only.
JW
2020-06-30 12:35 PM
Thank you for the response!
We tried washing the problem boards, but it did not help. I'm using the TQFP package, so the pins are exposed and should be washable if there was residue around them.
Yes, I did read about the drive bits being wrong, but we are using high drive (0x11) so this would not be an issue for us. We also tried low drive settings, but it did not seem to make any difference with the boards that were misbehaving.
I've even gone through AN2867 - a very painful narrative on crystal selection that in the end does not help much except to recommend various part numbers that should be compatible with CPU families (how many out there have used an etalon crystal or tried to measure the current through a tiny surface mount crystal?). The suggested layouts were helpful too.
Instead of AN2867, all ST needs to do for a given CPU is to list crystal part numbers, nominal load capacitor values, and the recommended drive strength. That would save everyone a lot of trouble, especially with the finicky 32 KHz crystals.