RS485-RS232 through code

The reference is one or both of the GNDs (I don't know what the _B means but if you can join them together then do so).

What you suggest may work as well (although I think the logic is inverted) but it means bit banging two pins per connection.

My method (if it works) allows you to use the softwareserial library.

RS232

There is no RS232 here.

Normally with half-duplex 485 you enable the transmitter, send data, then disable it and wait for a response. You cannot have an output enabled and disable it when you see start bit because you will have contention between the two outputs.

EDIT: Neither scheme will work for reading data from the RS485, you have to amplify the signal somehow.


Rob