You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 29, 2023. It is now read-only.
### Releases v1.9.0
1. Add TC4, TC5, TCC1 and TCC2 Timers to SAMD21
2. Add example [SAMD21_MultiTimers](examples/SAMD21_MultiTimers) to demo the how to use all 6 SAMD21 timers simultaneously.
3. Add functions `attachInterruptInterval_MS()` and `setInterval_MS()`
4. Rewrite examples to take advantage of new functions and timers
*[1. ISR_Timer_Complex_WiFiNINA on Arduino SAMD21 SAMD_NANO_33_IOT using WiFiNINA](#1-isr_timer_complex_wifinina-on-arduino-samd21-samd_nano_33_iot-using-wifinina)
@@ -393,10 +394,20 @@ Before using any Timer, you have to make sure the Timer has not been used by any
393
394
#### 1.1 Init Hardware Timer
394
395
395
396
```
396
-
// Depending on the board, you can select SAMD21 Hardware Timer from TC3-TCC
397
-
// SAMD21 Hardware Timer from TC3 or TCC
397
+
// Depending on the board, you can select SAMD21 Hardware Timer from TC3, TC4, TC5, TCC, TCC1 or TCC2
398
398
// SAMD51 Hardware Timer only TC3
399
-
SAMDTimer ITimer0(TIMER_TC3);
399
+
400
+
// Init SAMD timer TIMER_TC3
401
+
SAMDTimer ITimer(TIMER_TC3);
402
+
403
+
#if (TIMER_INTERRUPT_USING_SAMD21)
404
+
// Init SAMD timer TIMER_TCC
405
+
//SAMDTimer ITimer(TIMER_TC4);
406
+
//SAMDTimer ITimer(TIMER_TC5);
407
+
//SAMDTimer ITimer(TIMER_TCC);
408
+
//SAMDTimer ITimer(TIMER_TCC1);
409
+
//SAMDTimer ITimer(TIMER_TCC2);
410
+
#endif
400
411
```
401
412
402
413
#### 1.2 Set Hardware Timer Interval and attach Timer Interrupt Handler function
@@ -413,7 +424,7 @@ void setup()
413
424
....
414
425
415
426
// Interval in microsecs
416
-
if (ITimer0.attachInterruptInterval(TIMER0_INTERVAL_MS * 1000, TimerHandler0))
427
+
if (ITimer0.attachInterruptInterval_MS(TIMER0_INTERVAL_MS, TimerHandler0))
### 7. SAMD21_MultiTimers on SAMD21 SAMD_NANO_33_IOT
1006
+
1007
+
The following is the sample terminal output when running example [SAMD21_MultiTimers](examples/SAMD21_MultiTimers) on **SAMD_NANO_33_IOT** to demonstrate demo the how to use all **6 SAMD21 timers simultaneously**.
[TISR] SAMD21 TCC2 period = 1000000.00 , _prescaler = 1024
1051
+
[TISR] _compareValue = 46874
1052
+
Starting TIMER_TCC2 OK, millis() = 971
1053
+
========================================
1054
+
TC3 Actual/Programmed (ms) 20/20
1055
+
TC4 Actual/Programmed (ms) 50/50
1056
+
TC5 Actual/Programmed (ms) 100/100
1057
+
TCC Actual/Programmed (ms) 200/200
1058
+
TCC1 Actual/Programmed (ms) 500/500
1059
+
TCC2 Actual/Programmed (ms) 1000/1000
1060
+
========================================
1061
+
TC3 Actual/Programmed (ms) 20/20
1062
+
TC4 Actual/Programmed (ms) 50/50
1063
+
TC5 Actual/Programmed (ms) 100/100
1064
+
TCC Actual/Programmed (ms) 200/200
1065
+
TCC1 Actual/Programmed (ms) 500/500
1066
+
TCC2 Actual/Programmed (ms) 1000/1000
1067
+
```
1068
+
1069
+
980
1070
---
981
1071
---
982
1072
@@ -1009,13 +1099,16 @@ Sometimes, the library will only work if you update the board core to the latest
1009
1099
1010
1100
Submit issues to: [SAMD_TimerInterrupt issues](https://github.com/khoih-prog/SAMD_TimerInterrupt/issues)
1011
1101
1102
+
---
1012
1103
---
1013
1104
1014
1105
## TO DO
1015
1106
1016
1107
1. Search for bug and improvement.
1017
1108
2. Similar features for remaining Arduino boards such as SAM-DUE
1109
+
3. Add more Timers to SAMD51
1018
1110
1111
+
---
1019
1112
1020
1113
## DONE
1021
1114
@@ -1030,6 +1123,10 @@ Submit issues to: [SAMD_TimerInterrupt issues](https://github.com/khoih-prog/SAM
1030
1123
8. Optimize library code by using `reference-passing` instead of `value-passing`
1031
1124
9. Optimize code for `setInterval()` of SAMD21 TC3
1032
1125
10. Reverse the change in `setInterval()` of SAMD21 TC3 to fix bug when using SAMD21 TC3.
1126
+
11. Add TC4, TC5, TCC1 and TCC2 Timers to SAMD21
1127
+
12. Add example [SAMD21_MultiTimers](examples/SAMD21_MultiTimers) to demo the how to use all 6 SAMD21 timers simultaneously.
1128
+
13. Add functions `attachInterruptInterval_MS()` and `setInterval_MS()`
1129
+
1033
1130
1034
1131
---
1035
1132
---
@@ -1048,6 +1145,7 @@ Many thanks for everyone for bug reporting, new feature suggesting, testing and
1048
1145
8. Thanks to [Dave Hooper](https://github.com/stripwax) to report the bug and propose the fix in [setInterval on a running timer results in a period significantly longer than the specified period #17](https://github.com/khoih-prog/SAMD_TimerInterrupt/issues/17) leading to new release v1.7.0
1049
1146
9. Thanks to [Rui Marinheiro](https://github.com/sailorsail) to start the discussion in [Do I have a brick? I'm unable to upload sketches after using this library! #21](https://github.com/khoih-prog/SAMD_TimerInterrupt/discussions/21) leading to new release v1.8.0 to fix the bug
1050
1147
1148
+
---
1051
1149
1052
1150
<table>
1053
1151
<tr>
@@ -1065,6 +1163,7 @@ Many thanks for everyone for bug reporting, new feature suggesting, testing and
0 commit comments