<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div>My thinking is that losing 1 ms every second or so means 1,000 seconds (16 minutes) to lose 1 second. As we poll the GSM modem for clock once every 60 seconds that should be fine and we should maintain accuracy. The GSM modem includes a real-time clock, so even if it loses GSM connectivity it should still keep good time.<div><br></div><div>P.S. There is a simple slight improvement I thought about last night. I use a 16bit unsigned integer to count milliseconds, adding 105 to it every 104.8576ms timer interrupt, and taking off 1,000ms every time it gets >1,000. Leading to an inaccuracy of 0.1424ms every timer tick. I could simply count 50ms instead, adding 5243 every timer tick of equivalent 5242.88 50ms chunks, and then taking off 50,000 every time if gets >50,000. That would lead to an inaccuracy of 0.12ms every timer tick. We could also mess around with the timer functions to try to get something more divisible into 1ms. But, with the GSM polling, I just don't think it will be necessary.</div><div><br></div><div>Regards, Mark.</div><div><br><div><div>On 21 Oct, 2014, at 2:55 pm, Gianluca <<a href="mailto:notifications@github.com">notifications@github.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p>After quick math every 7 interrupts you "loose" one ms. Maybe you could count interrupts and adjust ms count. To be more precise every 44 adjustments you should skip the increment. Let's say is a gregorian solution :)</p><p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System/commit/1a97b928d42e4f0db5940ebfc3416845354ce09a#commitcomment-8236670">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/797262__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyOTQ5Mzc0NywiZGF0YSI6eyJpZCI6NDY0MTI0NDZ9fQ==--8dfb3dd2b93b08cf8ae7c15d7f99c383e32b88de.gif" width="1"></p>
<script type="application/ld+json">{"@context":"<a href="http://schema.org">http://schema.org</a>","@type":"EmailMessage","description":"View this Commit on GitHub","action":{"@type":"ViewAction","url":"<a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System/commit/1a97b928d42e4f0db5940ebfc3416845354ce09a#commitcomment-8236670">https://github.com/openvehicles/Open-Vehicle-Monitoring-System/commit/1a97b928d42e4f0db5940ebfc3416845354ce09a#commitcomment-8236670</a>","name":"View Commit"}}</script></blockquote></div><br></div></body></html>