utime.ticks_us() accuracy
-
Hello everyone,
I am working on a project for which I need time measurements as accurate as possible, is utime.ticks_us() reliable in terms of accuracy ? -
@p.lupascu ticks_us() is derived from the CPU clock, which is pretty accurate. So you can expect a good long term precision. The short term precision is affected by the uncertainty, about when you ask for the time. Between an event, you want to time, and the response from ticks_us() may an interrupt happen (scheduler, network, etc.). Even if you put the event noticing and the time taking into an ISR, the ISR's response to the actual event may have an substantial latency. There was a post about that in the past, and I have taken some figures. The latency was between 30 µs and about 750 µs.
https://forum.pycom.io/topic/936/pin-interrupt-latency/14
And: ticks_us returns a 30 bit quantity, which means, that the longest period you can determine is about 1000 seconds. -
@robert-hh Thanks!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login