I have a 5V UART device (AC unit) that I want to connect to a 3.3V MCU over long wires. I made a UART to RS-485 adapter so I can connect the MCU via ethernet cable. At the MCU I convert back to UART and blink through optocouplers to keep the grounds separate.
Here's the schematic, showing both the adapter and MCU:
It doesn't work, so now I'm debugging. I use a 5V MCU instead of the AC to send `0x3A` repeatedly. I connect a logic analyzer to UART TX and RS-485 TX+ and TX- in the adapter with no ethernet cable connected and it looks like this:
Why are TX+ and TX- in phase? I expect to see it look like this:
Why is TX- less of a nice square wave compared to TX+? Maybe it's the logic analyzer grounding?
I haven't gotten very far debugging the MCU side yet, as I wanted to address these disturbing questions first. I've only verified UART TX from the MCU through the optocoupler looks good, so my resistor choice for that is OK.