<div dir="ltr"><div dir="ltr"><div dir="ltr">I just looked at the Ticker library routines and they are only a few lines and basically a wrapper around os_timer_arm which is supposed to have 1 ms accuracy, plus or minus 1ms.<div><br><a href="https://github.com/esp8266/Arduino/blob/master/libraries/Ticker/src/Ticker.cpp">Arduino/Ticker.cpp at master · esp8266/Arduino (github.com)</a><br><br></div><div>The os functions are documented here:<br><br><a href="https://www.espressif.com/sites/default/files/documentation/2c-esp8266_non_os_sdk_api_reference_en.pdf">2c-esp8266_non_os_sdk_api_reference_en (espressif.com)</a><br></div><div><br></div><div>Three is also an os_timer_arm_us that is supposed to be accurate to 500us (so basically 0.5 ms) so it doesn't really get you much better resolution<br><br>But it should be accurate enough for most operations as long as you keep your interrupt handlers short/simple</div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 27, 2021 at 3:34 PM John Vaughters via TriEmbed <<a href="mailto:triembed@triembed.org">triembed@triembed.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Mike,<br>
<br>
>An example might be strcpy.  It's several assembly instructions long.  So when the timer runs out, we don't know the status of that copy.<br>
<br>
In the case of an interrupt, this example makes perfect sense. In the case of using millis() or micro() to schedule a turn, this is not clear to me. Maybe I am over-simplifying it and I certainly have not spent the time to review the library code. But if code is moving along, and the scheduled time frame passes to execute but the current action is progress, it would wait for that code to complete before moving to the next step. And so we are not dealing with any sort of context switch at all, just waiting our turn to execute once the program reaches our place in line. Hence my comment that we may be dealing with sequential programming. To me I am left wondering exactly what the Ticker lib does, but not so willing to take that time to figure it out. There are definitely conflicts to my simplified belief. Maybe one day I will investigate further. For sure your input has helped me understand the Watchdogs more.<br>
<br>
The new timer arrangement went about a day with zero communication errors and that is an improvement. I even reduced the response timeout to modbus comms and still no issue. that is better than when I was using the delay, which had a 3-5 errors a day with a longer modbus response timeout. That could also just be a fluke in good wifi connections, but it does seem better and the responsiveness of the code certainly was improved by taking out a guaranteed 25ms delay.<br>
<br>
I appreciate everyone's efforts in helping explain this ESP product, I learned alot in the past week or so on this little board. I really like it. So cheap relative to the capabilities. I wish I wouldn't have waited this long. `,~)<br>
<br>
Thanks,<br>
<br>
John Vaughters<br>
<br>
_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<br>
To post message: <a href="mailto:TriEmbed@triembed.org" target="_blank">TriEmbed@triembed.org</a><br>
List info: <a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" rel="noreferrer" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org" rel="noreferrer" target="_blank">http://TriEmbed.org</a><br>
To unsubscribe, click link and send a blank message: mailto:<a href="mailto:unsubscribe-TriEmbed@bitser.net" target="_blank">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
<br>
</blockquote></div>