# Inverting serial output from Uno/328P

Hi guys,

I have what I think is a simple problem to solve here… however I am not sure on the best way to solve the issue.

I have a circuit setup as per below. I need to invert the rx/tx lines from the Uno, as I have made a small boo boo in understanding the logic of the serial system I am integrating with.

I have a bunch of BC549 transistiors… can I simply use two of these between the Uno and the existing circuit to create NOT gates for the rx and tx lines? If so, how do I figure out what sort of resistor values I need to use to preserve the operation of the current circuit?

Thanks,
Matt

circuit.zip (27.8 KB)

makro86: Hi guys,

I have what I think is a simple problem to solve here... however I am not sure on the best way to solve the issue.

I have a circuit setup as per below. I need to invert the rx/tx lines from the Uno, as I have made a small boo boo in understanding the logic of the serial system I am integrating with.

I have a bunch of BC549 transistiors... can I simply use two of these between the Uno and the existing circuit to create a NOT gate? If so, how do I figure out what sort of resistor values I need to use to preserve the operation of the current circuit?

Thanks, Matt

In your present circuit as shown, you're already inverting the output signal, but the input signal is non-inverting.

What are you interfacing with? RS232?

Proper RS232 uses negative 12V too. A MAX232 chip is the correct way to interface the Arduino's TTL levels with RS232. It can generate the appropriate voltages and it inverts too.

Since you're stuck with the board you have (until a new one arrives) you can use SoftwareSerial with inverted serial. However, I think it inverts both Rx and Tx. You may need to hack your own version to do exactly what you need. You can use SoftwareSerial on pin 0 and 1, but it's not often necessary.

Ah I think I interpreted the situation incorrectly. Here is the description of the interface setup for the other device... (ECU)

"TX data to ECU level is 12V, idle low (see interface schematic). ECU output is open collector and can be sourced from the interface logic level (5 V). The ECU data output is idle high. Clock to the ECU seems fine with a 5v source from the interface."

I was not able to get comms working, so I started looking at the circuit. There might be an issue elsewhere so I will have to keep looking.