Skip to content

Commit 4d01400

Browse files
committed
Content update (PWM section)
1 parent 278c0f3 commit 4d01400

File tree

1 file changed

+17
-2
lines changed
  • content/hardware/03.nano/boards/nano-r4/tutorials/01.user-manual

1 file changed

+17
-2
lines changed

content/hardware/03.nano/boards/nano-r4/tutorials/01.user-manual/content.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,8 @@ You can open the Arduino IDE's Serial Monitor (Tools > Serial Monitor) to see th
733733

734734
The Nano R4 board features multiple pins with PWM capability that can be used to generate analog-like output signals. PWM works by rapidly switching a digital output between `HIGH` and `LOW` states, where the ratio of `HIGH` time to the total period determines the effective analog voltage output.
735735

736+
***__PWM Compatibility Note__: The Nano R4 shares identical PWM capabilities with the UNO R4 Minima, as both boards use the same RA4M1 microcontroller. This includes the same default 8-bit resolution, maximum 16-bit resolution, and PWM frequency control features. Code written for PWM on the UNO R4 Minima will work identically on the Nano R4.***
737+
736738
The Nano R4 board provides PWM functionality on the following pins:
737739

738740
| **Arduino Pin** | **Microcontroller Pin** | **PWM Channel** | **Primary Function** |
@@ -746,19 +748,33 @@ The Nano R4 board provides PWM functionality on the following pins:
746748

747749
***__Important note:__ Pins `A4` and `A5` also have PWM capability but are primarily used for I²C communication (SDA and SCL respectively). The onboard LEDs (`LEDR`, `LEDG`, `LEDB`, `LED_BUILTIN`) also support PWM for brightness control.***
748750

751+
The Nano R4's PWM offers the following technical specifications:
752+
753+
| **Specification** | **Value** | **Notes** |
754+
|:------------------:|:----------------:|:------------------------------:|
755+
| Default Resolution | 8-bit (0-255) | Standard Arduino compatibility |
756+
| Maximum Resolution | 16-bit (0-65535) | Full precision control |
749757

750758
You can use PWM pins as analog output pins with the `analogWrite()` function:
751759

752760
```arduino
753761
analogWrite(pin, value);
754762
```
755763

756-
By default, the resolution is 8-bit (0 to 255). You can use analogWriteResolution() to change this, supporting up to 12-bit (0 to 4095) resolution:
764+
**By default, the resolution is 8-bit (0 to 255)**. You can use analogWriteResolution() to change this, supporting up to 16-bit (0 to 65535) resolution:
757765

758766
```arduino
759767
analogWriteResolution(resolution);
760768
```
761769

770+
The Nano R4 supports the following PWM resolution options that you can configure based on your project's precision requirements:
771+
772+
- `analogWriteResolution(8)`: 8-bit resolution (0 to 255, **default resolution**)
773+
- `analogWriteResolution(10)`: 10-bit resolution (0 to 1023)
774+
- `analogWriteResolution(12)`: 12-bit resolution (0 to 4095)
775+
- `analogWriteResolution(14)`: 14-bit resolution (0 to 16383)
776+
- `analogWriteResolution(16)`: 16-bit resolution (0 to 65535, **maximum resolution**)
777+
762778
***The following PWM examples use the built-in orange user LED (`LED_BUILTIN`) of the Nano R4 board, which supports PWM for brightness control. This eliminates the need for external components and allows you to test PWM functionality immediately.***
763779

764780
The following example demonstrates how to control the brightness of the built-in orange user LED using PWM:
@@ -873,7 +889,6 @@ void loop() {
873889
This high-resolution example creates a smooth sine wave pattern with the built-in LED brightness, demonstrating the precision available with a 12-bit PWM resolution. You should see a very smooth transition in the LED brightness following a sine wave pattern. Additionally, you can open the Arduino IDE's Serial Monitor (Tools > Serial Monitor) to see the angle and PWM value outputs that demonstrate the precise 12-bit control values being used.
874890

875891
![Arduino IDE Serial Monitor output for the high-resolution PWM example sketch](assets/pwm-3.png)
876-
877892
### Operational Amplifier (OPAMP)
878893

879894
The Nano R4 board features a built-in operational amplifier (OPAMP) that provides signal conditioning and amplification capabilities directly on the board. The OPAMP is connected to analog pins `A1`, `A2` and `A3`, allowing you to perform analog signal processing without requiring external amplifier circuits. This feature is particularly useful for sensor signal amplification, buffering and analog filtering applications.

0 commit comments

Comments
 (0)