2019-01-04 06:50 AM
Hi. As you can see in the picture I haven't got the LSE crystal resonator so I have 40 Khz as RTC input. The datetime is not well calculated.
How can I resolve the problem? Is there a way to have an affidable rtc whitout the resonator?
2019-01-04 07:24 AM
>>The datetime is not well calculated.
Not sure how to interpret that, too fast, too slow?
Measure the frequency, and use that for the prescaler/divider values. On the F1's this was closer to 37 KHz.
You should be able to measure RTC clock performance vs HSE using a TIM.
TIM14 per RM
STM32Cube_FW_F0_V1.9.0\Projects\STM32072B_EVAL\Examples\IWDG\IWDG_Reset\Src\main.c
See GetLSIFrequency(), and fix the math ordering
/* Frequency computation POOR MATH */
uwLsiFreq = (uint32_t) SystemCoreClock / lsiperiod;
uwLsiFreq *= 8;
/* Frequency computation BETTER */
uwLsiFreq = ((uint32_t) SystemCoreClock * 8)/ lsiperiod;
2019-01-04 07:34 AM
Too fast. The ideal value shoult be 32,768.
Is there a way to use the rtc without a crystal resonator or have I to use another way to get a timestamp / date time value?