In industrial applications, there are many bus application scenarios, such as the conversion between RS-232 and RS-485 with bidirectional isolation, and the sharing of RS-485 and RS-422 interfaces. This article will introduce solutions for such applications that are not only simple and convenient but also improve communication reliability.
The module shown on the right side of Figure 1 is an RS-232/RS-485 bidirectional conversion module, which not only has a large size and slow speed but also does not achieve isolation between the RS-232 and RS-485 buses. The left side of Figure 1 shows the MPM11T module, which can achieve automatic switching between RS-485 and RS-232 buses with a simple connection as shown in Figure 2.
Figure 1 RS-232/RS-485 Bidirectional Conversion Module
Figure 2 RS-232 to RS-485 Interface
MPM11(A)T integrates RS-232 and RS-485 transceivers, with a size of only 24.98mm×16.9mm×7.1mm, and the communication speed of the RS-485 interface is 250kbps, while the RS-232 communication speed is 120kbps. Therefore, using MPM11(A)T can achieve a maximum bidirectional conversion speed of 120kbps between RS-232 and RS-485. Figures 3, 4, and 5 show the communication waveforms of RS-232 and RS-485 bidirectional conversion using MPM11T, which indicate good quality of the bus waveforms.
Figure 3 Communication Waveform 1 of RS-485 and RS-232 Bidirectional Conversion Using MPM11T
Figure 4 Communication Waveform 2 of RS-485 and RS-232 Bidirectional Conversion Using MPM11T
Figure 5 Communication Waveform 3 of RS-485 and RS-232 Bidirectional Conversion Using MPM11T
MPM11(A)T module not only isolates between input and output, but also isolates between the output RS-232 channel and the RS-485 channel, and has high EMC protection capability. In bare metal conditions, the RS-485 and RS-232 interfaces can withstand contact static electricity of ±4kV and common mode surge of ±2kV. If a higher level is needed, refer to the protection circuit recommended in the MPM11(A)T data sheet. After using the recommended protection circuit, the RS-485 and RS-232 interfaces can withstand contact static electricity of ±8kV, common mode surge of ±4kV, and differential mode surge of ±2kV.
In practical applications, the devices that need to communicate may be RS-422 or RS-485 interfaces, so the product needs to have the ability to communicate with both RS-422 and RS-485 interfaces. Leaving separate interface positions would increase the size of the product, so a shared interface for RS-422 and RS-485 is a feasible method to reduce the product size.
As shown in Figure 6, two RSM(3)485ECHT modules can be used, and by toggling switch S1, switching between RS-485 and RS-422 buses can be achieved. As shown in Table 1, if using RS-485 mode, simply set switch S1 to position 0, and the external interface only needs to use interfaces 1-3; if using RS-422 mode, set switch S1 to position 1, and the external interface needs to use interfaces 1-5. If the bus uses shielded twisted pair, the RGND pin can be connected to the shield layer, and the shield layer should be grounded at a single point. If RGND is not used, RGND can be left floating.
Figure 6 Using Two RSM(3)485ECHT to Achieve Shared RS-422 and RS-485 Interfaces
Table 1 Switch Description and Bus Pin Connection
If the application environment is good and no termination resistors are needed in the bus, one RSM(3)485IDHT can be used to achieve shared RS-485 and RS-422 interfaces, which can reduce the board area and does not require control of CON, making the application more convenient.
Figure 7 RSM(3)485IDHT Achieving Shared RS-485 and RS-422 Interfaces
In practical applications, if the product itself is an RS-422 interface but the device communicating with it is an RS-485 interface, it is often necessary to connect the RS-422 interface as an RS-485 interface for use. Below, taking the isolated RS-422 transceiver module RSM422 as an example, connect pin A of the module to pin Y and pin B to pin Z to connect to the RS-485 bus. Since the RS-422 bus is full-duplex, if DE and RE are enabled simultaneously, the RXD pin will output the data sent by TXD, causing the MCU to receive erroneous data and thus leading to abnormalities. Therefore, DE and RE pins should be synchronized to maintain the same level or the MCU program should process the received data. Also, after sending data, DE should be disabled to avoid interfering with the normal operation of the bus.
Figure 8 Connecting RS-422 Interface as RS-485 Interface
In some cases, CON can be directly connected to the TXD pin to achieve automatic send/receive of the module. The circuit connection is shown in Figure 9, and its communication waveforms are shown in Figures 10, 11, and 12. However, this application method has a delay of 3.8μs for the start bit of the first byte of each data frame, so theoretically, the maximum communication speed is 131kbps. It is recommended to use a lower communication speed and maintain TXD at a high level for at least 25μs after sending data before receiving. If a higher communication speed automatic send/receive module is needed, RSM(3)485PHT can be chosen, which can provide a maximum communication speed of 500kbps.
Figure 9 RSM(3)485ECHT Achieving Automatic Send/Receive
Figure 10 Communication Waveform 1 of RSM485ECHT Automatic Send/Receive
Figure 11 Communication Waveform 2 of RSM485ECHT Automatic Send/Receive
Figure 12 Communication Waveform 3 of RSM485ECHT Automatic Send/Receive
Figure 13 RSM485ECHT Automatic Send/Receive, with a 3.8μs Delay for the Start Bit of the First Byte of Each Frame
If you have any questions, please call the ZLG official technical support hotline: 400-888-4005
ZhiYuan Electronics Introduction
Guangzhou ZhiYuan Electronics Co., Ltd. was established in 2001 and is a national high-tech certified enterprise and the engineering technology research and development center for high-end industrial control measurement instruments in Guangdong Province.
Vision:To become a leading enterprise in the industrial Internet ecosystem
Design high-value-added modules, boards, and high-end measurement instruments using “chip + AWorks software platform”. Through wired and wireless interfaces, connect to the ZWS IoT cloud to achieve big data processing and form an industrial Internet ecosystem.
Mission:To advance the process of China’s industrial Internet with leading technology
Values:Professionalism and focus achieve dreams