06-05-2016 01:11 PM
I have two 16550a's configured as RS485 Half-duplex. The protocol is a command/response from the remote device. When I send the command and then read the response, I see the command in the read buffer every time. I've tried numerous termios flags, among other things. The tx enable on the transceiver is controlled via gpio. So, I assert the gpio (enable TX), write the data, read the FIFO control register until empty and then drop the tx enable. I've also tried writing to the FIFO reset register just prior to dropping the TX enable gpio, thinking it would clear any data that was echoed, but that didn't seem to help. Any ideas? I don't want to parse the command from the response message if I can avoid it.
06-17-2016 07:16 AM
Assuming that you're directly communicating with an external RS-485 Transciever, have you made sure that you disable the RX Enable (RE) pin before enabling the TX driver? Assuming you're using a chip like the Linear Technologies LTC1480, most transceiver chips will have separate TX Enable (DE) and RX enable (RE') that are complements of each other. For most applications, we typically tie a single GPIO to both pins. For example, with the LTC1480 - when GPIO output is LOW RX is enabled and TX is disabled, when GPIO is HIGH TX is enabled and RX is disabled, obviously it might be different for your chip. But, this is a common issue that has bitten us many times.
What does your schematic look like?
06-17-2016 07:19 AM