cancel
Showing results for 
Search instead for 
Did you mean: 

VBAT & RTC Issues on Circuit - STM32H563ZIT6

Bharathkumar
Associate II

I am experiencing issues with the VBAT pin on the STM32H563ZIT6 microcontroller. Specifically, the VBAT pin is not responding properly. I am using a CR2032 CMOS battery for RTC backup, but it is not maintaining the date and time as expected. When the power supply is off, the RTC does not hold and run correctly, but it resumes running once the power supply is restored.

I have attached the circuit diagram for your reference. Could you please provide a clear explanation of the potential issues and offer guidance on how to resolve them? Expert advice on this matter would be greatly appreciated.

 

VBAT & CMOS : 

VBAT_CKT.png

CMOS Battery.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

As per your instructions, the problem was solved. We checked it a few times, each for a duration of 5 to 10 minutes, over the last few days. If any issues occur in the future, I will call you back. Thank you for your support and guidance.

View solution in original post

13 REPLIES 13

> When the power supply is off, the RTC does not hold and run correctly,

How do you know?

JW

We are encountering issues with live date and time printing on our ODM development board using the attached circuit. Below are the details of the tests conducted:

Test 1:

  • Initially, we set the current live date and time to 15/Jun/2024, 3:15 PM.
  • The system ran for 5-10 minutes, printing the date and time as expected (e.g., 15/Jun/2024, 3:25 PM).
  • This test was repeated four times with 5-minute intervals.

Observations Before Power Off:

  • Set Date and Time: 15/Jun/2024, 4:25 PM

  • Live Date and Time: 15/Jun/2024, 4:25 PM

  • Printed Date and Time: 15/Jun/2024, 4:25 PM

  • After running for 5 minutes:

    • Live Date and Time: 15/Jun/2024, 4:30 PM
    • Printed Date and Time: 15/Jun/2024, 4:30 PM

Observations After Power Off:

  • The power was turned off on the DB, and after 5 minutes, we turned it back on. The system then printed the date and time as it was when the power was turned off, continuing from that point.

  • Set Date and Time: 15/Jun/2024, 4:25 PM

  • Live Date and Time: 15/Jun/2024, 4:40 PM

  • Printed Date and Time: 15/Jun/2024, 4:40 PM

  • After 5 minutes of power being off:

    • Live Date and Time: 15/Jun/2024, 4:45 PM
    • Printed Date and Time: 15/Jun/2024, 4:40 PM

Additional Tests:

  • Similar behavior was observed during tests at different live times: 6 PM, 7 PM, 8 PM, and the next morning at 10 AM.

We conducted this test 4-6 times with consistent results. It seems that the printed date and time do not update correctly after power restoration.

Please check the attached circuit and provide guidance on potential issues and corrections needed.

unsigned_char_array
Senior III

No files are attached so I don't know what you did wrong.

You can check out this topic which might contain the solution that works for you:
https://community.st.com/t5/stm32-mcus-products/stm32h5-rtc-count-through-power-cycles/m-p/671611#M243435
You need to enable LSE instead of the internal clock.

 

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

Please check one more time

unsigned_char_array
Senior III

R5 is discharging the battery to GND with 15mA. That's a lot and I don't see a need for discharging a backup battery.
RJ1 is also discharging the battery by having the battery supply current to the entire circuit, it also prevents the circuit from powering off. Internally VBAT is bypassed when VCC is present, so you do not need VCC connected to VBAT at all. Remove these resistors. You don't need the diode, it just ads voltage drop. C14 is redundant because of C55 and it is behind a diode, you only need one, look at the guidelines for what capacitor value is recommended. Extra components potentially add a small leakage current.

Have you checked LSE like I told you? If you use LSE as a clock source it won't run when powered by VBAT so the value will freeze like you observed. Additionally you will see very inaccurate time keeping.Have you checked the crystal to see if it is oscillating?

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

I have checked the issue as per our previous conversation, but the same problem is still occurring. I am unable to trace the cause.

As per your instructions, I have made the following changes:

  • Removed RJ1.
  • Cut the 3.3V supply.
  • Removed D2 IN4007 and replaced it with a 0-ohm resistor.
  • Removed R5 and C14 & C55.
  • Replaced the old CR2032 battery with a new one in the VBAT CMOS holder. Before replacement, I checked with a multimeter and confirmed the voltage is 3.3V.

Despite these changes, the main problem persists, and I am unable to track down the root cause. Could there be a software issue, driver problem, or something related to the crystal that needs to be enabled? If there are any other hardware or software requirements, I will discuss them with the software team.

Please share the protocols for VBAT setup for both hardware and software, and any relevant references.

 

Please upload your .ioc-file so we can check your configuration.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

Please find the program file attached to this reply.

Waiting For your Respond