Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By btidey
#85734 Exactly. I agree with you; the problem is just that they called it an RTC. A real RTC has to accommodate a register that can deal with an arbitrary long period of time (e.g. years).

Of course if waking from deep sleep is always done from the reset feedback then the wrap-around can't occur but if it is done via an external trigger (e.g. from a sensor) then the period can be very long.

I think the counter is actually a 31 or 32 bit counter (not 64) but it is running from the slower "RTC" clock so the wrap around is around 3.5 hours. The software translates the counter into microsecond units with a 64 bit value.

One can always think of ways a design could be "improved" but one also has to be very careful that any changes that are made don't break any software out there that relied on the previous behaviour.
User avatar
By php fan
#85743
davydnorris wrote:But if you're woken from deep sleep and the RTC says you've been asleep an hour, how do you know it hasn't been 4.5, or 8, or 11.5 hours?


Easy. It can't be because you can't do deep sleep for longer than that. It's the maximum possible duration of deep sleep.

This is assuming wakeup is enabled of course, which is my use case.