-->
Page 2 of 4

Re: Pcf8523 don't work in deep sleep

PostPosted: Mon Oct 09, 2017 11:55 am
by schufti
hi,
pcf8523 has a dedicated Vbat pin that should be connected to a coin cell battery.
The chip automatically switches between Vdd and battery.
from the datasheet
Code: Select allThe PCF8523 has a backup battery switch-over circuit, which detects power failures and
automatically switches to the battery supply when a power failure occurs.


If it stops running then there is obviously something wrong with your setup.

see adafruit breakout board https://www.adafruit.com/product/3295

Re: Pcf8523 don't work in deep sleep

PostPosted: Mon Oct 09, 2017 1:18 pm
by gdsports
The ESP8266 depends on an internal timer to wake up from deep sleep. If this timer is not accurate enough for your application, you could try adding/subtracting an offset to calibrate it.

If the PCF8523 has the correct date/time after waking from deep sleep, it is working fine.

The TimeAlarms library depends on the CPU running. Since the ESP8266 CPU is not running during deep sleep, these software timers cannot wake up the ESP from deep sleep.

It might be possible to use an external RTC with alarm feature and interrupt out pin to reset the ESP8266 at the wake up time. You must read the PCF8523 datasheet and schematic to see if this is possible.

Re: Pcf8523 don't work in deep sleep

PostPosted: Thu Oct 12, 2017 10:06 am
by Paolo Cinaglia
gdsports wrote:The ESP8266 depends on an internal timer to wake up from deep sleep. If this timer is not accurate enough for your application, you could try adding/subtracting an offset to calibrate it.

If the PCF8523 has the correct date/time after waking from deep sleep, it is working fine.

The TimeAlarms library depends on the CPU running. Since the ESP8266 CPU is not running during deep sleep, these software timers cannot wake up the ESP from deep sleep.

It might be possible to use an external RTC with alarm feature and interrupt out pin to reset the ESP8266 at the wake up time. You must read the PCF8523 datasheet and schematic to see if this is possible.


Thanks alot gdsports. I thought about something like "rtc.always_on" (if someone has a solution like this please tell me) or else to keep the pcf awaken. I was wrong... it's not so simple...

Re: Pcf8523 don't work in deep sleep

PostPosted: Thu Oct 12, 2017 2:28 pm
by rudy
@ Paolo

As long as the PCF8523 has power it should be working. Maybe the problem is with your code rather than the part.

Get this sketch working https://github.com/adafruit/RTClib/blob ... cf8523.ino

Set the clock, then reload the program without the clock setting function enabled. After that you should be able to turn off the power, turn the power back on, read the clock, and the time should be correct. As long as the clock chip has power from the line powered supply, or power from the battery, the clock should keep running.