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
Copy file name to clipboardExpand all lines: content/hardware/03.nano/boards/nano-r4/tutorials/01.user-manual/content.md
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -733,6 +733,8 @@ You can open the Arduino IDE's Serial Monitor (Tools > Serial Monitor) to see th
733
733
734
734
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.
735
735
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
+
736
738
The Nano R4 board provides PWM functionality on the following pins:
@@ -746,19 +748,33 @@ The Nano R4 board provides PWM functionality on the following pins:
746
748
747
749
***__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.***
748
750
751
+
The Nano R4's PWM offers the following technical specifications:
| Maximum Resolution | 16-bit (0-65535) | Full precision control |
749
757
750
758
You can use PWM pins as analog output pins with the `analogWrite()` function:
751
759
752
760
```arduino
753
761
analogWrite(pin, value);
754
762
```
755
763
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:
757
765
758
766
```arduino
759
767
analogWriteResolution(resolution);
760
768
```
761
769
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
+
762
778
***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.***
763
779
764
780
The following example demonstrates how to control the brightness of the built-in orange user LED using PWM:
@@ -873,7 +889,6 @@ void loop() {
873
889
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.
874
890
875
891

876
-
877
892
### Operational Amplifier (OPAMP)
878
893
879
894
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