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.
* Contextual information (e.g. what you were trying to achieve)
20
20
* Simplest possible steps to reproduce
21
21
* Anything that might be relevant in your opinion, such as:
@@ -27,9 +27,9 @@ Please ensure to specify the following:
27
27
28
28
```
29
29
Arduino IDE version: 1.8.16
30
-
Arduino NRF52 Core Version 1.0.0
30
+
Arduino AVR core v1.8.3
31
31
OS: Ubuntu 20.04 LTS
32
-
Linux xy-Inspiron-3593 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
32
+
Linux xy-Inspiron-3593 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
33
33
34
34
Context:
35
35
I encountered a crash while trying to use the Timer Interrupt.
@@ -44,7 +44,7 @@ Steps to reproduce:
44
44
45
45
Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.
46
46
47
-
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/nRF52_Slow_PWM/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
47
+
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/AVR_Slow_PWM/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
Copy file name to clipboardExpand all lines: README.md
+70-14Lines changed: 70 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,14 +33,18 @@
33
33
*[1. Init Hardware Timer](#1-init-hardware-timer)
34
34
*[2. Set PWM Frequency, dutycycle, attach irqCallbackStartFunc and irqCallbackStopFunc functions](#2-Set-PWM-Frequency-dutycycle-attach-irqCallbackStartFunc-and-irqCallbackStopFunc-functions)
*[1. ISR_8_PWMs_Array_Complex on Arduino AVR Leonardo ATMega32U4](#1-ISR_8_PWMs_Array_Complex-on-Arduino-AVR-Leonardo-ATMega32U4)
42
44
*[2. ISR_8_PWMs_Array on Arduino AVR Mega2560/ADK](#2-isr_8_pwms_array-on-avr-mega2560adk)
43
45
*[3. ISR_8_PWMs_Array_Simple on Arduino AVR Nano](#3-ISR_8_PWMs_Array_Simple-on-Arduino-AVR-Nano)
46
+
*[4. ISR_Modify_PWM on Arduino AVR Mega2560/ADK](#4-ISR_Modify_PWM-on-avr-mega2560adk)
47
+
*[5. ISR_Changing_PWM on Arduino AVR Mega2560/ADK](#5-ISR_Changing_PWM-on-avr-mega2560adk)
44
48
*[Debug](#debug)
45
49
*[Troubleshooting](#troubleshooting)
46
50
*[Issues](#issues)
@@ -58,7 +62,7 @@
58
62
59
63
### Features
60
64
61
-
This library enables you to use ISR-based PWM channels on AVR-based boards, such as Mega-2560, UNO,Nano, Leonardo, etc., using AVR core to create and output PWM any GPIO pin. Because this library doesn't use the powerful purely hardware-controlled PWM with many limitations, the maximum PWM frequency is currently limited at **500Hz**, which is still suitable for many real-life applications.
65
+
This library enables you to use ISR-based PWM channels on AVR-based boards, such as Mega-2560, UNO,Nano, Leonardo, etc., using AVR core to create and output PWM any GPIO pin. Because this library doesn't use the powerful purely hardware-controlled PWM with many limitations, the maximum PWM frequency is currently limited at **500Hz**, which is still suitable for many real-life applications. Now you can also modify PWM settings on-the-fly.
62
66
63
67
---
64
68
@@ -103,7 +107,7 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
103
107
104
108
### Currently supported Boards
105
109
106
-
1.**AVR-based boards** such as **Mega-2560, UNO,Nano, Leonardo**, etc., using AVR core
110
+
1.**AVR-based boards**using ATMEGA_328P, ATMEGA_2560, ATMEGA_1280, ATMEGA_640, ATMEGA_16U4, ATMEGA_32U4, etc. boards such as **Mega-2560, UNO,Nano, Leonardo**, etc., using **Arduino, Adafruit or Sparkfun AVR core**
107
111
108
112
---
109
113
@@ -120,7 +124,7 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
120
124
121
125
1.[`Arduino IDE 1.8.16+` for Arduino](https://www.arduino.cc/en/Main/Software)
122
126
2.[`Arduino AVR core 1.8.3+`](https://github.com/arduino/ArduinoCore-avr) for Arduino AVR boards. Use Arduino Board Manager to install. [](https://github.com/arduino/ArduinoCore-avr/releases/latest/)
123
-
3.[`Adafruit AVR core 1.4.13+`](https://github.com/adafruit/Adafruit_Arduino_Boards) for Adafruit AVR boards. Use Arduino Board Manager to install.
127
+
3.[`Adafruit AVR core 1.4.14+`](https://github.com/adafruit/Adafruit_Arduino_Boards) for Adafruit AVR boards. Use Arduino Board Manager to install.
124
128
4.[`Sparkfun AVR core 1.1.13+`](https://github.com/sparkfun/Arduino_Boards) for Sparkfun AVR boards. Use Arduino Board Manager to install.
// You can assign any interval for any timer here, in Hz
410
-
uint32_t PWM_Freq[NUMBER_ISR_PWMS] =
415
+
double PWM_Freq[NUMBER_ISR_PWMS] =
411
416
{
412
-
1, 2, 3, 4, 5, 6, 7, 8
417
+
1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f,
413
418
};
414
419
415
420
// You can assign any interval for any timer here, in Microseconds
@@ -770,7 +775,7 @@ The following is the sample terminal output when running example [ISR_8_PWMs_Arr
770
775
771
776
```
772
777
Starting ISR_8_PWMs_Array_Complex on Arduino AVR ATMega32U4
773
-
AVR_Slow_PWM v1.0.0
778
+
AVR_Slow_PWM v1.1.0
774
779
CPU Frequency = 16 MHz
775
780
[PWM] T3
776
781
[PWM] Freq * 1000 = 10000000.00
@@ -815,7 +820,7 @@ The following is the sample terminal output when running example [**ISR_8_PWMs_A
815
820
816
821
```
817
822
Starting ISR_8_PWMs_Array_Complex on Arduino AVR Mega2560/ADK
818
-
AVR_Slow_PWM v1.0.0
823
+
AVR_Slow_PWM v1.1.0
819
824
CPU Frequency = 16 MHz
820
825
[PWM] T3
821
826
[PWM] Freq * 1000 = 10000000.00
@@ -856,11 +861,11 @@ PWM Channel : 7, prog Period (ms): 125.00, actual : 125008, prog DutyCycle : 45,
856
861
857
862
### 3. ISR_8_PWMs_Array_Simple on Arduino AVR Nano
858
863
859
-
The following is the sample terminal output when running example [**ISR_8_PWMs_Array_Simple**](examples/ISR_8_PWMs_Array_Simple) on **nRF52-based NRF52840_ITSYBITSY** to demonstrate how to use multiple PWM channels.
864
+
The following is the sample terminal output when running example [**ISR_8_PWMs_Array_Simple**](examples/ISR_8_PWMs_Array_Simple) on **Arduino AVR UNO** to demonstrate how to use multiple PWM channels.
860
865
861
866
```
862
867
Starting ISR_8_PWMs_Array_Complex on Arduino AVR UNO, Nano, etc.
863
-
AVR_Slow_PWM v1.0.0
868
+
AVR_Slow_PWM v1.1.0
864
869
CPU Frequency = 16 MHz
865
870
[PWM] T1
866
871
[PWM] Freq * 1000 = 10000000.00
@@ -898,6 +903,56 @@ PWM Channel : 6, prog Period (ms): 142.86, actual : 143012, prog DutyCycle : 40,
898
903
PWM Channel : 7, prog Period (ms): 125.00, actual : 125012, prog DutyCycle : 45, actual : 44.95
899
904
```
900
905
906
+
---
907
+
908
+
### 4. ISR_Modify_PWM on AVR Mega2560/ADK
909
+
910
+
The following is the sample terminal output when running example [ISR_Modify_PWM](examples/ISR_Modify_PWM) on **AVR Mega2560/ADK** to demonstrate how to modify PWM settings on-the-fly without deleting the PWM channel
911
+
912
+
```
913
+
Starting ISR_Modify_PWM on Arduino AVR Mega2560/ADK
The following is the sample terminal output when running example [ISR_Changing_PWM](examples/ISR_Changing_PWM) on **AVR Mega2560/ADK** to demonstrate how to modify PWM settings on-the-fly by deleting the PWM channel and reinit the PWM channel
935
+
936
+
```
937
+
Starting ISR_Changing_PWM on Arduino AVR Mega2560/ADK
0 commit comments