ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1
megaTinyCore 1.1.9 millis/micros timer changes
2
3
4/4/2020 - Updated values based on improved testing method.
4
Values that have changed are marked with highlightingmicros time and % of CPU time used for millis ISR are approximate
5
Where marked with orange highlighting, previous micros() results were wrongmicros time is the time that micros takes to return. The value returned is as close to when micros() was called as possible
6
7
TCA0
8
PreviousNew (1.1.19+)
9
ClockPeriodPrescalePWM Freqmicros resmicros timemillis resPrescalePWM Freqmillis resmicros res
micros time
%CPU ISR
10
20 MHz255641225 Hz3 us6.9 us1 ms641225 Hz1 ms3 us6.2 us0.94%
11
16 MHz25564980 Hz4 us6.7 us1 ms64980 Hz1 ms4 us7.3 us0.65%
12
10 MHz25564613 Hz6 us13.7 us2 ms64613 Hz2 ms6 us12.3 us0.94%
13
8 MHz25564490 Hz8 us14.3 us2 ms64490 Hz2 ms8 us15.4 us0.65%
14
5 MHz25564306 Hz12 us27.3 us3 ms161225 Hz1 ms3 us24.6 us2.90%
15
4 MHz25564245 Hz16 us30.6 us4 ms16980 Hz1 ms4 us29.1 us2.60%
16
1 MHz2556461 Hz64 us136 us16 ms8490 Hz2 ms8 us123 us5.20%
17
18
Resolution of millis is a bit more complicated than presented here; the value presented is a safe (pessimistic) approximation.
19
20
TCBn (for millis)
21
PreviousNew (1.1.19+)
22
Clockmicros resPeriodPrescalemicros timemillis resPeriodPrescalemillis resmicros time%CPU ISR
23
20 MHz1 us1000029. us1 ms1000021 ms7.6 us0.32%
24
16 MHz1 us800027.3 us1 ms800021 ms6.4 us0.41%
25
10 MHz1 us5000218.8 us1 ms500021 ms16.1 us0.52%
26
8 MHz1 us4000213.3 us1 ms400021 ms11.5 us0.82%
27
5 MHz1 us2500235.6 us1 ms250021 ms30.3 us1.36%
28
4 MHz1 us2000226.1 us1 ms200021 ms22.5 us1.65%
29
1 MHz1 us10001103 us1 ms200012 ms88 us3.50%
30
31
Above ONLY applies when TCB0 or TCB1 is used for millis timing. When it is used for Servo or tone() the timer is configured to produce the required output with the selected system clock, and no changes were made to that.
32
TCB0 and TCB1 are not used to generate PWM by megaTinyCore
33
34
TCD0 (see note)
35
PreviousNew (1.1.19+)
36
ClockPeriodPrescalePWM Freqmicros resmicros timemillis resPeriodPrescalePWM Freqmillis resmicros res
micros time
%CPU ISR
37
20 MHz512321221 Hz2 us6.2 us1 ms510321225 Hz1 ms2 us6.5 us0.91%
38
16 MHz51232977 Hz2 us9.4 us1 ms51032980 Hz1 ms2 us6.5 us0.75%
39
10 MHz512321221 Hz2 us12.3 us1 ms510321225 Hz1 ms2 us13. us1.27%
40
8 MHz51232977 Hz2 us19.4 us1 ms51032980 Hz1 ms2 us13.1 us1.50%
41
5 MHz512321221 Hz2 us24.9 us1 ms510321225 Hz1 ms2 us25.9 us3.18%
42
4 MHz51232977 Hz2 us38.9 us1 ms51032980 Hz1 ms2 us26.3 us3.00%
43
1 MHz51232977 Hz2 us155 us1 ms51064490 Hz2 ms4 us107 us6.00%
44
45
TCD0 is configured to run from the on-chip oscillator before the system clock prescaler.
46
On 20 and 24-pin parts (where TCD0 is used for PWM), if not used for millis, it will be enabled with period of 510, prescale of 32, from 20/16MHz oscillator, providing 1225Hz PWM at 20, 10, and 5 MHz and 980 Hz PWM at other frequencies.
47
TCD0 is not configured by the core on 8 and 14-pin chips if not used for millis timekeeping - but it is the default choice there, as there isn't a better use for it.
48
As of version 1.1.19, TCD0 is used by default for millis timekeeping for all chips that have it due to improvements that allowed PWM to be used even when it is also used for millis timekeeping
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100