On the Arduino Uno, I would like to invert the polarity of the serial tx signal. The default setting is logic high = 5V. I would like to invert it to logic high = 0V.
I am able to do this using SoftwareSerial using the argument, true:
However, the SoftwareSerial's maximum speed is 115200 and I would like to run faster than that.
Is there a way to invert the serial polarity?
I'm not sure if the on chip USART supports inverted logic so you will probably need to run the signal(s) through a NOT gate like a 7404 (Expect to be told this is not suitable here)
Run the line thru a transistor inverter with open collector (OC) output.
2N2222A or similar NPN transistor , 2 resistors.
When Tx is high, OC is low; when TX is low, OC is high.
Hardware serial can do up to 1Mbps rates. Don't know if the serial libary supports that directly.
I think I tested as high as 250000 with just small burts of data.
See Section 20 of the datasheet for hardware discussion. Table 20-7 for supported speeds with 16 MHz system clock.
That works perfectly. Thank you!