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

Commit 664fef0

Browse files
authored
v1.2.2 to add support to Seeeduino nRF52
### Releases v1.2.2 1. Add support to Seeeduino nRF52840-based boards such as **Seeed_XIAO_NRF52840 and Seeed_XIAO_NRF52840_SENSE**, etc. using Seeeduino `nRF52` core 2. Add astyle using `allman` style. Restyle the library 3. Update all examples 4. Update `Packages' Patches` to add Seeeduino `nRF52` core
1 parent 2c86fbf commit 664fef0

File tree

1 file changed

+50
-25
lines changed

1 file changed

+50
-25
lines changed

README.md

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ As more complex calculation and check **inside ISR** are introduced from v1.2.0,
6969
You can modify to use larger `HW_TIMER_INTERVAL_US`, (from current 10uS), according to your board and use-case if crash happens.
7070

7171

72-
```
72+
```cpp
7373
// Don't change these numbers to make higher Timer freq. System can hang
7474
#define HW_TIMER_INTERVAL_US 10L
7575
```
@@ -126,8 +126,9 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
126126

127127
### Currently supported Boards
128128

129-
1. **nRF52-based boards** such as **AdaFruit Itsy-Bitsy nRF52840, Feather nRF52840 Express**, etc., using [`Adafruit nRF52 core`](https://github.com/adafruit/Adafruit_nRF52_Arduino)
129+
1. **AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B302_ublox, NINA_B112_ublox etc.**
130130
2. **Sparkfun Pro nRF52840 Mini**
131+
3. **Seeeduino nRF52840-based boards such as SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE**, etc. using Seeeduino `nRF%2` core
131132

132133
---
133134

@@ -144,8 +145,9 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
144145

145146
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
146147
2. [`Adafruit nRF52 v1.3.0+`](https://github.com/adafruit/Adafruit_nRF52_Arduino) for nRF52 boards such as Adafruit NRF52840_FEATHER, NRF52832_FEATHER, NRF52840_FEATHER_SENSE, NRF52840_ITSYBITSY, NRF52840_CIRCUITPLAY, NRF52840_CLUE, NRF52840_METRO, NRF52840_PCA10056, PARTICLE_XENON, **NINA_B302_ublox**, etc. [![GitHub release](https://img.shields.io/github/release/adafruit/Adafruit_nRF52_Arduino.svg)](https://github.com/adafruit/Adafruit_nRF52_Arduino/releases/latest)
148+
3. [`Seeeduino nRF52 core 1.0.0+`](https://github.com/Seeed-Studio/Adafruit_nRF52_Arduino) for Seeeduino nRF52840-based boards such as **Seeed_XIAO_NRF52840 and Seeed_XIAO_NRF52840_SENSE**. [![GitHub release](https://img.shields.io/github/release/Seeed-Studio/Adafruit_nRF52_Arduino.svg)](https://github.com/Seeed-Studio/Adafruit_nRF52_Arduino/releases/latest)
147149

148-
3. To use with certain example
150+
4. To use with certain example
149151
- [`SimpleTimer library`](https://github.com/jfturcot/SimpleTimer) for [ISR_16_PWMs_Array_Complex example](examples/ISR_16_PWMs_Array_Complex).
150152

151153

@@ -164,9 +166,9 @@ You can also use this link [![arduino-library-badge](https://www.ardu-badge.com/
164166
Another way to install is to:
165167

166168
1. Navigate to [**nRF52_Slow_PWM**](https://github.com/khoih-prog/nRF52_Slow_PWM) page.
167-
2. Download the latest release `nRF52_Slow_PWM-master.zip`.
168-
3. Extract the zip file to `nRF52_Slow_PWM-master` directory
169-
4. Copy whole `nRF52_Slow_PWM-master` folder to Arduino libraries' directory such as `~/Arduino/libraries/`.
169+
2. Download the latest release `nRF52_Slow_PWM-main.zip`.
170+
3. Extract the zip file to `nRF52_Slow_PWM-main` directory
171+
4. Copy whole `nRF52_Slow_PWM-main` folder to Arduino libraries' directory such as `~/Arduino/libraries/`.
170172

171173
### VS Code & PlatformIO
172174

@@ -205,6 +207,26 @@ These files must be copied into the directory:
205207
- `~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B112_ublox/variant.cpp`
206208
- **`~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h`**
207209

210+
---
211+
212+
#### 2. For Seeeduino nRF52840 boards
213+
214+
**To be able to compile and run on Xiao nRF52840 boards**, you have to copy the whole [nRF52 1.0.0](Packages_Patches/Seeeduino/hardware/nrf52/1.0.0) directory into Seeeduino nRF52 directory (~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0).
215+
216+
Supposing the Seeeduino nRF52 version is 1.0.0. These files must be copied into the directory:
217+
218+
- **`~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/cores/nRF5/Print.h`**
219+
- **`~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/cores/nRF5/Print.cpp`**
220+
- **`~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/cores/nRF5/Udp.h`**
221+
222+
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.z
223+
These files must be copied into the directory:
224+
225+
- **`~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/cores/nRF5/Print.h`**
226+
- **`~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/cores/nRF5/Print.cpp`**
227+
- **`~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h`**
228+
229+
208230
---
209231

210232
To use `Sparkfun Pro nRF52840 Mini`, you must install `Packages_Patches` and use Adafruit nrf52 core v1.0.0+
@@ -218,14 +240,14 @@ The current library implementation, using `xyz-Impl.h` instead of standard `xyz.
218240

