cancel
Showing results for 
Search instead for 
Did you mean: 

rtc calendar application, urgent

lakshmikantha85
Associate II
Posted on February 11, 2011 at 17:04

rtc calendar application, urgent

2 REPLIES 2
Chris1
Senior III
Posted on May 17, 2011 at 14:24

Assuming your system starts up with the right oscillators and peripheral clocks enabled; to write to the backup registers the following should be sufficient:

 PWR_BackupAccessCmd(ENABLE);            // allow access to Backup Registers

 BKP_WriteBackupRegister(BKP_DR2, 0x0005); // write value 5 to BKP_DR2

[PWR_BackupAccessCmd(ENABLE); is probably equivalent to PWR->CR |= PWR_CR_DBP;].

-Chris

Posted on May 17, 2011 at 14:24

I am storing date in backup registers. BKP2,3,4

Or use a 32-bit time scale like UNIX time. And you wouldn't have to watch for the RTC wrapping every 24 hours.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..