RTC reset with VBATT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-27 2:02 AM
Hi,
I have an STM32G0 with VBATT input for the RTC.
When I restart the circuit, the time is reset.
At the power On I write this instruction :
HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR1);
Before of the Power Off :
HAL_RTCEx_BKUPWrite(&hrtc, RTC_BKP_DR1, 0x32F2);
Thanks for your Help.
Pascal
Solved! Go to Solution.
- Labels:
-
Power
-
RTC
-
STM32G0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-27 5:30 AM
Hi Jan,
thank you. Solved the problem.
It was a mistake during the RTC init() setup.
Thank you for your help !!
Pascal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-27 2:23 AM
Is battery connected to the VBAT pin? What is its voltage, measured directly on that pin?
How does writing to backup register relate to time of RTC?
Is that backup register content retained during powerdown?
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-27 2:47 AM
Hi Jan,
thanks for your help.
On the Pin = 2.7 V
How does writing to backup register relate to time of RTC?
I don't know how to write the current time on the register.
Is that backup register content retained during powerdown?
how can i check?
Thanks, Pascal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-27 3:35 AM
>> How does writing to backup register relate to time of RTC?
> I don't know how to write the current time on the register.
Why do you need to write it? And what is 0x32F2?
> At the power On I write this instruction :
> HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR1);
And what does that function return?
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-27 4:40 AM
Hi Jan,
Time=HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR1);
Return Time= 11001011110010
What is the correct instructions for read the time and date after the Power On of the circuit ?
Thanks for your help.
Pascal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-27 5:01 AM
> What is the correct instructions for read the time and date after the Power On of the circuit ?
It does not differ from reading the time and date in any other instance... Normally, just read RTC->TR and RTC->DR (in this order, if BYPSHAD is 0).
I don't use Cube.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-27 5:30 AM
Hi Jan,
thank you. Solved the problem.
It was a mistake during the RTC init() setup.
Thank you for your help !!
Pascal
