I think also that your terminal program that inverts the signal is not doing what you think.

Your serial port is hardware, that expects the data to arrive in the proper manner, but your data is we think inverted, so the uart will not take in the inverted data correctly, yes it will give you something but it will not be the correct character even if your terminal inverts what it has received.

The transmitting device when correct and in idlesits at the MARK (1) level and starts collecting the bits from there, if it is inverted, then the transmitting device is sitting at the SPACE (0)level

Have a read here

https://learn.sparkfun.com/tutorials...ules-of-serial

may help you understanding why the terminal inversion does not work.