RS485 on i.mx6sx

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

RS485 on i.mx6sx

跳至解决方案
1,945 次查看
kubiznak_petr
Contributor V

On some processors (e.g. Vybrid VF6), it is possible to use the RTS signal for RS485 transceiver output control. I'm struggling trying to do the same on i.MX6SX. It seems to be achievable with the CTS signal though. Is it possible to configure the RTS pin for this functionality?

0 项奖励
回复
1 解答
1,920 次查看
igorpadykov
NXP Employee
NXP Employee

Hi kubiznak_petr

 

unfortunately it is not possible only switch RTS<->CTS in software.

 

Best regards
igor

在原帖中查看解决方案

0 项奖励
回复
5 回复数
982 次查看
alaskora_byk_mstang
Contributor I

Hello,

I want to use the modbus rtu protocol on our designed linux board-imx8mp Soc, so I need to enable the rs485 line in half-duplex. I have a few questions about this subject.

In the device tree, the rs485 connection is defined as follows

&uart3 {

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_uart3>;

uart-has-rtscts;

rts-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;

cts-gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;

status = "ok";

};

//Halfduplex

we are using  ISO3086DW as a rs485 transciver

Connection is diagram listed below

uart3 Tx  -------> rs485 transciver D

uart3 Rx -------> rs485 transive R

 

rts and cts pins are not connected.

GPIO0  -------> rs485 transciver's DE

GPIO1 ------->  rs485 transciver's RE

 

I can transfer data from the RS485 line by controlling the RE and DE pins with custom gpio0 and gpio1. But I am experiencing connection timeout problem with Modbus RTU. 

1.) Is there a convenient way to control Transmit and Receive directions?
2.) Should I connect the rts pins to the DE pin of the transciver and the uart driver should automatically control the transmit or receive direction
3.) Should I connect the cts pin to the RE pin of the transciver?

0 项奖励
回复
1,930 次查看
kubiznak_petr
Contributor V

<dummy>

0 项奖励
回复
1,939 次查看
igorpadykov
NXP Employee
NXP Employee

Hi kubiznak_petr

 

one can consider control of DCE/DTE mode described in

Figure 65-2. UART external signals to module signals routing with respect to DCE/DTE mode

i.MX 6SoloX Applications Processor Reference Manual

 

Best regards
igor

1,927 次查看
kubiznak_petr
Contributor V

Hi igor,

Thanks for your reply. That looks promissing but then the issue would be that the RX/TX signals would be switched too, right? Or is it possible to only switch RTS<->CTS in software?

0 项奖励
回复
1,921 次查看
igorpadykov
NXP Employee
NXP Employee

Hi kubiznak_petr

 

unfortunately it is not possible only switch RTS<->CTS in software.

 

Best regards
igor

0 项奖励
回复