arduino / arduino/ArduinoCore-sam
Serial Transmit on Due stops working after using pinMode
- Dominant language
- HTML
- Stars
- 91
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
Tx for Serial3 for Arduino Due doesn't work after using pinMode on the pin. No issue is there for receiving. I only faced this issue on Arduino Due, not on Mega or MKR boards. Please see the reproduction code below:
I have TX3 and RX3 shorted on the Due.
```
void setup()
{
Serial.begin(9600);
pinMode(14,OUTPUT); //14 is TX3
Serial3.begin(9600);
}
void loop()
{
Serial3.write(65);
delay(1000);
if(Serial3.available()>0)
{
Serial.println(Serial3.read());
}
else
{
Serial.println("No Data");
}
}
```
Serial Monitor displays only "No Data". Now comment the line
`pinMode(14,OUTPUT); //14 is TX3`
The serial monitor starts printing 65 as expected.
I am using Arduino 1.8.8.
Please let me know if there is something I am missing.
Thank you
Regards
Gayatri
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the supplied sketch on an Arduino Due with TX3 and RX3 shorted, comparing behavior with and without pinMode(14, OUTPUT). Trace the Due-specific pinMode and Serial3 initialization paths; done means Serial3.write(65) is received and printed after pinMode is called, without breaking the existing receiving behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100