219241
You can include this `.hpp` file
220242

221-
```
243+
```cpp
222244
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
223245
#include "nRF52_Slow_PWM.hpp" //https://github.com/khoih-prog/nRF52_Slow_PWM
224246
```
225247

226248
in many files. But be sure to use the following `.h` file **in just 1 `.h`, `.cpp` or `.ino` file**, which must **not be included in any other file**, to avoid `Multiple Definitions` Linker Error
227249

228-
```
250+
```cpp
229251
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
230252
#include "nRF52_Slow_PWM.h" //https://github.com/khoih-prog/nRF52_Slow_PWM
231253
```
@@ -246,7 +268,7 @@ Before using any Timer, you have to make sure the Timer has not been used by any
246268

247269
#### 1. Init Hardware Timer
248270

249-
```
271+
```cpp
250272
// Depending on the board, you can select NRF52 Hardware Timer from NRF_TIMER_1-NRF_TIMER_4 (1 to 4)
251273
// If you select the already-used NRF_TIMER_0, it'll be auto modified to use NRF_TIMER_1
252274

@@ -259,7 +281,7 @@ NRF52_Slow_PWM ISR_PWM;
259281
260282
#### 2. Set PWM Frequency, dutycycle, attach irqCallbackStartFunc and irqCallbackStopFunc functions
261283
262-
```
284+
```cpp
263285
void irqCallbackStartFunc()
264286
{
265287
@@ -299,7 +321,7 @@ void setup()
299321

300322
### Example [ISR_16_PWMs_Array_Complex](examples/ISR_16_PWMs_Array_Complex)
301323

302-
https://github.com/khoih-prog/nRF52_Slow_PWM/blob/7b69f80edd248eb72236a2e74e8053cf43236286/examples/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino#L16-L581
324+
https://github.com/khoih-prog/nRF52_Slow_PWM/blob/2c86fbfde1ea38be2f4ff90c2ca818ca225e5315/examples/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino#L16-L595
303325

304326

305327
---
@@ -314,7 +336,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
314336

315337
```
316338
Starting ISR_16_PWMs_Array_Complex on NRF52840_ITSYBITSY
317-
NRF52_Slow_PWM v1.2.1
339+
NRF52_Slow_PWM v1.2.2
318340
[PWM] NRF52TimerInterrupt: Timer = NRF_TIMER3 , Timer Clock (Hz) = 16000000.00
319341
[PWM] Frequency = 200000.00 , _count = 80
320342
Starting ITimer OK, micros() =
@@ -395,7 +417,7 @@ The following is the sample terminal output when running example [**ISR_16_PWMs_
395417

396418
```
397419
Starting ISR_16_PWMs_Array on NRF52840_ITSYBITSY
398-
NRF52_Slow_PWM v1.2.1
420+
NRF52_Slow_PWM v1.2.2
399421
[PWM] NRF52TimerInterrupt: Timer = NRF_TIMER2 , Timer Clock (Hz) = 16000000.00
400422
[PWM] Frequency = 50000.00 , _count = 320
401423
Starting ITimer OK, micros() = 2889648
@@ -425,7 +447,7 @@ The following is the sample terminal output when running example [**ISR_16_PWMs_
425447

426448
```
427449
Starting ISR_16_PWMs_Array_Simple on NRF52840_ITSYBITSY
428-
NRF52_Slow_PWM v1.2.1
450+
NRF52_Slow_PWM v1.2.2
429451
[PWM] NRF52TimerInterrupt: Timer = NRF_TIMER2 , Timer Clock (Hz) = 16000000.00
430452
[PWM] Frequency = 50000.00 , _count = 320
431453
Starting ITimer OK, micros() = 2924804
@@ -455,7 +477,7 @@ The following is the sample terminal output when running example [ISR_Modify_PWM
455477

456478
```
457479
Starting ISR_Modify_PWM on NRF52840_ITSYBITSY
458-
NRF52_Slow_PWM v1.2.1
480+
NRF52_Slow_PWM v1.2.2
459481
[PWM] NRF52TimerInterrupt: Timer = NRF_TIMER2 , Timer Clock (Hz) = 16000000.00
460482
[PWM] Frequency = 50000.00 , _count = 320
461483
Starting ITimer OK, micros() = 3310546
@@ -495,7 +517,7 @@ The following is the sample terminal output when running example [ISR_Changing_P
495517

496518
```
497519
Starting ISR_Changing_PWM on NRF52840_ITSYBITSY
498-
NRF52_Slow_PWM v1.2.1
520+
NRF52_Slow_PWM v1.2.2
499521
[PWM] NRF52TimerInterrupt: Timer = NRF_TIMER2 , Timer Clock (Hz) = 16000000.00
500522
[PWM] Frequency = 50000.00 , _count = 320
501523
Starting ITimer OK, micros() = 2925781
@@ -558,15 +580,18 @@ Submit issues to: [nRF52_Slow_PWM issues](https://github.com/khoih-prog/nRF52_Sl
558580

559581
## DONE
560582

561-
1. Basic hardware multi-channel PWM for **nRF52-based AdaFruit Itsy-Bitsy nRF52840, Feather nRF52840 Express, etc.** using [`Adafruit nRF52 core`](https://github.com/adafruit/Adafruit_nRF52_Arduino)
562-
2. Add Table of Contents
563-
3. Add functions to modify PWM settings on-the-fly
564-
4. Fix `multiple-definitions` linker error
565-
5. Optimize library code by using `reference-passing` instead of `value-passing`
566-
6. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`
567-
7. DutyCycle to be optionally updated at the end current PWM period instead of immediately.
568-
8. Display informational warning only when `_PWM_LOGLEVEL_` > 3
569-
9. Add support to `Sparkfun Pro nRF52840 Mini`
583+
1. Basic hardware multi-channel PWM for **nRF52-based AdaFruit Itsy-Bitsy nRF52840, Feather nRF52840 Express, etc.** using [`Adafruit nRF52 core`](https://github.com/adafruit/Adafruit_nRF52_Arduino)
584+
2. Add Table of Contents
585+
3. Add functions to modify PWM settings on-the-fly
586+
4. Fix `multiple-definitions` linker error
587+
5. Optimize library code by using `reference-passing` instead of `value-passing`
588+
6. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`
589+
7. DutyCycle to be optionally updated at the end current PWM period instead of immediately.
590+
8. Display informational warning only when `_PWM_LOGLEVEL_` > 3
591+
9. Add support to `Sparkfun Pro nRF52840 Mini`
592+
10. Add support to Seeeduino nRF52840-based boards such as **SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE**, etc. using Seeeduino `nRF%2` core
593+
11. Add astyle using `allman` style. Restyle the library
594+
12. Add `Packages' Patches` to add Seeeduino `nRF52` core
570595

571596

572597
---

0 commit comments

Comments
 (0)