Calibration function to calibrate Millis Factor to precise timing maybe 15.9599999 Crystal precision.
So we can measure over hours in Millisecond Precision with round about 32768Hz 1-2ppm.
Most people uses the Time Library With DS3231 or gps time.. Why we synchronize Time in intervals instead reading the integrated TCX0 or PPS
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Calibration function to calibrate Millis Factor to precise timing maybe 15.9599999 Crystal precision.
So we can measure over hours in Millisecond Precision with round about 32768Hz 1-2ppm.
To choose the Timer edit Time.ccp Line to Timer number:
Example Timer 1:
```#Define TIMERVAR 1```
Same to Reserve Pin D8 for ICP1:
```#Define Pin8 1```
Codeexample:
Setup():
initTimer(2,0,2); //Standard Settings init (Timer2, Internal clock,INT0(Pin2) DS3231 SQWPin 1Hz->INT0
Loop() Overwiew:
CalibrateNow();
Serial.println("New Calculation Frequency for PrecMillis()");
Serial.println(recalculateF_CPU());
Serial.println(precmillis());
Serial.println( myprecmillis - mymillis - sync);
Output: (Good Measurement, The Millis from Core Drifts 2-4ms/Second) The Real Delay(1000) maybe ca. 1060ms
New Calculation Frequency for PrecMillis()
11993117
14591
39
15658
42
16725
45
17793
50
18860
55
19927
58
20995
63
22061
65
23129
71
24196
75
25263
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates