Single wire UART

remcob
Posts: 2
Joined: Sun Dec 06, 2020 8:41 pm

Single wire UART

Postby remcob » Fri Dec 11, 2020 2:38 am

I'm interfacing the TMC2209 using the UART peripheral. It's a simple single wire half-duplex protocol.It's also a command-reply protocol, so collisions won't be an issue.

I have it working using separate TX and RX pins. The two pins are connected with a resistor and the RX side is connected to the device. This works, but requires two pins.

I'd like to know if/how it can be done with one pin. I /think/ the hardware is capable of doing it, but am not sure how to configure it.

I can configure the UART peripheral to use this same pin for TX and RX. If I connect this pin directly to the device and scope it, I can see the ESP32 correctly transmitting. I also receive the transmission as an echo (unfortunate, but understandable). When TMC2209 is replying though, the signal is visible on the scope, but the lows only manage to pull the line down a about ~500mV, not enough for the receiver. I assume this is because the TX is actively driving the line high.

Digging through the manuals, what I'd like to do is configure the pin as GPIO_MODE_INPUT_OUTPUT_OD and have an external pull-up, that way both devices can pull the line down and communicate half-duplex.

But setting the pin mode directly does not seem to work, the uart module seems to override it?

Who is online

Users browsing this forum: No registered users and 70 guests