2014-12-03 10:49 AM
Hi.
I have my RTC lib, which is working just fine except one thing.When december arrived, my RTC date register reads 0 as date except 12.I have read with RTC_GetDate(RTC_Format_BIN,..) and Month is set to 0.Why is that?In the stm32f4xx_rcc.h is define for January set to 0x01 and for December to 0x12 (in BCD) so I assume that december is 12 and january is 1 in registers.I have no idea, please help about that strange error.2014-12-03 10:56 AM
It rolled over to zero? Access to PWR/BKP enabled?
If you write 0x12 BCD do you get 0x12 BCD back?2014-12-03 12:00 PM
RTC seems to rollover fine here
ClockDiagnostic
SYS:8000000 H:8000000, P1:8000000, P2:8000000
LSI:34482, LSE:0
HSE Source
LSI On
LSI Ready
LSE On
LSE Not Ready
LSE ByPass Off
RTC Clock Enabled
RTC Clock Source LSI
23:59:57 30/11/14
23:59:58 30/11/14
23:59:59 30/11/14
00:00:00 01/12/14
00:00:01 01/12/14
00:00:02 01/12/14
00:00:03 01/12/14
00:00:04 01/12/14
00:00:05 01/12/14
00:00:06 01/12/14
2014-12-03 01:17 PM
Hi.
Thanks for replay.I found the problem after connecting debugger on board. The problem was because After read from RTC, I also called function to calculate unix timestamp in seconds. In this functions I've dones this: data->month = data->month % 12; and when december (12) result was 0.Now, it is working ok.