Go Down

Topic: millis (crystal) accuracy & thoughts (Read 5401 times) previous topic - next topic

mem

Quote
So even with a perfectly precise clock you get error.  You can see all this by reading wiring.c


No, there is no error in the millis calculation. The fractional calculations in that code compensate for the number of actual interrupts per microsecond.

JimEli

If you examine the millis code you will find out this:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1279385586/0

JimEli

Quote

Well researched mspguy, I assumed the millis actually meant millis.

So one may wonder why they didn't /250 by using an output compare interrupt? Or is that used for PWM?

______
Rob


precisely what they did in the Aiko Framework for arduino:
https://github.com/geekscape/Aiko/blob/master/AikoTiming.cpp

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy