2015-10-03 12:33 PM
Hello,
I'm working on a STM32L053 and I have a question about RTC and ''week day''. When I provide a date: YYYY-MM-YY without day of week, I would like to know if the STM32L053 RTC hardware can calculate the week day or do i self need to calculate it in SW before setting the RTC?2015-10-03 01:59 PM
On reset, the date register is set to Monday. I doubt the RTC can tell the difference between a default entry for week day and an intended value. And the simplest RTC design is to increment the week day after midnight. So, I think the answer is no.
Try it and see if I need re-educating. Cheers, Hal2015-10-04 05:35 AM
It seems that there is no verification in HW on the time/ date set by the HAL driver function:
HAL_RTC_SetTime(&RtcHandle,&stimestructure,FORMAT_BCD)
Can anybody verify this? I've done some testing:If I set the RTC to 28.2.2015 @ 23:59:50. If I wait 10 seconds. After 00.00 the date is 01.03.2015. The compensation seems working.If I set the RTC to 29.2.2015 @ 23:59:50. If I wait 10 seconds. After 00.00 the date is 01.03.2015. The compensation seems working.But if I set the RTC to 30.2.2015 @ 23:59:50. If I wait 10 seconds. After 00.00 the date is 31.02.2015. The compensation is not working.Can anybody give me some documentation on how does the compensation (for leapyear) work. I am also interested in hearing if there is any data validation in RTC HW?2015-10-04 06:17 AM
Pretty sure there is minimum silicon used here, and expects your software to at least start it with a valid date. Without that you can expect undesirable behaviour, that might still be predictable and consistent. While understanding this behaviour might give you insight into the circuit design it's not going to be considered a flaw if it's outside the valid range to start with.