Future Technology Devices International Ltd. Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Version 1.1 Issue Date: 2015-08-17 This application note explains how to design auto mode sensing for RS232, RS485 and RS422 interfaces. It also describes how to implement isolation of these interfaces. The examples of auto mode sensing require two different connectors, one for RS232 and another for RS422/485. Only one protocol interface can operate at any one time. Use of FTDI devices in life support and/or safety applications is entirely at the user’s risk, and the user agrees to defend, indemnify and hold FTDI harmless from any and all damages, claims, suits or expense resulting from such use. Future Technology Devices International Limited (FTDI) Unit 1, 2 Seaward Place, Glasgow G41 1HH, United Kingdom Tel.: +44 (0) 141 429 2777 Fax: + 44 (0) 141 429 2758 E-Mail (Support): [email protected] Web: http://www.ftdichip.com Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 Table of Contents 1 Introduction .................................................................... 2 2 Implementing RS232/RS422/RS485 Auto-Sensing ........ 3 RS232/RS422/RS485 Auto-Sensing reference design ....................... 3 RS422/RS485 Auto-Sensing reference design ................................... 7 Termination Resistors ..................................................................... 10 3 Implementing RS232/RS422/RS485 Isolation ............. 11 Isolated RS232 System ................................................................... 11 Isolated RS422 System ................................................................... 13 Isolated RS485 System ................................................................... 15 4 Contact Information ...................................................... 18 Appendix A – List of Figures and Tables ............................. 19 List of Figures ................................................................................. 19 Appendix B – Revision History ........................................... 20 Product Page Document Feedback 1 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 1 Version 1.1 Clearance No.: FTDI# 158 Introduction This application note explains how to combine RS232, RS485 and RS422 functions into one product and how to auto sense which interface is being used. Any application should have two different connectors, only one of which can be used at any one time: one for RS232 and one for RS422/485. It also explains how to implement isolated RS232/422/485 interfaces in system. The example schematics are given are for illustration purposes only. Product Page Document Feedback 2 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 2 Version 1.1 Clearance No.: FTDI# 158 Implementing RS232/RS422/RS485 Auto-Sensing The following example illustrates one possible solution to auto-sense the RS232/422/485 interface. Any application requires two different connectors: one for RS232 and another for RS422/485. Only one connector can be in use at any one time. RS232/RS422/RS485 Auto-Sensing reference design When designing the RS232, RS485 and RS422 interfaces in one circuit, care must be taken with the receiver source since it can be from any one of the three interface converter’s output pins. These cannot be simply shorted together. In this case, it is necessary that these three interface outputs are maintained at a high state when they are idle, and use an AND gate to sense the interface sources. This is illustrated in the following diagram. Product Page Document Feedback 3 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 Figure 2-1 RS232/RS422/RS485 Auto Sensing Block Diagram As shown, it is necessary to add some bias resistors to guarantee that the RS422/485 interfaces output a high state when the interfaces are idle. The ZT3243, the converter for RS232 interface, has an internal 5KΩ pull-down resistor, which forces the R1OUT output to a high state when the RS232 bus is idle. The Product Page Document Feedback 4 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 AND gate is used to link the three received sources into FTDI RXD pin. The result is that the correct data is received no matter which interfaces is being used. The limitation is that only one interface can be used at any one time. The same method is suitable for the CTS received signal. Notes. 1. When using FT232R and FT4232H in RS485 mode, it is necessary to program the EEPROM to enable the TXDEN function. 2. In the reference design, RS485 cannot support echo function since it will cause data overlap when in the RS422 mode. 3. The jumpers (J1, J2 and J3) are reserved to enable terminal and bias resistors. Mounting the jumpers (J1, J2 and J3) will enable the 120 Ohm termination and 680 Ohm bias resistors. The below section (CH2.3) shows the details with termination resistor. The terminator function has to be enabled when the device is connected at the end of a cable in RS485 mode. Product Page Document Feedback 5 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 A completed reference design example is given in Figure 2-2 Figure 2-2 Reference Design 1 – RS232/RS422/RS485 Auto-sensing Product Page Document Feedback 6 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 RS422/RS485 Auto-Sensing reference design If auto-sensing is only required between RS422 and RS485, then the example shown in Figure 2-3 can be used. This method is similar to the RS232/422/485 sensing method. Figure 2-3 RS485/RS422 Auto-Sensing Block Diagram Again, it is necessary to add some bias resistors to guarantee that the RS422/485 interfaces outputs are high when the interfaces are idle. The AND gate is used to link the two received sources into FTDI RXD pin. The result is that the correct data is received no matter which interfaces is being used. The limitation is that only one interface can be used at any one time. Product Page Document Feedback 7 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 Notes. 1. When using FT232R and FT4232H in RS485 mode, it is necessary to program the EEPROM to enable the TXDEN function. 2. In this design, RS485 cannot use echo mode since it will cause data overlap in the RS422 mode. 3. The jumpers (J1, J2 and J3) are reserved for terminal and bias resistors enabled. Mounting the jumpers (J1, J2 and J3) will enable the 120 Ohm termination and 680 Ohm bias resistors. The below section (CH2.3) shows the details with termination resistor. The terminator function has to be enabled when the device is connected at the end of cable in RS485 mode. Product Page Document Feedback 8 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 A completed reference design example is given in Figure 2-4. Figure 2-4 Reference Design 2 – RS422/RS485 Auto-sensing Product Page Document Feedback 9 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 Termination Resistors The recommended arrangement of the wires is as a connected series of point-to-point (multi-dropped) nodes, a line or bus, not a star, ring, or multiply-connected network. Ideally, the two ends of the cable will have a termination resistor connected across the two wires. Without termination resistors, reflections of fast driver edges can cause multiple data edges that can cause data corruption. Termination resistors also reduce electrical noise sensitivity due to the lower impedance, and bias resistors are required. The value of each termination resistor should be equal to the cable impedance (typically, 120 Ohms for twisted pairs). The reference circuit below illustrates a simple method to control the bias and terminal resistors without having to use jumpers. Normally, the terminator function has to be enabled when the device is connected at the end of cable in RS485 mode. Figure 2-5 RS485’s Termination Enable/Disable Control Circuit Product Page Document Feedback 10 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 3 Version 1.1 Clearance No.: FTDI# 158 Implementing RS232/RS422/RS485 Isolation This chapter illustrates how to implement an isolated RS232/422/485interface. It also shows how to implement the isolated power and ground. The independent power/ground/interface signals can help to avoid the abnormal coupling of noise back into the system. Isolated RS232 System An example of how to isolate the RS232 interface is shown in Figure 3-1. The transformer is used to isolate the power source and the optical couplers are used to isolate the interface signals. Note that there are two independent grounds in the system. Figure 3-1 Block Diagram of RS232 Isolated Product Page Document Feedback 11 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 A completed reference design example is given in Figure 3-2. Figure 3-2 Reference Design 3 – RS232 Isolation Implementation Example Product Page Document Feedback 12 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 Isolated RS422 System An example of how to isolate an RS422 interface is shown in Figure 3-3. The transformer is used to isolate the power source and the optical couplers are used to isolate the interface signals. Note that there are two independent grounds in the system. Figure 3-3 Block Diagram of RS422 Isolated Product Page Document Feedback 13 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 A completed reference design example is given in Figure 3-4 Figure 3-4 Reference Design 4 – RS422 Isolation Implementation Example Product Page Document Feedback 14 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 Isolated RS485 System An example of how to isolate an RS485 interface is shown in Figure 3-5. The transformer is used to isolate the power source and the optical couplers are used to isolate the interface signals. Note that there are two independent grounds in the system. Figure 3-5 Block Diagram of RS485 Isolated Notes. 1. When using FT232R and FT4232H in RS485 mode, it is necessary to program the EEPROM to enable the TXDEN function. 2. RS485 interface shown above has an echo function enabled. The jumper links shown in Figure3-6 can be used to enable or disable this function. If using an FT232R, it is possible to use one CBUS pin to connect to RE# pin to configure the echo function. If setting the CBUS pin to TXDEN by EEPROM programming, it will not support the RS485 echo function. If setting the CBUS pin to PWREN# by EEPROM programming, it will support the RS485 echo function. Product Page Document Feedback 15 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 A completed reference design example is given in Figure3-6 Figure 3-6 Reference Design 5 – RS485 Isolation Implementation Example Product Page Document Feedback 16 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 Notes. 1. The optical coupler inverts the signal and the data transfer also has a delay time. If this isolated example is used, then it is necessary to check the delay time and ensure that it has no side effects on the selected data baud rate. 2. FT232R support the ability to invert signals using the EEPROM setting. This allows removing the NOT gates used in the isolated examples. 3. When using FT232R and FT4232H in RS485 mode, it is necessary to program the EEPROM to enable the TXDEN function. Product Page Document Feedback 17 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 4 Version 1.1 Clearance No.: FTDI# 158 Contact Information Head Office – Glasgow, UK Branch Office – Tigard, Oregon, USA Future Technology Devices International Limited Unit 1, 2 Seaward Place, Centurion Business Park Glasgow G41 1HH United Kingdom Tel: +44 (0) 141 429 2777 Fax: +44 (0) 141 429 2758 Future Technology Devices International Limited (USA) 7130 SW Fir Loop Tigard, OR 97223-8160 USA Tel: +1 (503) 547 0988 Fax: +1 (503) 547 0987 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) E-Mail (Sales) E-Mail (Support) E-Mail (General Enquiries) [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] Branch Office – Taipei, Taiwan Branch Office – Shanghai, China Future Technology Devices International Limited (Taiwan) 2F, No. 516, Sec. 1, NeiHu Road Taipei 114 Taiwan , R.O.C. Tel: +886 (0) 2 8791 3570 Fax: +886 (0) 2 8791 3576 Future Technology Devices International Limited (China) Room 1103, No. 666 West Huaihai Road, Shanghai, 200052 China Tel: +86 21 62351596 Fax: +86 21 62351595 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) E-Mail (Sales) E-Mail (Support) E-Mail (General Enquiries) [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] Web Site http://ftdichip.com Distributor and Sales Representatives Please visit the Sales Network page of the FTDI Web site for the contact details of our distributor(s) and sales representative(s) in your country. System and equipment manufacturers and designers are responsible to ensure that their systems, and any Future Technology Devices International Ltd (FTDI) devices incorporated in their systems, meet all applicable safety, regulatory and system-level performance requirements. All application-related information in this document (including application descriptions, suggested FTDI devices and other materials) is provided for reference only. While FTDI has taken care to assure it is accurate, this information is subject to customer confirmation, and FTDI disclaims all liability for system designs and for any applications assistance provided by FTDI. Use of FTDI devices in life support and/or safety applications is entirely at the user’s risk, and the user agrees to defend, indemnify a nd hold harmless FTDI from any and all damages, claims, suits or expense resulting from such use. This document is subject to change without notice. No freedom to use patents or other intellectual property rights is implied by the publication of this document. Neither the whole nor any part of the information contained in, or the product described in this document, may be adapted or reproduced in any material or electronic form without the prior written consent of the copyright holder. Future Technology Devices International Ltd, Un it 1, 2 Seaward Place, Centurion Business Park, Glasgow G41 1HH, United Kingdom. Scotland Registered Company Number: SC136640 Product Page Document Feedback 18 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 Appendix A – List of Figures and Tables List of Figures Figure 2-1 RS232/RS422/RS485 Auto Sensing Block Diagram ........................................................... 4 Figure 2-2 Reference Design 1 – RS232/RS422/RS485 Auto-sensing .................................................. 6 Figure 2-3 RS485/RS422 Auto-Sensing Block Diagram ..................................................................... 7 Figure 2-4 Reference Design 2 – RS422/RS485 Auto-sensing ............................................................ 9 Figure 2-5 RS485’s Termination Enable/Disable Control Circuit ........................................................ 10 Figure 3-1 Block Diagram of RS232 Isolated ................................................................................. 11 Figure 3-2 Reference Design 3 – RS232 Isolation Implementation Example ....................................... 12 Figure 3-3 Block Diagram of RS422 Isolated ................................................................................. 13 Figure 3-4 Reference Design 4 – RS422 Isolation Implementation Example ....................................... 14 Figure 3-5 Block Diagram of RS485 Isolated ................................................................................. 15 Figure 3-6 Reference Design 5 – RS485 Isolation Implementation Example ....................................... 16 Product Page Document Feedback 19 Copyright © 2015 Future Technology Devices International Limited Application Note AN_143 Auto Sensing And Isolation Design For Rs232/Rs422/Rs485 Interfaces Document Reference No.: FT_000270 Version 1.1 Clearance No.: FTDI# 158 Appendix B – Revision History Document Title: AN_143 Auto Sensing And Isolation Design For RS232/RS422/RS485 Interfaces Document Reference No.: FT_000270 Clearance No.: FTDI# 158 Product Page: http://www.ftdichip.com/FTProducts.htm Document Feedback: Send Feedback Revision Changes Date Version draft Initial draft 2010-05-04 Version 1.0 First release 2010-05-26 Version 1.1 Modified RS232, RS422, RS485 Isolation Implementation Example images (figure 3-2, figure 3-4 & figure 3-6) 2015-08-17 Product Page Document Feedback 20 Copyright © 2015 Future Technology Devices International Limited