Can I disable the TX pin by setting its mode to INPUT while still receiving data on the RX pin of a UART? I'm using the ATmega328PB in a personal project with MiniCore. My board streams data in on the RX pin from another microcontroller, but my board also has a DIP switch connected to the TX pin, that's used for configuration. My board has already been manufactured, so a hardware solution means a board redesign and extra cost/time.

This DIP switch is connected between TXD (Arduino pin "1") and GND. Upon startup, I read the value of this pin when in mode INPUT_PULLUP. However, when I go to start the Serial, if this switch is in the closed position, it shorts the TXD pin to GND.

Is it possible to disable the TX pin by putting it into INPUT mode while still receiving data on the RX pin?
Well, I ended up answering my own question in a few minutes of forum research.

You can disable the TX pin of the hardware UART with:

UCSR0B &amp;= ~bit (TXEN0);