Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit b46195b

Browse files
authored
v1.0.1
### Releases v1.0.1 1. Add complicated example [ISR_16_Timers_Array](examples/ISR_16_Timers_Array) utilizing and demonstrating the full usage of 16 independent ISR Timers.
1 parent c77e743 commit b46195b

22 files changed

+762
-214
lines changed

README.md

Lines changed: 80 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
## Features
1313

14-
This library enables you to use Interrupt from Hardware Timers on an NRF52-based board.
14+
This library enables you to use Interrupt from Hardware Timers on an nRF52-based board, such as AdaFruit Itsy-Bitsy nRF52840, Feather nRF52840 Express, etc.
15+
16+
As **Hardware Timers are rare, and very precious assets** of any board, this library now enables you to use up to **16 ISR-based Timers, while consuming only 1 Hardware Timer**. Timers' interval is very long (**ulong millisecs**).
1517

1618
### Why do we need this Hardware Timer Interrupt?
1719

1820
Imagine you have a system with a **mission-critical** function, measuring water level and control the sump pump or doing something much more important. You normally use a software timer to poll, or even place the function in loop(). But what if another function is **blocking** the loop() or setup().
1921

20-
So your function **might not be executed, and the result would be disastrous.**
22+
So your function **might not be executed on-time or not at all, and the result would be disastrous.**
2123

2224
You'd prefer to have your function called, no matter what happening with other functions (busy loop, bug, etc.).
2325

@@ -42,6 +44,10 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
4244
---
4345
---
4446

47+
### Releases v1.0.1
48+
49+
1. Add complicated example [ISR_16_Timers_Array](examples/ISR_16_Timers_Array) utilizing and demonstrating the full usage of 16 independent ISR Timers.
50+
4551
### Releases v1.0.0
4652

