arduino / arduino/ArduinoCore-renesas
Incorrect information re: SoftwareSerial RX pins
- Dominant language
- C
- Stars
- 193
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the problem
Information about which pins can be used as RX is provided in a comment in the "SoftwareSerial" library's example sketch:
https://github.com/arduino/ArduinoCore-renesas/blob/b5a3b9dee4c659e6ee173f5eb4143c0e021ed6c3/libraries/SoftwareSerial/examples/SerialEcho/SerialEcho.ino#L3-L5
From experimentation with the UNO R4 Minima and WiFi boards, I found some of this information to be incorrect.
#### UNO R4 Minima
🐛 Pins `12` and `13` can be used, yet these are not mentioned.
🐛 The claim is made that pin `14` can be used, yet this pin does not work as RX.
#### UNO R4 WiFi
🐛 Pins `6`, `11`, and `12` can be used, yet these are not mentioned.
🐛 The claim is made that pin `14` can be used, yet this pin does not work as RX.
#### General
🐛 Pin `15` is mentioned explicitly. This is the same pin as `A1`, which is also mentioned explicitly. Although not incorrect, this is inconsistent (and therefore confusing to the user) since the same redundant approach is not done for pins `16` (`A2`)-`19` (`A5`).
### To reproduce
#### UNO R4 Minima
1. Jumper pin **1** to pin **12** on the board.
1. Open Serial Monitor.
1. Upload the following sketch:
```cpp
#include
byte RxPin = 12;
SoftwareSerial SoftSerial(RxPin, 2);
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
SoftSerial.begin(9600);
Serial1.print("Hello to RX pin ");
Serial1.println(RxPin);
while (!Serial) {}
}
void loop() {
if (SoftSerial.available()) {
Serial.write(SoftSerial.read());
}
}
```
🐛 The message "`Hello to RX pin 12`" _is_ printed in Serial Monitor, indicating that pin can be used as RX even though the comment in the example says otherwise.
1. Move the jumper to pin **13**.
1. Change line 2 of the sketch to:
```cpp
byte RxPin = 13;
```
1. Upload the sketch.
🐛 The message "`Hello to RX pin 12`" _is_ printed in Serial Monitor, indicating that pin can be used as RX even though the comment in the example says otherwise.
1. Move the jumper to pin **A0** (`14`).
1. Change line 2 of the sketch to:
```cpp
byte RxPin = 14;
```
1. Upload the sketch.
🐛 The message "`Hello to RX pin 14`" _is not_ printed in Serial Monitor, indicating that pin can not be used as RX even though the comment in the example says otherwise.
#### UNO R4 WiFi
1. Jumper pin **1** to pin **6** on the board.
1. Open Serial Monitor.
1. Upload the following sketch:
```cpp
#include
byte RxPin = 6;
SoftwareSerial SoftSerial(RxPin, 2);
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
SoftSerial.begin(9600);
Serial1.print("Hello to RX pin ");
Serial1.println(RxPin);
delay(1000); // Give time for Serial to initialize.
}
void loop() {
if (SoftSerial.available()) {
Serial.write(SoftSerial.read());
}
}
```
🐛 The message "`Hello to RX pin 6`" _is_ printed in Serial Monitor, indicating that pin can be used as RX even though the comment in the example says otherwise.
1. Move the jumper to pin **11**.
1. Change line 2 of the sketch to:
```cpp
byte RxPin = 11;
```
1. Upload the sketch.
🐛 The message "`Hello to RX pin 11`" _is_ printed in Serial Monitor, indicating that pin can be used as RX even though the comment in the example says otherwise.
1. Repeat the process with pin **12**.
🐛 The message "`Hello to RX pin 12`" _is_ printed in Serial Monitor, indicating that pin can be used as RX even though the comment in the example says otherwise.
1. Move the jumper to pin **A0** (`14`).
1. Change line 2 of the sketch to:
```cpp
byte RxPin = 14;
```
1. Upload the sketch.
🐛 The message "`Hello to RX pin 14`" _is not_ printed in Serial Monitor, indicating that pin can not be used as RX even though the comment in the example says otherwise.
### Expected behavior
Information in example sketch comments is correct.
Since it is likely not feasible for Arduino to maintain multiple copies of this documentation, I would recommend replacing the information in the example with a link to the documentation for the SoftwareSerial library:
https://docs.arduino.cc/learn/built-in-libraries/software-serial/
(I am working to add this information to that documentation: https://github.com/arduino/docs-content/pull/1884)
### "Arduino Renesas fsp Boards" version
b5a3b9dee4c659e6ee173f5eb4143c0e021ed6c3
### Additional context
I did not investigate the situation with Portenta C33 due to not having access to that hardware, but from the results of the other boards I suspect that the information is also incorrect for this board.
#### Additional reports
- https://forum.arduino.cc/t/cant-connect-barcode-scanner-to-arduino-uno-r4-wifi/1249097/13
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with libraries/SoftwareSerial/examples/SerialEcho/SerialEcho.ino and read the RX-pin comment at lines 3–5. Compare it with the reported UNO R4 Minima and WiFi results and the linked SoftwareSerial documentation; done means the example no longer presents incorrect or confusing RX-pin information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation, embedded-iot
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100