Chat freely about anything...

User avatar
By Atlantis
#20908
scargill wrote:Depends what you call drift - I haven't checked but I'd be surprised if it is more than a second out..


Once I was trying to add similar functionality to one of my Ethernet enabled projects (Atmega328 + ENC28J60). Unfortunately there was no proper crystal for generating accurate 1Hz signal. I was forced to count milliseconds incremented by normal hardware timer. There was significant drift - about one second for every 10 minutes. To be sure, I had to use NTP every 5 minutes...

I just would like to avoid similar situation. Is ESP8266 software timer accurate enough? Can it be affected by delays used by other functions?
User avatar
By eriksl
#20922 I have this exact same combo in use: atmega328p + enc28j60. I did use a crystal though, simply because I needed the uart (which appears to run just fine on the rc oscillator, it appears). With the crystal the drift was about 1-2 seconds a day. But that was also due to the limited precision of the floats (no double).

Is the drift more or less the same? Then you could account for it. One could also tweak the rc oscillator fine tuning register. But that will only help if the environment is constant.