How to set STM32F051K8 custom board HSE with RTC?
- May 5, 2020
- 2 replies
- 1243 views
Hi,
I've developed a custom PCB for STM32F051K8 connected to an external crystal oscillator (8Mhz - nx3225gd from NDK). I think I have set everything correct on CubeMX and managed to get a working firmware going. I set up a 100Hz timer for ADC through setting system clock source to HSE on CubeMx, and the ADC timing seems to be correct (1000 samples take roughly 10 seconds).
My issue is that when I try to clock the RTC with the HSE, the timing seems to be consistently off by a factor of 8 or something close to that - Instead of showing 20secs it shows 2min 40secs.
When I change the clock source to LSI on the CubeMX clock configuration tab, the timing seems to be closer when I store the timing results same as above - with the LSI, it shows about 22secs.
Supposing that I have set the load capacitors of the external correctly, is there anything else I should do to make it work? especially with the RTC (as it seems that the system clock is working fine with the external crystal as the source)