Closed Aptahar closed 1 month ago
NUC980 RS485 always support RX during TX.
But I need to disable Rx during Tx, is it possible?
NUC980 RS485 controller does not support disable RX independently. You may control the NUC980 UART/RS485 RTS pin to achieve half-duplex.
Did you mean this functions?
static void rs485_start_rx(struct uart_nuc980_port *port)
{
#if 0 // user can enable to control RTS pin level
// when enable this define, user need disable auto-flow control
struct uart_nuc980_port *up = (struct uart_nuc980_port *)port;
if(port->rs485.flags & SER_RS485_RTS_AFTER_SEND) {
// Set logical level for RTS pin equal to high
serial_out(port, UART_REG_MCR, (serial_in(port, UART_REG_MCR) & ~0x200) );
} else {
// Set logical level for RTS pin equal to low
serial_out(port, UART_REG_MCR, (serial_in(port, UART_REG_MCR) | 0x200) );
}
#endif
}
static void rs485_stop_rx(struct uart_nuc980_port *port)
{
#if 0 // user can enable to control RTS pin level
// when enable this define, user need disable auto-flow control
if(port->rs485.flags & SER_RS485_RTS_ON_SEND) {
// Set logical level for RTS pin equal to high
serial_out(port, UART_REG_MCR, (serial_in(port, UART_REG_MCR) & ~0x200) );
} else {
// Set logical level for RTS pin equal to low
serial_out(port, UART_REG_MCR, (serial_in(port, UART_REG_MCR) | 0x200) );
}
#endif
}
RTS is only used to control the transmission or reception of rs485 transceiver. Is there an rs485 transceiver on your platform??
RTS is only used to control the transmission or reception of rs485 transceiver. Is there an rs485 transceiver on your platform??
Yes, we use MAX3160EAP chip for RS485. In half duplex mode this chip translate tx (pin 16) to rx (pin 8).
The RTS pin on the NUC980 is currently set to auto mode. When transmitting data (TX), it automatically pulls the RTS pin, enabling the transceiver to enter TX mode without requiring manual intervention. When TX is not actively transmitting data, the RTS pin remains in RX (receive) mode. Additionally, the hardware of the NUC980 does not provide a separate function to disable RX independently
Maybe it is possible in driver to drop received data while transmitting?
On an RS485 bus, there should only be one set of data transmitting at any given time, so it should not be possible to both transmit (TX) data and receive (RX) data simultaneously
Yes. But the problem in MAX3160EAP that it's connect rx and tx on TTL pins and echoing all while transmitt.
The NUC980 hardware does not have a separate feature to disable RX (receive) functionality. Perhaps you could consider implementing a mechanism in the application code to compare received RX data with TX (transmit) data and exclude matching data accordingly.
Ok, thanks
There is no reaction to SER_RS485_RX_DURING_TX flag, always receiving while transmit.
Other flags are working.
Init code:
And there is no code in /drivers/tty/serial/nuc980_serial.c for this flag.