RS485 direction RTS not working as intended

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RS485 direction RTS not working as intended

3,727 Views
Clemens1
Contributor I

Hi,

We have a IMX6UL SOC and we are using a recent 5.15.82 kernel.

We want to use a THVD8000 transceiver (half duplex).

RX / TX works as intended, but the direction, which we want to set with RTS (output pin, so DTE RTS / DCE CTS), it is not working as intended. We expected the RTS goes only high when opening the serial port in transmit mode, but it seems to go high in both modes, so also in receive mode (and then RX doesn't work of course as the transceiver is in send mode). We tried using it via hw mode as well as GPIO, same behaviour. When manually setting the GPIO after disabling rtscts, tx / rx work as intended.

Do we make some wrong assumption that we can not use RTS for setting the direction of the transceiver?

Any other tips?

Device tree uart setting look like this:

&uart8 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart8>;
/*cts-rts-swap;*/
rts-gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
status = "okay";
rs485-rts-delay = <1 1>;
rs485-enabled-at-boot-time;
uart-has-rtscts;
fsl,dte-mode;
};

/* UART8 external RS485 */
pinctrl_uart8: uart8grp {
fsl,pins = <
MX6UL_PAD_ENET2_TX_EN__UART8_DTE_TX 0x13008
MX6UL_PAD_ENET2_TX_DATA1__UART8_DTE_RX 0x13008
/*MX6UL_PAD_ENET2_TX_CLK__UART8_DTE_RTS 0x13008*/
>;
};

Thanks for any tips/suggestions,
Kind regards,

Clemens

0 Kudos
Reply
4 Replies

3,675 Views
Clemens1
Contributor I

Thanks for you answer.

The question is not really about the direction of the electrical signals (ok we struggled with that one as well, but we also found the linked page which helped), as we are able to stear the RTS (via HW or via GPIO, behaves the same). The only problem is that the output seems to be set when sending and when receiving, so in both cases exactly the same, where we would expect that the output (DCE-CTS / DTE-RTS) is only set when sending, not when receiving. Maybe SW we use to test this (minicom / screen / echo / cat) is somehow making some full duplex assumptions and we should maybe try it with some more basic c program which does the bare minimum...

In the picture you see how we want to use the signal to set the direction of the half duplex transceiver (MODE). Like it is now, we can to make receive working OR send working (we can turn off RTS or switch the polarity) but not in a way that it switches when sending and not when receiving. One way to solve it would be to set the RTS completely manual through GPIO in custom SW, but we would like to make it work via the HW functionality.

2023-01-02_12-36.png

If any ideas what might go wrong, thanks for letting us know!

Kind regards,

Clemens

0 Kudos
Reply

3,648 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @Clemens1 

I hope you are doing well.
 
How is the processor connected with the module?
Kindly share the processor side schematic also for further debugging.
 
Thanks & Regards
Sanket Parekh

0 Kudos
Reply

3,639 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @Clemens1 

Awaiting for your answer.

Thanks & Regards

Sanket Parekh

0 Kudos
Reply

3,692 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport
 
I hope you are doing well.
 
Please find the answer below.

For a better understanding of direction and DTE/DCE mode please refer below documents.

https://community.freescale.com/docs/DOC-97509

Refer 53.2 External Signals From IMX6ULRM

If it doesn't solve the issue kindly share the schematic.
 
Thanks & Regards
Sanket Parekh

0 Kudos
Reply