2017-04-05 10:45 AM
Hello All,
We are working on RTC. We use:
MCU: STM32F100C6T6
IDE: IAR
Code Generator: STM32CubeMx
Hardware:
-> Connect external 32.767 KHz crystal
-> 3.3 Coin Cell to VBat Pin
Software:
-> RTC Config: LSE 32.767 KHz
-> Time and calander active
Code:
--> We generate code from Code Generator and config according as same
--> First time we write date and time after that i will not initialize time/date when reset mcu and wakeup
so after then when i restart mcu my RTC clock time show garbage value and Date become reset.
--> we know RTC Date store in SRAM so its content erase when power up but
We want to update time and date automatically when power off mcu (connected VBat).
We are stuck here, Any way possible to do this, it is possible so please share us.
Thanks and Regards
Chintan Patel
#rtc #rtc-time-and-date #rtc-hal #rtc-stm32f1xx2017-04-05 11:01 AM
Put the chip in standby mode, don't just remove the power.
When bringing back up check the reset cause (standby, etc), and don't initialize the RTC the same way if it has already been configured.