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

Commit

Permalink
v1.1.0 for AVRDD
Browse files Browse the repository at this point in the history
### Release v1.1.0

1. Add support to AVRDD (AVR64DD, AVR32DD, AVR16DD, etc.)
  • Loading branch information
khoih-prog committed Dec 31, 2022
1 parent f58982f commit 4cf1091
Show file tree
Hide file tree
Showing 17 changed files with 440 additions and 449 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
Please ensure to specify the following:

* Arduino IDE version (e.g. 1.8.19) or Platform.io version
* `DxCore` or `megaTinyCore` Core Version (e.g. Arduino DxCore core v1.4.10)
* `DxCore` Core Version (e.g. Arduino DxCore core v1.5.1)
* Board (e.g. AVR128DA64, AVR128DB48, AVR64DB32, etc.)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
* Operating system (Windows, Ubuntu, etc.) and the output of `uname -a`
* Network configuration

Please be educated, civilized and constructive. Disrespective posts against [GitHub Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-event-code-of-conduct) will be ignored and deleted.

### Example

```
Arduino IDE version: 1.8.19
Arduino DxCore core v1.4.10
OS: Ubuntu 20.04 LTS
Arduino DxCore core v1.5.1
Board: Curiosity AVR128DB48
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Linux xy-Inspiron-3593 5.15.0-56-generic #62~20.04.1-Ubuntu SMP Tue Nov 22 21:24:20 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Context:
I encountered a crash while using this library
Expand Down
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>


---
---

## Table of Contents

* [Changelog](#changelog)

* [Release v1.1.0](#release-v110)
* [Release v1.0.2](#release-v102)
* [Release v1.0.1](#release-v101)
* [Initial Release v1.0.0](#initial-release-v100)
Expand All @@ -26,6 +27,9 @@

## Changelog

### Release v1.1.0

1. Add support to AVRDD (AVR64DD, AVR32DD, AVR16DD, etc.)

### Release v1.0.2

Expand Down
4 changes: 2 additions & 2 deletions examples/ISR_8_PWMs_Array/ISR_8_PWMs_Array.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Important Note: To use drag-and-drop into CURIOSITY virtual drive if you can program via Arduino IDE
// For example, check https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB48-Curiosity-Nano-HW-UserG-DS50003037A.pdf

#if !( defined(DXCORE) || defined(MEGATINYCORE) )
#error This is designed only for DXCORE or MEGATINYCORE megaAVR board! Please check your Tools->Board setting
#if !defined(DXCORE)
#error This is designed only for DXCORE megaAVR board! Please check your Tools->Board setting
#endif

// These define's must be placed at the beginning before #include "Dx_Slow_PWM.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Important Note: To use drag-and-drop into CURIOSITY virtual drive if you can program via Arduino IDE
// For example, check https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB48-Curiosity-Nano-HW-UserG-DS50003037A.pdf

#if !( defined(DXCORE) || defined(MEGATINYCORE) )
#error This is designed only for DXCORE or MEGATINYCORE megaAVR board! Please check your Tools->Board setting
#if !defined(DXCORE)
#error This is designed only for DXCORE megaAVR board! Please check your Tools->Board setting
#endif

// These define's must be placed at the beginning before #include "Dx_Slow_PWM.h"
Expand Down
4 changes: 2 additions & 2 deletions examples/ISR_8_PWMs_Array_Simple/ISR_8_PWMs_Array_Simple.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Important Note: To use drag-and-drop into CURIOSITY virtual drive if you can program via Arduino IDE
// For example, check https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB48-Curiosity-Nano-HW-UserG-DS50003037A.pdf

#if !( defined(DXCORE) || defined(MEGATINYCORE) )
#error This is designed only for DXCORE or MEGATINYCORE megaAVR board! Please check your Tools->Board setting
#if !defined(DXCORE)
#error This is designed only for DXCORE megaAVR board! Please check your Tools->Board setting
#endif

// These define's must be placed at the beginning before #include "Dx_Slow_PWM.h"
Expand Down
4 changes: 2 additions & 2 deletions examples/ISR_Changing_PWM/ISR_Changing_PWM.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Important Note: To use drag-and-drop into CURIOSITY virtual drive if you can program via Arduino IDE
// For example, check https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB48-Curiosity-Nano-HW-UserG-DS50003037A.pdf

#if !( defined(DXCORE) || defined(MEGATINYCORE) )
#error This is designed only for DXCORE or MEGATINYCORE megaAVR board! Please check your Tools->Board setting
#if !defined(DXCORE)
#error This is designed only for DXCORE megaAVR board! Please check your Tools->Board setting
#endif

// These define's must be placed at the beginning before #include "Dx_Slow_PWM.h"
Expand Down
4 changes: 2 additions & 2 deletions examples/ISR_Modify_PWM/ISR_Modify_PWM.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Important Note: To use drag-and-drop into CURIOSITY virtual drive if you can program via Arduino IDE
// For example, check https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB48-Curiosity-Nano-HW-UserG-DS50003037A.pdf

#if !( defined(DXCORE) || defined(MEGATINYCORE) )
#error This is designed only for DXCORE or MEGATINYCORE megaAVR board! Please check your Tools->Board setting
#if !defined(DXCORE)
#error This is designed only for DXCORE megaAVR board! Please check your Tools->Board setting
#endif

// These define's must be placed at the beginning before #include "Dx_Slow_PWM.h"
Expand Down
17 changes: 2 additions & 15 deletions examples/multiFileProject/multiFileProject.ino
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/****************************************************************************************************************************
multiFileProject.ino
For Arduino AVRDx-based boards (AVR128Dx, AVR64Dx, AVR32Dx, etc.) using DxCore
Written by Khoi Hoang
Built by Khoi Hoang https://github.com/khoih-prog/Dx_Slow_PWM
Licensed under MIT license
*****************************************************************************************************************************/

// Important Note: To use drag-and-drop into CURIOSITY virtual drive if you can program via Arduino IDE
// For example, check https://ww1.microchip.com/downloads/en/DeviceDoc/AVR128DB48-Curiosity-Nano-HW-UserG-DS50003037A.pdf

#if !( defined(DXCORE) || defined(MEGATINYCORE) )
#error This is designed only for DXCORE or MEGATINYCORE megaAVR board! Please check your Tools->Board setting
#if !defined(DXCORE)
#error This is designed only for DXCORE megaAVR board! Please check your Tools->Board setting
#endif

#define DX_SLOW_PWM_VERSION_MIN_TARGET F("Dx_Slow_PWM v1.0.1")
Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Dx_Slow_PWM",
"version": "1.0.2",
"version": "1.1.0",
"keywords": "timer, interrupt, hardware, isr, isr-based, pwm, isr-based-pwm, timing, control, device, hardware-timer, mission-critical, accuracy, precise, megaavr, avr-da, avr-db, avr-dd, dxcore, avr128dx, avr64dx, avr32dx, megatinycore, dx-timerinterrupt, tcb-timers",
"description": "This library enables you to use ISR-based PWM channels on Arduino AVRDx-based boards (AVR128Dx, AVR64Dx, AVR32Dx, etc.), using DxCore, to create and output PWM any GPIO pin. It now supports 64 ISR-based PWM channels, while consuming only 1 Hardware Timer. PWM channel interval can be very long (ulong microsecs / millisecs). The most important feature is they're ISR-based PWM channels, supporting lower PWM frequencies with suitable accuracy. Their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. These ISR-based PWMs, still work even if other software functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software-based PWM using millis() or micros(). That's necessary if you need to control devices requiring high precision. Now you can change the PWM settings on-the-fly.",
"description": "This library enables you to use ISR-based PWM channels on Arduino AVRDx-based boards (AVR128Dx, AVR64Dx, AVR32Dx, etc.), using DxCore, to create and output PWM any GPIO pin. It now supports 64 ISR-based PWM channels, while consuming only 1 Hardware Timer. PWM channel interval can be very long (ulong microsecs / millisecs). The most important feature is they're ISR-based PWM channels, supporting lower PWM frequencies with suitable accuracy. Their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. These ISR-based PWMs, still work even if other software functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software-based PWM using millis() or micros(). That's necessary if you need to control devices requiring high precision. Now you can change the PWM settings on-the-fly. Now supporting AVRDD",
"authors":
{
"name": "Khoi Hoang",
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=Dx_Slow_PWM
version=1.0.2
version=1.1.0
author=Khoi Hoang
maintainer=Khoi Hoang <[email protected]>
sentence=This library enables you to use ISR-based PWM channels on Arduino AVRDx-based boards (AVR128Dx, AVR64Dx, AVR32Dx, etc.), using DxCore, to create and output PWM any GPIO pin.
paragraph=It now supports 64 ISR-based PWM channels, while consuming only 1 Hardware Timer. PWM channel interval can be very long (ulong microsecs / millisecs). The most important feature is they're ISR-based PWM channels, supporting lower PWM frequencies with suitable accuracy. Their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. These ISR-based PWMs, still work even if other software functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software-based PWM using millis() or micros(). That's necessary if you need to control devices requiring high precision. Now you can change the PWM settings on-the-fly.
paragraph=It now supports 64 ISR-based PWM channels, while consuming only 1 Hardware Timer. PWM channel interval can be very long (ulong microsecs / millisecs). The most important feature is they are ISR-based PWM channels, supporting lower PWM frequencies with suitable accuracy. Their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. These ISR-based PWMs, still work even if other software functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software-based PWM using millis() or micros(). That is necessary if you need to control devices requiring high precision. Now you can change the PWM settings on-the-fly. Now supporting AVRDD
category=Device Control
url=https://github.com/khoih-prog/Dx_Slow_PWM
architectures=megaavr
Expand Down
5 changes: 3 additions & 2 deletions src/Dx_Slow_PWM.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
Built by Khoi Hoang https://github.com/khoih-prog/Dx_Slow_PWM
Licensed under MIT license
Now even you use all these new 16 ISR-based timers,with their maximum interval practically unlimited (limited only by
unsigned long miliseconds), you just consume only one AVRDx-based timer and avoid conflicting with other cores' tasks.
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.
This important feature is absolutely necessary for mission-critical tasks.
Version: 1.0.2
Version: 1.1.0
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K.Hoang 25/08/2022 Initial coding to support AVR Dx (AVR128Dx, AVR64Dx, AVR32Dx, etc.) using DxCore
1.0.1 K.Hoang 25/08/2022 Make MAX_NUMBER_CHANNELS configurable to max 64 PWM channels
1.0.2 K.Hoang 25/08/2022 Minor cosmetic fix
1.1.0 K.Hoang 30/12/2022 Add support to AVR DD (AVR64DD, AVR32DDx, AVR16DD, etc.) using breaking DxCore v1.5.1+
*****************************************************************************************************************************/

#pragma once
Expand Down
38 changes: 20 additions & 18 deletions src/Dx_Slow_PWM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
Therefore, their executions are not blocked by bad-behaving functions / tasks.
This important feature is absolutely necessary for mission-critical tasks.
Version: 1.0.2
Version: 1.1.0
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K.Hoang 25/08/2022 Initial coding to support AVR Dx (AVR128Dx, AVR64Dx, AVR32Dx, etc.) using DxCore
1.0.1 K.Hoang 25/08/2022 Make MAX_NUMBER_CHANNELS configurable to max 64 PWM channels
1.0.2 K.Hoang 25/08/2022 Minor cosmetic fix
1.1.0 K.Hoang 30/12/2022 Add support to AVR DD (AVR64DD, AVR32DDx, AVR16DD, etc.) using breaking DxCore v1.5.1+
*****************************************************************************************************************************/

#pragma once
Expand Down Expand Up @@ -54,13 +55,22 @@

#elif ( defined(__AVR_AVR64DD32__) || defined(__AVR_AVR64DD28__) || defined(__AVR_AVR64DD20__) || defined(__AVR_AVR64DD14__) )
#define BOARD_NAME F("AVR64DD")
#error AVR64DD not supported yet by the DxCore

#if ( (DXCORE_MAJOR == 1) && (DXCORE_MINOR < 5) )
#error AVR64DD not supported yet
#endif
#elif ( defined(__AVR_AVR32DD32__) || defined(__AVR_AVR32DD28__) || defined(__AVR_AVR32DD20__) || defined(__AVR_AVR32DD14__) )
#define BOARD_NAME F("AVR32DD")
#error AVR32DD not supported yet by the DxCore

#if ( (DXCORE_MAJOR == 1) && (DXCORE_MINOR < 5) )
#error AVR32DD not supported yet
#endif
#elif ( defined(__AVR_AVR16DD32__) || defined(__AVR_AVR16DD28__) || defined(__AVR_AVR16DD20__) || defined(__AVR_AVR16DD14__) )
#define BOARD_NAME F("AVR16DD")
#error AVR16DD not supported yet by the DxCore

#if ( (DXCORE_MAJOR == 1) && (DXCORE_MINOR < 5) )
#error AVR16DD not supported yet
#endif

////////////////////////// __AVR_DU__ //////////////////////////

Expand All @@ -87,31 +97,23 @@
#endif

#endif // #if !defined(BOARD_NAME)

#elif defined(MEGATINYCORE)

#define TIMER_INTERRUPT_USING_MEGATINYCORE true

#define BOARD_NAME F("MEGATINYCORE Board")

#error Support for megaTinyCore not ready yet! Please check your Tools->Board setting


#else

#error This is designed only for AVRDx boards using DxCore or megaTinyCore ! Please check your Tools->Board setting
#error This is designed only for AVRDx boards using DxCore ! Please check your Tools->Board setting

#endif

///////////////////////////////////////////////////////////////////////////////

#ifndef DX_SLOW_PWM_VERSION
#define DX_SLOW_PWM_VERSION F("Dx_Slow_PWM v1.0.2")
#define DX_SLOW_PWM_VERSION F("Dx_Slow_PWM v1.1.0")

#define DX_SLOW_PWM_VERSION_MAJOR 1
#define DX_SLOW_PWM_VERSION_MINOR 0
#define DX_SLOW_PWM_VERSION_PATCH 2
#define DX_SLOW_PWM_VERSION_MINOR 1
#define DX_SLOW_PWM_VERSION_PATCH 0

#define DX_SLOW_PWM_VERSION_INT 1000002
#define DX_SLOW_PWM_VERSION_INT 1001000
#endif

#ifndef _PWM_LOGLEVEL_
Expand Down
5 changes: 3 additions & 2 deletions src/Dx_Slow_PWM_ISR.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
Built by Khoi Hoang https://github.com/khoih-prog/Dx_Slow_PWM
Licensed under MIT license
Now even you use all these new 16 ISR-based timers,with their maximum interval practically unlimited (limited only by
unsigned long miliseconds), you just consume only one AVRDx-based timer and avoid conflicting with other cores' tasks.
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.
This important feature is absolutely necessary for mission-critical tasks.
Version: 1.0.2
Version: 1.1.0
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K.Hoang 25/08/2022 Initial coding to support AVR Dx (AVR128Dx, AVR64Dx, AVR32Dx, etc.) using DxCore
1.0.1 K.Hoang 25/08/2022 Make MAX_NUMBER_CHANNELS configurable to max 64 PWM channels
1.0.2 K.Hoang 25/08/2022 Minor cosmetic fix
1.1.0 K.Hoang 30/12/2022 Add support to AVR DD (AVR64DD, AVR32DDx, AVR16DD, etc.) using breaking DxCore v1.5.1+
*****************************************************************************************************************************/

#pragma once
Expand Down
26 changes: 18 additions & 8 deletions src/Dx_Slow_PWM_ISR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
Therefore, their executions are not blocked by bad-behaving functions / tasks.
This important feature is absolutely necessary for mission-critical tasks.
Version: 1.0.2
Version: 1.1.0
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K.Hoang 25/08/2022 Initial coding to support AVR Dx (AVR128Dx, AVR64Dx, AVR32Dx, etc.) using DxCore
1.0.1 K.Hoang 25/08/2022 Make MAX_NUMBER_CHANNELS configurable to max 64 PWM channels
1.0.2 K.Hoang 25/08/2022 Minor cosmetic fix
1.1.0 K.Hoang 30/12/2022 Add support to AVR DD (AVR64DD, AVR32DDx, AVR16DD, etc.) using breaking DxCore v1.5.1+
*****************************************************************************************************************************/

#pragma once
Expand Down Expand Up @@ -54,13 +55,22 @@

#elif ( defined(__AVR_AVR64DD32__) || defined(__AVR_AVR64DD28__) || defined(__AVR_AVR64DD20__) || defined(__AVR_AVR64DD14__) )
#define BOARD_NAME F("AVR64DD")
#error AVR64DD not supported yet by the DxCore

#if ( (DXCORE_MAJOR == 1) && (DXCORE_MINOR < 5) )
#error AVR64DD not supported yet
#endif
#elif ( defined(__AVR_AVR32DD32__) || defined(__AVR_AVR32DD28__) || defined(__AVR_AVR32DD20__) || defined(__AVR_AVR32DD14__) )
#define BOARD_NAME F("AVR32DD")
#error AVR32DD not supported yet by the DxCore

#if ( (DXCORE_MAJOR == 1) && (DXCORE_MINOR < 5) )
#error AVR32DD not supported yet
#endif
#elif ( defined(__AVR_AVR16DD32__) || defined(__AVR_AVR16DD28__) || defined(__AVR_AVR16DD20__) || defined(__AVR_AVR16DD14__) )
#define BOARD_NAME F("AVR16DD")
#error AVR16DD not supported yet by the DxCore

#if ( (DXCORE_MAJOR == 1) && (DXCORE_MINOR < 5) )
#error AVR16DD not supported yet
#endif

////////////////////////// __AVR_DU__ //////////////////////////

Expand Down Expand Up @@ -105,13 +115,13 @@
///////////////////////////////////////////////////////////////////////////////

#ifndef DX_SLOW_PWM_VERSION
#define DX_SLOW_PWM_VERSION F("Dx_Slow_PWM v1.0.2")
#define DX_SLOW_PWM_VERSION F("Dx_Slow_PWM v1.1.0")

#define DX_SLOW_PWM_VERSION_MAJOR 1
#define DX_SLOW_PWM_VERSION_MINOR 0
#define DX_SLOW_PWM_VERSION_PATCH 2
#define DX_SLOW_PWM_VERSION_MINOR 1
#define DX_SLOW_PWM_VERSION_PATCH 0

#define DX_SLOW_PWM_VERSION_INT 1000002
#define DX_SLOW_PWM_VERSION_INT 1001000
#endif

#ifndef _PWM_LOGLEVEL_
Expand Down
Loading

0 comments on commit 4cf1091

Please sign in to comment.