Skip to content

Disable uart TX pin but use RX #11372

Answered by SuGlider
handmade0octopus asked this question in Q&A
Discussion options

You must be logged in to vote

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) or Serial1.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 and Serial1.begin(115200, SERIAL_8N1, RX1_Pin) not attach TX1 to any GPIO.

But if Serial1.begin(115200, SERIAL_8N1, ENC_B, I2C_SCL) folllowed by Serial1.begin(115200, SERIAL_8N1, NewRX1_pin) with no Serial1.end() in between, it will keep the previous TX1 attached as by the first begin(). Therefore, the final result would be RX1 = NewRX1_pin and TX1 = I2C_SCL (set in the …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by handmade0octopus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants