|
13 | 13 | * [Why using ISR-based Hardware Timer Interrupt is better](#why-using-isr-based-hardware-timer-interrupt-is-better)
|
14 | 14 | * [Important Notes about ISR](#important-notes-about-isr)
|
15 | 15 | * [Currently supported Boards](#currently-supported-boards)
|
16 |
| -* [Changelog](#changelog) |
17 |
| - * [Release v1.3.0](#release-v130) |
18 |
| - * [Release v1.2.0](#release-v120) |
19 |
| - * [Release v1.1.0](#release-v110) |
20 |
| - * [Initial Release v1.0.0](#initial-release-v100) |
| 16 | +* [Changelog](changelog.md) |
21 | 17 | * [Prerequisites](#prerequisites)
|
22 | 18 | * [Installation](#installation)
|
23 | 19 | * [Use Arduino Library Manager](#use-arduino-library-manager)
|
|
40 | 36 | * [ 1. Argument_Complex](examples/Argument_Complex)
|
41 | 37 | * [ 2. Argument_None](examples/Argument_None)
|
42 | 38 | * [ 3. Argument_Simple](examples/Argument_Simple)
|
43 |
| - * [ 4. **Change_Interval**](examples/Change_Interval). |
44 |
| - * [ 5. **FakeAnalogWrite**](examples/FakeAnalogWrite). |
| 39 | + * [ 4. Change_Interval](examples/Change_Interval) |
| 40 | + * [ 5. FakeAnalogWrite](examples/FakeAnalogWrite) |
45 | 41 | * [ 6. **ISR_16_Timers_Array_Complex**](examples/ISR_16_Timers_Array_Complex).
|
46 | 42 | * [ 7. ISR_RPM_Measure](examples/ISR_RPM_Measure)
|
47 |
| - * [ 8. ISR_Switch](examples/ISR_Switch) |
48 |
| - * [ 9. ISR_Timer_Complex](examples/ISR_Timer_Complex) |
49 |
| - * [ 10. **ISR_Timers_Array_Simple**](examples/ISR_Timers_Array_Simple). |
50 |
| - * [ 11. ISR_Timer_Switch](examples/ISR_Timer_Switch) |
51 |
| - * [ 12. ISR_Timer_Switches](examples/ISR_Timer_Switches) |
52 |
| - * [ 13. RPM_Measure](examples/RPM_Measure) |
53 |
| - * [ 14. SwitchDebounce](examples/SwitchDebounce) |
54 |
| - * [ 15. TimerDuration](examples/TimerDuration) |
55 |
| - * [ 16. TimerInterruptTest](examples/TimerInterruptTest) |
| 43 | + * [ 8. **Change_Interval_HF**](examples/Change_Interval_HF) |
| 44 | + * [ 9. **ISR_Timers_Array_Simple**](examples/ISR_Timers_Array_Simple). |
| 45 | + * [ 10. RPM_Measure](examples/RPM_Measure) |
| 46 | + * [ 11. SwitchDebounce](examples/SwitchDebounce) |
| 47 | + * [ 12. TimerDuration](examples/TimerDuration) |
| 48 | + * [ 13. TimerInterruptTest](examples/TimerInterruptTest) |
56 | 49 | * [Example ISR_16_Timers_Array_Complex](#example-isr_16_timers_array_complex)
|
57 | 50 | * [Debug Terminal Output Samples](#debug-terminal-output-samples)
|
58 | 51 | * [1. ISR_16_Timers_Array_Complex on Arduino megaAVR Nano Every](#1-isr_16_timers_array_complex-on-arduino-megaavr-nano-every)
|
|
63 | 56 | * [3.3 TCB Clock Frequency 250KHz for lower accuracy but longer time](#33-tcb-clock-frequency-250khz-for-lower-accuracy-but-longer-time)
|
64 | 57 | * [Debug](#debug)
|
65 | 58 | * [Troubleshooting](#troubleshooting)
|
66 |
| -* [Releases](#releases) |
67 | 59 | * [Issues](#issues)
|
68 | 60 | * [TO DO](#to-do)
|
69 | 61 | * [DONE](#done)
|
@@ -125,31 +117,6 @@ The catch is your function is now part of an ISR (Interrupt Service Routine), an
|
125 | 117 | - **Arduino UNO WiFi Rev2, AVR_NANO_EVERY, etc.**
|
126 | 118 | - ATmega4809-based boards.
|
127 | 119 |
|
128 |
| ---- |
129 |
| ---- |
130 |
| - |
131 |
| -## Changelog |
132 |
| - |
133 |
| -### Release v1.3.0 |
134 |
| - |
135 |
| -1. Fix TCB Clock bug. Don't use v1.2.0 |
136 |
| - |
137 |
| - |
138 |
| -### Release v1.2.0 |
139 |
| - |
140 |
| -1. Selectable **TCB Clock 16MHz, 8MHz or 250KHz** depending on necessary accuracy |
141 |
| -2. Add BOARD_NAME definition |
142 |
| - |
143 |
| -### Release v1.1.0 |
144 |
| - |
145 |
| -1. Fix bug. Don't use v1.0.0 |
146 |
| - |
147 |
| -### Initial Release v1.0.0 |
148 |
| - |
149 |
| -1. Intial release to support to ATmega4809-based boards, such as **Arduino UNO WiFi Rev2, AVR_NANO_EVERY, etc.** |
150 |
| -2. New examples to support Blynk using [**WiFiNINA_Generic**](https://github.com/khoih-prog/WiFiNINA_Generic) and [**Blynk_WiFiNINA_WM**](https://github.com/khoih-prog/Blynk_WiFiNINA_WM) libraries. |
151 |
| - |
152 |
| - |
153 | 120 | ---
|
154 | 121 | ---
|
155 | 122 |
|
@@ -429,19 +396,16 @@ void setup()
|
429 | 396 | 1. [Argument_Complex](examples/Argument_Complex)
|
430 | 397 | 2. [Argument_None](examples/Argument_None)
|
431 | 398 | 3. [Argument_Simple](examples/Argument_Simple)
|
432 |
| - 4. [**Change_Interval**](examples/Change_Interval). |
433 |
| - 5. [**FakeAnalogWrite**](examples/FakeAnalogWrite). |
| 399 | + 4. [Change_Interval](examples/Change_Interval). |
| 400 | + 5. [FakeAnalogWrite](examples/FakeAnalogWrite). |
434 | 401 | 6. [**ISR_16_Timers_Array_Complex**](examples/ISR_16_Timers_Array_Complex).
|
435 | 402 | 7. [ISR_RPM_Measure](examples/ISR_RPM_Measure)
|
436 |
| - 8. [ISR_Switch](examples/ISR_Switch) |
437 |
| - 9. [ISR_Timer_Complex](examples/ISR_Timer_Complex) |
438 |
| -10. [**ISR_Timers_Array_Simple**](examples/ISR_Timers_Array_Simple). |
439 |
| -11. [ISR_Timer_Switch](examples/ISR_Timer_Switch) |
440 |
| -12. [ISR_Timer_Switches](examples/ISR_Timer_Switches) |
441 |
| -13. [RPM_Measure](examples/RPM_Measure) |
442 |
| -14. [SwitchDebounce](examples/SwitchDebounce) |
443 |
| -15. [TimerDuration](examples/TimerDuration) |
444 |
| -16. [TimerInterruptTest](examples/TimerInterruptTest) |
| 403 | + 8. [**Change_Interval_HF**](examples/Change_Interval_HF) |
| 404 | + 9. [**ISR_Timers_Array_Simple**](examples/ISR_Timers_Array_Simple). |
| 405 | +10. [RPM_Measure](examples/RPM_Measure) |
| 406 | +11. [SwitchDebounce](examples/SwitchDebounce) |
| 407 | +12. [TimerDuration](examples/TimerDuration) |
| 408 | +13. [TimerInterruptTest](examples/TimerInterruptTest) |
445 | 409 |
|
446 | 410 | ---
|
447 | 411 |
|
@@ -799,7 +763,7 @@ While software timer, **programmed for 2s, is activated after more than 10.000s
|
799 | 763 | ```
|
800 | 764 |
|
801 | 765 | Starting ISR_16_Timers_Array_Complex on megaAVR Nano Every
|
802 |
| -megaAVR_TimerInterrupt v1.3.0 |
| 766 | +megaAVR_TimerInterrupt v1.4.0 |
803 | 767 | CPU Frequency = 16 MHz
|
804 | 768 | TCB Clock Frequency = 250KHz for lower accuracy but longer time
|
805 | 769 | Starting ITimer1 OK, millis() = 6
|
@@ -951,7 +915,7 @@ The following is the sample terminal output when running example [Change_Interva
|
951 | 915 |
|
952 | 916 | ```
|
953 | 917 | Starting Change_Interval on megaAVR Nano Every
|
954 |
| -megaAVR_TimerInterrupt v1.3.0 |
| 918 | +megaAVR_TimerInterrupt v1.4.0 |
955 | 919 | CPU Frequency = 16 MHz
|
956 | 920 | TCB Clock Frequency = 250KHz for lower accuracy but longer time
|
957 | 921 | Starting ITimer1 OK, millis() = 1
|
@@ -980,7 +944,7 @@ Changing Interval, Timer1 = 100, Timer2 = 200
|
980 | 944 |
|
981 | 945 | ```
|
982 | 946 | Starting ISR_16_Timers_Array_Complex on megaAVR Nano Every
|
983 |
| -megaAVR_TimerInterrupt v1.3.0 |
| 947 | +megaAVR_TimerInterrupt v1.4.0 |
984 | 948 | CPU Frequency = 16 MHz
|
985 | 949 | TCB Clock Frequency = 16MHz for highest accuracy
|
986 | 950 | Starting ITimer1 OK, millis() = 6
|
@@ -1066,7 +1030,7 @@ Timer : 15, programmed : 80000, actual : 80000
|
1066 | 1030 | ```
|
1067 | 1031 |
|
1068 | 1032 | Starting ISR_16_Timers_Array_Complex on megaAVR Nano Every
|
1069 |
| -megaAVR_TimerInterrupt v1.3.0 |
| 1033 | +megaAVR_TimerInterrupt v1.4.0 |
1070 | 1034 | CPU Frequency = 16 MHz
|
1071 | 1035 | TCB Clock Frequency = 8MHz for very high accuracy
|
1072 | 1036 | Starting ITimer1 OK, millis() = 10
|
@@ -1134,7 +1098,7 @@ Timer : 15, programmed : 80000, actual : 80000
|
1134 | 1098 |
|
1135 | 1099 | ```
|
1136 | 1100 | Starting ISR_16_Timers_Array_Complex on megaAVR Nano Every
|
1137 |
| -megaAVR_TimerInterrupt v1.3.0 |
| 1101 | +megaAVR_TimerInterrupt v1.4.0 |
1138 | 1102 | CPU Frequency = 16 MHz
|
1139 | 1103 | TCB Clock Frequency = 250KHz for lower accuracy but longer time
|
1140 | 1104 | Starting ITimer1 OK, millis() = 11
|
@@ -1212,6 +1176,40 @@ Timer : 14, programmed : 75000, actual : 75000
|
1212 | 1176 | Timer : 15, programmed : 80000, actual : 80004
|
1213 | 1177 | ```
|
1214 | 1178 |
|
| 1179 | +--- |
| 1180 | +
|
| 1181 | +### 4. Change_Interval_HF on Arduino megaAVR Nano Every |
| 1182 | +
|
| 1183 | +The following is the sample terminal output when running example [Change_Interval_HF](examples/Change_Interval_HF) on **Arduino megaAVR Nano Every** to demonstrate how to change High Frequency Timer Interval on-the-fly |
| 1184 | +
|
| 1185 | +``` |
| 1186 | +Starting Change_Interval_HF on megaAVR Nano Every |
| 1187 | +megaAVR_TimerInterrupt v1.4.0 |
| 1188 | +CPU Frequency = 16 MHz |
| 1189 | +TCB Clock Frequency = 16MHz for highest accuracy |
| 1190 | +[TISR] TCB 1 |
| 1191 | +[TISR] ================== |
| 1192 | +[TISR] Init, Timer = 1 |
| 1193 | +[TISR] CTRLB = 0 |
| 1194 | +[TISR] CCMP = 65535 |
| 1195 | +[TISR] INTCTRL = 0 |
| 1196 | +[TISR] CTRLA = 1 |
| 1197 | +[TISR] ================== |
| 1198 | +[TISR] Frequency = 10000.00 , CLK_TCB_FREQ = 16000000 |
| 1199 | +[TISR] setFrequency: _CCMPValueRemaining = 1600 |
| 1200 | +Starting ITimer1 OK, millis() = 12 |
| 1201 | +Frequency, Timer1 = 10000 |
| 1202 | +Time = 10001, Timer1Count = 99856 |
| 1203 | +Time = 20002, Timer1Count = 199807 |
| 1204 | +[TISR] Frequency = 5000.00 , CLK_TCB_FREQ = 16000000 |
| 1205 | +[TISR] setFrequency: _CCMPValueRemaining = 3200 |
| 1206 | +Changing Frequency, Timer1 = 5000 |
| 1207 | +Time = 30003, Timer1Count = 249792 |
| 1208 | +Time = 40004, Timer1Count = 299784 |
| 1209 | +[TISR] Frequency = 10000.00 , CLK_TCB_FREQ = 16000000 |
| 1210 | +[TISR] setFrequency: _CCMPValueRemaining = 1600 |
| 1211 | +Changing Frequency, Timer1 = 10000 |
| 1212 | +``` |
1215 | 1213 |
|
1216 | 1214 |
|
1217 | 1215 | ---
|
@@ -1241,44 +1239,6 @@ If you get compilation errors, more often than not, you may need to install a ne
|
1241 | 1239 | Sometimes, the library will only work if you update the board core to the latest version because I am using newly added functions.
|
1242 | 1240 |
|
1243 | 1241 |
|
1244 |
| ---- |
1245 |
| ---- |
1246 |
| - |
1247 |
| -## Releases |
1248 |
| - |
1249 |
| -### Release v1.3.0 |
1250 |
| - |
1251 |
| -1. Fix TCB Clock bug. Don't use v1.2.0 |
1252 |
| - |
1253 |
| -### Release v1.2.0 |
1254 |
| - |
1255 |
| -1. Selectable **TCB Clock 16MHz, 8MHz or 250KHz** depending on necessary accuracy |
1256 |
| -2. Add BOARD_NAME definition |
1257 |
| - |
1258 |
| -### Release v1.1.0 |
1259 |
| - |
1260 |
| -1. Fix bug. Don't use v1.0.0 |
1261 |
| - |
1262 |
| -### Initial Release v1.0.0 |
1263 |
| - |
1264 |
| -1. Intial release to support to ATmega4809-based boards, such as **Arduino UNO WiFi Rev2, AVR_NANO_EVERY, etc.** |
1265 |
| -2. New examples to support Blynk using [**WiFiNINA_Generic**](https://github.com/khoih-prog/WiFiNINA_Generic) and [**Blynk_WiFiNINA_WM**](https://github.com/khoih-prog/Blynk_WiFiNINA_WM) libraries. |
1266 |
| - |
1267 |
| -The [**ISR_Timer_Complex**](examples/ISR_Timer_Complex) example will demonstrate the nearly perfect accuracy compared to software timers by printing the actual elapsed millisecs of each type of timers. |
1268 |
| -Being ISR-based timers, their executions are not blocked by bad-behaving functions / tasks, such as connecting to WiFi, Internet and Blynk services. You can also have many `(up to 16)` timers to use. |
1269 |
| - |
1270 |
| -This non-being-blocked important feature is absolutely necessary for mission-critical tasks. |
1271 |
| - |
1272 |
| -You'll see blynkTimer Software is blocked while system is connecting to WiFi / Internet / Blynk, as well as by blocking task |
1273 |
| -in loop(), using delay() function as an example. The elapsed time then is very unaccurate |
1274 |
| - |
1275 |
| ---- |
1276 |
| - |
1277 |
| -### Currently supported Boards |
1278 |
| - |
1279 |
| -- **Arduino UNO WiFi Rev2, AVR_NANO_EVERY, etc.** |
1280 |
| -- ATmega4809-based boards. |
1281 |
| - |
1282 | 1242 | ---
|
1283 | 1243 | ---
|
1284 | 1244 |
|
@@ -1314,11 +1274,12 @@ Submit issues to: [megaAVR_TimerInterrupt issues](https://github.com/khoih-prog/
|
1314 | 1274 | Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library. Especially to these people who have directly or indirectly contributed to this [megaAVR_TimerInterrupt library](https://github.com/khoih-prog/megaAVR_TimerInterrupt)
|
1315 | 1275 |
|
1316 | 1276 | 1. Thanks to good work of [Miguel Wisintainer](https://github.com/tcpipchip) for initiating, inspriring, working with, developing, debugging, testing and maintaining.
|
1317 |
| - |
| 1277 | +2. Thanks to [Bill Wuttke](https://github.com/wcwuttke) to report the issue [Interrupt interval 2X requested interval #1](https://github.com/khoih-prog/megaAVR_TimerInterrupt/issues/1) leading to new release v1.4.0 to fix bug in using higher frequencies than 250Hz. |
1318 | 1278 |
|
1319 | 1279 | <table>
|
1320 | 1280 | <tr>
|
1321 | 1281 | <td align="center"><a href="https://github.com/tcpipchip"><img src="https://github.com/tcpipchip.png" width="100px;" alt="tcpipchip"/><br/><sub><b>⭐️ Miguel Wisintainer</b></sub></a><br/></td>
|
| 1282 | + <td align="center"><a href="https://github.com/wcwuttke"><img src="https://github.com/wcwuttke.png" width="100px;" alt="wcwuttke"/><br/><sub><b>Bill Wuttke</b></sub></a><br/></td> |
1322 | 1283 | </tr>
|
1323 | 1284 | </table>
|
1324 | 1285 |
|
|
0 commit comments