cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F100 RTC Issue

chintan
Associate
Posted on April 05, 2017 at 19:45

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-stm32f1xx
1 REPLY 1
Posted on April 05, 2017 at 20:01

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.

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