Hello,
Recently I acquired and routed a NXP iMX6UL processor, and I added a RS485 port with UART2 and a MAX485 tranceiver.
Everything seemed fine, until I noticed that the signals were only going in one direction : the ctrl pins of the MAX485 were always high.
I routed the RTS_B output of the imx6ul to the RE and DE\ pins of the MAX485.
My dtb settings are :
.DTSI :
&uart2 { |
pinctrl-names = "default"; |
pinctrl-0 = <&pinctrl_uart2_4wires>; |
status = "disabled"; |
rs485-rts-active-high; |
rs485-rx-during-tx; |
rs485-rts-delay = <1 1>; |
linux,rs485-enabled-at-boot-time; |
};
pinctrl_uart2_4wires: uart2grp_4wires { |
fsl,pins = < |
MX6UL_PAD_UART2_TX_DATA__UART2_DCE_TX 0x1b0b1 |
MX6UL_PAD_UART2_RX_DATA__UART2_DCE_RX 0x1b0b1 |
MX6UL_PAD_UART2_CTS_B__UART2_DCE_CTS 0x1b0b1 |
MX6UL_PAD_UART2_RTS_B__UART2_DCE_RTS 0x1b0b1 |
>; |
};
DTS :
&uart2 { |
status = "okay"; |
};
As you can see in the screenshot below, RTS signal (first screenshot) stay HIGH, while CTS seems to be the one trying to control the pins (second screenshot), but it's not routed... So my guess is that what I considered RTS for the driver is in fact the CTS pin.
What I hope is to be able to use the RTS pin that I have routed instead of the CTS, in order to drive the tranceiver.
I tried a lot of settings, even modifying the imx6ul-pinfunc file, but I have to say I'm a bit lost.
I heard about DTE mode to swap RTS and CTS, but I believe it would also exchange the RX and TX pins.
Maybe there is a way to modify the RS485 driver ? Or to make it believe the RTS pin is the CTS pin ?
Waiting for your advices,
Theo B.
Hello Théophile,
CTS_B pin should be used to control Rec or Send direction, not RTS_B. See reference manual, please!
Have a nice day!
TIC Weidong sun
I read the manual, not deep enough obiously.
Anyway it's a bit disturbing that these lines :
rs485-rts-active-high; |
rs485-rts-delay = <1 1>; |
are in fact controlling the CTS pin.
I hope no one will make the same mistake.
Thank you anyway for your response and have a good day