Hello,
i’m trying to use my Uart1 as RS485 (and Modbus RTU).
Using an RS232 to RS485 Converter works fine.
No i want to implement the RS485 on my sutomboard. Therefor i have to use a chip converter. This chips needs a Pin for switching between sending an receiving.
My suggestions:
-
Driving this Pin with a gpio before and after sending data. But how to check if all my data is sucessfully send?
-
Using serial RTS Pin. I found some code on the net, but it return -1.
“rs485conf.flags |= SER_RS485_ENABLED;
rs485conf.delay_rts_before_send = 0x00000004;
ioctl(fd, TIOCSRS485, &rs485conf);”
Can someone help to drive my uart as Rs485?
Nils