-->
Page 2 of 2

Re: system_deep_sleep() bad accuracy

PostPosted: Mon Oct 09, 2017 1:14 am
by Niesma
schufti wrote:as the used crystal is no precision part and heavily dependant on teperature, there is nothing much to improve. In average it wakes ~3% early ...


I think that: when the esp8266 is in deep sleep mode, the internal time is managed by a counter. The idea would be to compare the incremental value of the counter with an incremental real-time value before sleeping the esp8266. With these values, the counter and the real, would get a factor that would allow me to correct the time

Re: system_deep_sleep() bad accuracy

PostPosted: Mon Oct 09, 2017 11:47 am
by schufti
this you can achieve without need for low level access on registers etc. ...

just determine your factor and apply it to the deep sleep argument (µs)

Re: system_deep_sleep() bad accuracy

PostPosted: Mon Oct 09, 2017 4:00 pm
by Niesma
schufti wrote:this you can achieve without need for low level access on registers etc. ...

just determine your factor and apply it to the deep sleep argument (µs)


any idea to get the factor without accessing the registers?

Re: system_deep_sleep() bad accuracy

PostPosted: Tue Oct 10, 2017 1:20 pm
by schufti
get micros(), do your reference stuff, get micros() again,
do some hocus-pocus, adjust the argument to the deep_sleep()

I don't know if it is only me, but I have no idea what registers you actually want to access ...