Disable uart TX pin but use RX #11372
-
Hello! Question about uart though. Before I used .end(true) to completely detach pins as I only want to use RX part of the Serial as one of my pins is used for dual purpose at boot. Seems like with new changes I am not able to do that and begin when passed -1 will always default to some pin. Is there workaround for this or maybe we can get back .end(true) that will also set the pins to value to not use it at all? Here is simple code of what I am talking about: Serial1.begin(115200, SERIAL_8N1, ENC_B, I2C_SCL);
Serial1.end(); // before - .end(true);
Serial1.begin(115200, SERIAL_8N1, ENC_B, -1); Thanks for all the help! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@SuGlider PTAL |
Beta Was this translation helpful? Give feedback.
-
@handmade0octopus - I have created an issue from this topic. I'll handle it from there. |
Beta Was this translation helpful? Give feedback.
-
Tested using Arduino Core 3.0.7, 3.1.3 and 3.2.0:
If But if Only when both are -1, like in |
Beta Was this translation helpful? Give feedback.
Tested using Arduino Core 3.0.7, 3.1.3 and 3.2.0:
Serial1.end()
completely detaches all the UART1 pins (rx, tx, cts, rts).Serial1.begin(115200, SERIAL_8N1, RX1_Pin)
orSerial1.begin(115200, SERIAL_8N1, RX1_Pin, -1)
will only set RX1 pin and leave TX1 pin as unchanged.If
Serial1.end()
was called before, TX1 will detached andSerial1.begin(115200, SERIAL_8N1, RX1_Pin)
not attach TX1 to any GPIO.But if
Serial1.begin(115200, SERIAL_8N1, ENC_B, I2C_SCL)
folllowed bySerial1.begin(115200, SERIAL_8N1, NewRX1_pin)
with noSerial1.end()
in between, it will keep the previous TX1 attached as by the firstbegin()
. Therefore, the final result would be RX1 = NewRX1_pin and TX1 = I2C_SCL (set in the …