众所周知,RS422是全双工的总线通讯方式 ,类似于两个485芯片共同使用,这次我使用的美信公司的MAX1482ESD芯片。
往常的应用场景一般是一对一通信,没出过什么问题,但这次情况不一样了。
这是芯片的功能框图。理论上来说,收发是独立开来的,收发互不影响,但是就这样依然出问题了。
我们采用了一主多从的连接方式。①为主机,②③为从机,主机的发连接从机的收,主机的收连接从机的发。
我在电路上把三个芯片的RE拉低,DE拉高,这样收发都使能了,只单独开启一个从机,通信没有问题,可是当我开启两台从机后,通信明显不对了,只有一台从机(随机)能够和主机通信,且通信非常不稳定。这时候我把两个从机的DE都交由程序控制,默认状态下把DE拉低,即把发送使能关断;只有发送数据的期间把DE拉高,这样三个设备的通信就正常了。
两个从如果都使能了发送的话,由于都处于输出态,谁也没法把总线拉高拉低,确实会出问题。但是为什么从机的发送总线会影响到从机的接收总线呢?
很匪夷所思,于是我直接打给了美信公司的技术支持这是他回复我的邮件:
For RS485 communication, only one device can drive the bus at anytime, so for 1 host-2 slave configuration, please make sure DE is low after sending data. this is no problem for 1 host-1 slave, but it should be set DE to low for slave device with 1 host- multi-slave configuration.
Thanks
Frank
答非所问,问的是422的问题,回复的是485的问题。他在解释发送总线不能一直使能,会导致总线高阻,导致数据不能正常发出去,因此默认状态时要关断。
你说的道理我懂,为什么发送总线会影响到接收呢!!!!说好的全双工呢?
于是我穷追不舍回了个邮件,向他表达了我的疑问,:
thx for replyTho, we are attempt to using MAX1482 commit communication via RS422. The problem is that when a master device connects 2 slave devices, only one slave device is, not reliable but able, to communicate with master device. And the other slave device could not recieve correct command.How we solve it was ctrl the DE pins in slave devices. Pull them low in default, and high only when them need to transmit data. Then both the slaves could correctly receive command.Now, I understand what you mean by keep slaves' DE in low when they not in transmitting. However, i wonder, isn't that RS422's TX/RX should be working independently? Why Pulling DE high would effect slaves' receiving?sincerely“感谢回复,目前我们遇到的问题实际上是使用max1482EESA芯片进行RS422通信时遇到的。
现在电路的连接方式是这样的。(如图)
当mater连接slave1和slave2时,只有一台从机能够和主机互相通信(通信质量也不可靠),另一台从机收到来自主机的数据是完全错误的。
但当我们把两个从机的DE引脚用程序控制,在默认状态时为低,只在发送数据时拉高,这样从机的数据就能接收正确了!
我现在能够理解你说的 从机的DE在不发送数据时应保持低
但是我很好奇 RS422的收发不是隔离开的么?为什么DE拉高会影响接收?”
可是回复依然答非所问:
Yes, You are corret, TX/RX works independent for RS422, you can consider that more than slave drive the bus, if one slave output is high and another is low, what will happen? there is data conflict that cause the host can not receive data correctly. for 1-host/1-slave. no problem, but for 1-host/multi-slave configuration, you should consider the data conflict at more slave drive data line.
Thanks
Frank
好吧沟通有障碍,我只能作罢,查询了诸多中外资料,始终无解,至今这个问题依然悬而未决。