RTC battery supply

Graham1904
Posts: 2
Joined: Fri Jul 22, 2016 10:35 am

RTC battery supply

Postby Graham1904 » Wed Mar 29, 2017 4:51 pm

I read that the ESP32 has a RTC but where is its Vbatt supply pin when the main Vdd fails?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: RTC battery supply

Postby WiFive » Thu Mar 30, 2017 2:30 am

Has an rtc but not a battery-backed rtc. So you have to implement battery switching and sleep/wake in external circuitry and software.

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: RTC battery supply

Postby ESP_igrr » Thu Mar 30, 2017 5:40 am

You can connect both battery and main supply to the RTC via a couple of diodes (or a more complex switching circuit).

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: RTC battery supply

Postby WiFive » Thu Mar 30, 2017 6:35 am

ESP_igrr wrote:You can connect both battery and main supply to the RTC via a couple of diodes (or a more complex switching circuit).
Does battery have to also connect to VDD3P3_CPU since
VDD3P3_CPU is also the input power supply for CPU
or is it OK to cut power to VDD3P3_CPU but not VDD3P3_RTC?

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: RTC battery supply

Postby ESP_igrr » Fri Mar 31, 2017 8:05 am

Depending on what is the goal... If the goal is to keep just the RTC working in the event of loss of power, then powering VDD3P3_RTC with a battery-backed supply is enough. If the goal is to also save main memory contents, then VDD3P3_CPU should be battery-backed as well (although this will likely need a much bigger battery).

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: RTC battery supply

Postby WiFive » Fri Mar 31, 2017 8:42 am

ESP_igrr wrote:Depending on what is the goal... If the goal is to keep just the RTC working in the event of loss of power, then powering VDD3P3_RTC with a battery-backed supply is enough. If the goal is to also save main memory contents, then VDD3P3_CPU should be battery-backed as well (although this will likely need a much bigger battery).
So power to VDD3P3_CPU dies, chip_pu goes low, VDD3P3_RTC stays high, chip is in lowest power state, VDD3P3_RTC keeps rtc powered up, rtc io and rtc fast/slow ram are ...on/off? After chip_pu goes high and spurious wdt reset rtc is still ticking and accurate?

Or we have to detect power failure, keep CPU active on battery long enough to enter deep sleep (can we enter deep sleep from ISR?), enable wake on detect power restored, and keep rtc fast mem powered up to avoid spurious wdt reset?

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: RTC battery supply

Postby ESP_igrr » Fri Mar 31, 2017 8:59 am

Good point about CH_PD... let me do some tests, will get back on this.

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: RTC battery supply

Postby ESP_igrr » Tue Apr 11, 2017 10:15 am

Did a few tests about this. The issue seems to be that internal CPU regulator can also take power from VDD_RTC pin, meaning that if all the power rails except VDD_RTC are powered off, CPU can still keep running; this may cause issues if the CPU tries to read instructions or data from Flash, which will be powered down. This will soon cause the CPU to crash and enter boot loop.

Monitoring the VDD and going into deep sleep when it disappears is possible, but we are looking for an automatic solution to the problem.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: RTC battery supply

Postby WiFive » Wed Apr 12, 2017 2:35 am

OK, following topic.

ricksondpenha
Posts: 7
Joined: Mon Sep 19, 2016 11:11 am

Re: RTC battery supply

Postby ricksondpenha » Thu Jun 01, 2017 6:14 am

ESP_igrr wrote:Did a few tests about this. The issue seems to be that internal CPU regulator can also take power from VDD_RTC pin, meaning that if all the power rails except VDD_RTC are powered off, CPU can still keep running; this may cause issues if the CPU tries to read instructions or data from Flash, which will be powered down. This will soon cause the CPU to crash and enter boot loop.

Monitoring the VDD and going into deep sleep when it disappears is possible, but we are looking for an automatic solution to the problem.

hi any update on this... we need to implement this in one of our projects. could we get a timeline on when will this feature be implemented.

Regards

Rickson.

Who is online

Users browsing this forum: No registered users and 105 guests