4753
1. Permit up to 16 super-long-time, super-accurate ISR-based timers to avoid being blocked
@@ -67,7 +73,9 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
6773
- [`UIPEthernet library v2.0.9+`](https://github.com/UIPEthernet/UIPEthernet) for ENC28J60.
6874
5. [`WiFiNINA_Generic library v1.7.1+`](https://github.com/khoih-prog/WiFiNINA_Generic) to use WiFiNINA modules/shields. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiNINA_Generic.svg?)](https://www.ardu-badge.com/WiFiNINA_Generic) if using WiFiNINA for boards such as nRF52, etc.
6975
6. [`Blynk_WiFiNINA_WM library 1.0.4+`](hhttps://github.com/khoih-prog/Blynk_WiFiNINA_WM) to use with Blynk-WiFiNINA-related example. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/Blynk_WiFiNINA_WM.svg?)](https://www.ardu-badge.com/Blynk_WiFiNINA_WM)
70-
76+
7. To use with certain example
77+
- [`SimpleTimer library`](https://github.com/schinken/SimpleTimer) for [ISR_16_Timers_Array example](examples/ISR_16_Timers_Array).
78+
7179
---
7280
---
7381

@@ -207,7 +215,7 @@ To re-use the **new h-only** way, just
207215
Now with these new `16 ISR-based timers` (while consuming only **1 hardware timer**), the maximum interval is practically unlimited (limited only by unsigned long miliseconds). The accuracy is nearly perfect compared to software timers. The most important feature is they're ISR-based timers Therefore, their executions are not blocked by bad-behaving functions / tasks.
208216
This important feature is absolutely necessary for mission-critical tasks.
209217

210-
The [**ISR_Timer_Complex_Ethernet**](examples/ISR_Timer_Complex_Ethernet) and [**ISR_Timer_Complex_WiFiNINA**](examples/ISR_Timer_Complex_WiFiNINA) examples will demonstrate the nearly perfect accuracy compared to software timers by printing the actual elapsed millisecs of each type of timers.
218+
The [**ISR_16_Timers_Array**](examples/ISR_16_Timers_Array), [**ISR_Timer_Complex_Ethernet**](examples/ISR_Timer_Complex_Ethernet) and [**ISR_Timer_Complex_WiFiNINA**](examples/ISR_Timer_Complex_WiFiNINA) examples will demonstrate the nearly perfect accuracy compared to software timers by printing the actual elapsed millisecs of each type of timers.
211219
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.
212220
This non-being-blocked important feature is absolutely necessary for mission-critical tasks.
213221
You'll see blynkTimer Software is blocked while system is connecting to WiFi / Internet / Blynk, as well as by blocking task
@@ -341,13 +349,14 @@ void setup()
341349
### Examples:
342350

343351
1. [Argument_None](examples/Argument_None)
344-
2. [ISR_RPM_Measure](examples/ISR_RPM_Measure)
345-
3. [ISR_Timer_Complex_Ethernet](examples/ISR_Timer_Complex_Ethernet)
346-
4. [ISR_Timer_Complex_WiFiNINA](examples/ISR_Timer_Complex_WiFiNINA)
347-
5. [RPM_Measure](examples/RPM_Measure)
348-
6. [SwitchDebounce](examples/SwitchDebounce)
349-
7. [TimerInterruptTest](examples/TimerInterruptTest)
350-
8. [TimerInterruptLEDDemo](examples/TimerInterruptLEDDemo)
352+
2. [ISR_16_Timers_Array](examples/ISR_16_Timers_Array)
353+
3. [ISR_RPM_Measure](examples/ISR_RPM_Measure)
354+
4. [ISR_Timer_Complex_Ethernet](examples/ISR_Timer_Complex_Ethernet)
355+
5. [ISR_Timer_Complex_WiFiNINA](examples/ISR_Timer_Complex_WiFiNINA)
356+
6. [RPM_Measure](examples/RPM_Measure)
357+
7. [SwitchDebounce](examples/SwitchDebounce)
358+
8. [TimerInterruptTest](examples/TimerInterruptTest)
359+
9. [TimerInterruptLEDDemo](examples/TimerInterruptLEDDemo)
351360

352361

353362
---
@@ -831,10 +840,63 @@ ITimer0: millis() = 30950, delta = 1000
831840
ITimer0: millis() = 31950, delta = 1000
832841
ITimer0: millis() = 32950, delta = 1000
833842
843+
```
844+
845+
4. The following is the sample terminal output when running example [ISR_16_Timers_Array](examples/ISR_16_Timers_Array) on **Adafruit NRF52840_ITSYBITSY** to demonstrate the accuracy of ISR Hardware Timer, **especially when system is very busy or blocked**. The 16 independent ISR timers are **programmed to be activated repetitively after certain intervals, is activated exactly after that programmed interval !!!**
846+
847+
While software timer, **programmed for 2s, is activated after 10.000s in loop()!!!**.
848+
849+
In this example, 16 independent ISR Timers are used, yet utilized just one Hardware Timer. The Timer Intervals and Function Pointers are stored in arrays to facilitate the code modification.
850+
851+
852+
```
853+
Starting ISR_16_Timers_Array on NRF52840_ITSYBITSY
854+
Version : 1.0.1
855+
CPU Frequency = 64 MHz
856+
NRF52TimerInterrupt: F_CPU (MHz) = 64, Timer = NRF_TIMER2
857+
NRF52TimerInterrupt: _fre = 1000000.00, _count = 1000
858+
Starting ITimer OK, millis() = 915
859+
5s: Delta ms = 5000, ms = 5915
860+
simpleTimer2s:Dms=10001
861+
5s: Delta ms = 5001, ms = 10916
862+
5s: Delta ms = 4999, ms = 15915
863+
5s: Delta ms = 5000, ms = 20915
864+
simpleTimer2s:Dms=10003
865+
5s: Delta ms = 5000, ms = 25915
866+
5s: Delta ms = 5000, ms = 30915
867+
simpleTimer2s:Dms=10000
868+
5s: Delta ms = 5000, ms = 35915
869+
5s: Delta ms = 5000, ms = 40915
870+
simpleTimer2s:Dms=10000
871+
5s: Delta ms = 5000, ms = 45915
872+
5s: Delta ms = 5000, ms = 50915
873+
simpleTimer2s:Dms=10004
874+
5s: Delta ms = 5000, ms = 55915
875+
5s: Delta ms = 5000, ms = 60915
876+
simpleTimer2s:Dms=10001
877+
5s: Delta ms = 5000, ms = 65915
878+
5s: Delta ms = 5000, ms = 70915
879+
simpleTimer2s:Dms=10005
880+
5s: Delta ms = 5000, ms = 75915
881+
5s: Delta ms = 5000, ms = 80915
882+
simpleTimer2s:Dms=10004
883+
5s: Delta ms = 5000, ms = 85915
884+
5s: Delta ms = 5000, ms = 90915
885+
simpleTimer2s:Dms=10000
886+
5s: Delta ms = 5001, ms = 95916
887+
5s: Delta ms = 4999, ms = 100915
888+
simpleTimer2s:Dms=10004
889+
5s: Delta ms = 5000, ms = 105915
890+
5s: Delta ms = 5000, ms = 110915
891+
simpleTimer2s:Dms=10004
834892
```
835893
---
836894
---
837895

896+
### Releases v1.0.1
897+
898+
1. Add complicated example [ISR_16_Timers_Array](examples/ISR_16_Timers_Array) utilizing and demonstrating the full usage of 16 independent ISR Timers.
899+
838900
### Releases v1.0.0
839901

840902
1. Permit up to 16 super-long-time, super-accurate ISR-based timers to avoid being blocked
@@ -860,8 +922,6 @@ Submit issues to: [NRF52_TimerInterrupt issues](https://github.com/khoih-prog/NR
860922

861923
## DONE
862924

863-
For current version v1.0.0
864-
865925
1. Basic hardware timers for NRF52832 and NRF52840.
866926
2. More hardware-initiated software-enabled timers
867927
3. Longer time interval
@@ -873,6 +933,13 @@ For current version v1.0.0
873933

874934
Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library.
875935

936+
1. Thanks to good work of [Miguel Wisintainer](https://github.com/tcpipchip) for working with, developing, debugging and testing.
937+
938+
<table>
939+
<tr>
940+
<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>
941+
</tr>
942+
</table>
876943

877944
---
878945

examples/Argument_None/Argument_None.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
Based on BlynkTimer.h
2020
Author: Volodymyr Shymanskyy
2121
22-
Version: 1.0.0
22+
Version: 1.0.1
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
2626
1.0.0 K Hoang 02/11/2020 Initial coding
27+
1.0.1 K Hoang 06/11/2020 Add complicated example ISR_16_Timers_Array using all 16 independent ISR Timers.
2728
*****************************************************************************************************************************/
2829

2930
/*

0 commit comments

Comments
 (0)