This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM4379: RS485 issues

Part Number: AM4379
Other Parts Discussed in Thread: SN65HVD08

Hello team,

my customer has some technical problems with the Sitara processor and RS485:

 

they are trying to establish an RS485 communication under Linux with Sitara (AM437x) processor via a SN65HVD08 Transceiver and they are using UART_2 (/dev/ttyS2) and GPIO3_22 to control the transmit/receive. The 8250 OMAP UART driver is enabled in the kernel.

There are two problems:

 

1.

Whenever the GPIO3_22 pin is pulled to HIGH level then one ‘0’ character can be read from the /dev/ttyS2 serial port. They are using ‘poll’ command under Linux with the file descriptor of ‘/dev/ttyS2’ to wait for ‘data ready’ event. Why do they receive this extra char?

 

2.

They have a problem with knowing when exactly a message transmit is ready. They are sending out 8 characters (1 start + 8 data + 2 stop bit of each char) and the other device answers when it is ready with its processing. They tried to use ‘tcdrain’ Linux function to wait until every character is transmitted but it is too slow. After sending every bit out the ‘tcdrain’ returns with about 4-5ms delay, which is too much because the other device start transmitting in about 2-3ms. Is there any solution to overcome this problem and get any event as soon as the last bit is sent out?

Could you please help to solve this?

Thanks,

Peter