2022-10-18 02:10 AM
Hi all,
I'm using STM32F429 on a custom board which is running a TFT LCD and RTC is running slow compared to the computer clock. 8MHz crystal is connected to HSE but currently, LSE is using an internal clock. My question is:
Can I connect the external crystal to LSE pins to get accurate RTC or do I need to connect the second crystal to it?
Please see attached pictures.
Any other suggestions will be very helpful, I'm badly stuck here.
Solved! Go to Solution.
2022-10-18 02:29 AM
> LSE is using an internal clock.
There is no such thing. According to the picutres, are using LSI, which is an imprecise RC oscillator.
Use the divided HSE as RTC clock. You will need to change the RTC dividers accordingly.
JW
2022-10-18 02:29 AM
> LSE is using an internal clock.
There is no such thing. According to the picutres, are using LSI, which is an imprecise RC oscillator.
Use the divided HSE as RTC clock. You will need to change the RTC dividers accordingly.
JW
2022-10-20 12:04 AM
Thanks waclawek for putting me in the right direction.
Just to confirm one thing more, once HSE freq (8MHz) is divided by 8, which gives 1 MHZ. So, in order to run the RTC Do I need to set the Asynchronous and synchronous predivider values from the RTC parameter settings to get 32.768KHz?
Many thanks
2022-10-20 02:43 AM
> Do I need to set the Asynchronous and synchronous predivider values from the RTC parameter settings to get 32.768KHz?
No. Normally, you set those two values to get 1Hz from 32.768kHz, now you have to change them to get 1Hz from 1MHz.
JW
2022-10-20 03:38 AM
2022-10-20 03:38 AM
2022-10-20 03:38 AM
2022-10-20 04:09 AM
Read out and check/post RTC registers content. Note, that prescalers' value in register has to be one less than the value used for calculation:
so in the register you should see 124 and 7999.
I don't use Cube/CubeMX so I don't know how do the values you put in CubeMX translate to the registers.
JW
2022-10-20 07:55 AM
Much appreciated your help.
With 125-1 and 8000-1, it works exactly according to RTC.
But I have another custom board with this 8MHz crystal (MC306-G-06Q-32.768) but somehow that one is lagging by 4s. Both crystal's specs are the same. One that works fine is this crystal (7A-8.000MAAJ-T).
Many thanks