RS485 direction control from GPIO for /dev/ttyS4?

Hi,
pls advise, is there a way to get RS485 direction control signal out of GPIO when /dev/ttyS4 (gpio pins 15, 16) is used to communicate with RS485 bus?

That control signal should be high when transmitting. It is possible to create such a direction control signal with external logic based on TX from Khadas, but it would much simpler if one of the GPIO pins would be usable as direction control output.

2 Likes

It should works, but you might need a TTL to RS485 Two-way Converter.

You can take a try :slight_smile:

Have fun!

I have that that (TTL/RS485 interface) on the IO-board, connected to the 40-pin header of VIM. But there the RS485 direction control signal is calculated by a (PIC) microcontroller, taking the communication parameters into account. Was just wondering if I could skip that in some future designs…

Anyway, no problem, I can always use an USB-to-RS485 cable to get RS485.

Can you just show us the schematic of the IO board?

Not quite clear on this, can you specify more information?

Good day!

related to the rs485 driver circuit, there are 3 signals. TX, RX and direction control, named P1.0 on the diagram below.
rs485

was just thinking that it would be nice if the missing direction signal would become available from gpio.