2025-06-13 5:31 PM - edited 2025-06-13 5:34 PM
Hello everyone,
I’m using an STM32L412K8 microcontroller with an external 32.768 kHz LSE crystal to operate the RTC for real-time clock functionality. However, I'm facing two issues:
Second jumps: the seconds skip multiple values out of order (for example, jumping from second 9 to second 16). It consistently jumps by 7 seconds every 10 seconds. The attached image shows some of these jumps.
Irregular seconds counter: The seconds count exceeds the normal range, reaching values above 60 (for example, 89) before rolling over to the next minute, as shown in the attached images.
What are the possible solutions I can try?, Any tips or suggestions would be very helpful.
Thank you in advance!
2025-06-13 7:28 PM - edited 2025-06-13 7:31 PM
The values are in BCD format. 16 is 0x10 which is 10 in BCD format. 89 is 0x59. 4 bits are used for each digit.
HAL has routines to return things in binary format. You could use those, or you could do your own conversion.