A test circuit and implementation method for optical link module
By designing an optical link module test circuit including a control unit, an interface unit, an optical unit and a power supply unit, the problem of lack of testing tools in the prior art is solved, the function and performance testing of the optical link module is realized, and the reliability of field bus transmission is improved.
Patent Information
- Application Number
- CN202411943283.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-27
AI Technical Summary
In the prior art, there are fewer testing tools for optical link modules, single test models and single functions, resulting in abnormalities that are prone to on-site use.
A test circuit for an optical link module is designed, including a control unit, an interface unit, an optical unit and a power supply unit. The test circuit composed of these units can test the functions and performance of the optical module.
It realizes rapid positioning and troubleshooting of optical link modules, and improves the reliability and stability of PROFIBUS fieldbus transmission.
Smart Images

Figure CN119382791B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an optical link module, and in particular to a test circuit and an implementation method of the optical link module. Background Art
[0002] Optical link modules are used to achieve medium-distance information networking and data transmission in industrial scenarios. In actual networking and transmission applications, network communication failures are often found. The failure phenomenon is an interruption alarm at a certain node in the network. After replacing the optical link module of the node, the network communication returns to normal. This proves that the failure efficiency of optical link modules in industrial scenarios is high. However, there are few testing tools for optical link modules on the market, and the test models and functions are single. Therefore, a test circuit is designed to test the functions and performance of optical modules to avoid abnormalities of optical link modules when used on site. Summary of the invention
[0003] In view of the above problems in the prior art, the present invention provides a test circuit and implementation method for an optical link module. The test circuit design of the optical link module composed of a control unit, an interface unit, an optical unit, and a power supply unit is used to solve the problems in the prior art.
[0004] The technical scheme adopted by the present invention is: a test circuit of an optical link module comprises a control unit, an interface unit, an optical unit and a power supply unit, wherein the control unit adopts a SAM-3732 core controller, the interface unit adopts an STM32F407VET6 controller, the optical unit has a built-in PROFIBUS OLM / G12 V4.0 optical link module, the power supply unit adopts an 18650 lithium battery pack as a core device, and the lithium battery pack outputs a power supply of 5V and a power supply of 3.3V through a DC / DC circuit 1 and a DC / DC circuit 2 to supply power to the control unit and the interface unit.
[0005] Among them, the JTAG function pin of the interface unit controller expands a JTAG interface, the UART2 function pin of the controller expands an RS-232 interface circuit 2, and the UART1 and UART6 function pins of the controller expand RS-485 interface circuit 1 and RS-485 interface circuit 2. The controller is connected to the optical link module to be tested and the optical link module of the optical unit through RS-485 interface circuit 1 and RS-485 interface circuit 2 respectively; the controller is connected to the optical link module to be tested and the optical link module of the optical unit through relay 1 and relay 2 respectively.
[0006] The interface unit controller is connected to the optical link module of the optical unit and the optical link module to be tested through two built-in A / D channels to accurately test the power of the optical link module, and is connected to the lithium battery pack through a built-in A / D channel via a voltage divider circuit to calculate the current remaining battery power.
[0007] The power supply unit lithium battery pack is connected to the optical link module to be tested and the optical link module of the optical unit through relay 1 and relay 2 respectively, so as to power off or supply power for the optical link module of the optical unit and the optical link module to be tested.
[0008] The control unit core controller is connected to the LCD touch screen through the LVDS bus and the IIC bus to complete human-computer interaction. At the same time, the USB_HOST interface circuit, USB_OTG interface circuit and RS-232 interface circuit 1 are expanded through the USB_HOST, USB_OTG and UART1 function pins of the core controller respectively, which are used by developers to perform online debugging, firmware burning and LOG printing.
[0009] The beneficial effects of the present invention are: by using the test circuit designed by the present invention to test the function and performance of the optical module, when a communication failure occurs in the PROFIBUS field bus, the intermediate fault node (optical link module) on the data transmission link can be quickly located, providing an important basis and reference for the staff when troubleshooting on-site problems, helping to repair and solve the problem in a short time, and ensuring the reliability and stability of the PROFIBUS field bus transmission. The present invention has the advantages of high reliability and strong practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 The overall connection principle block diagram of the test circuit of the optical link module of the present invention;
[0011] Figure 2 yes Figure 1 The circuit connection schematic diagram of the core controller N201A of the control unit;
[0012] Figure 3 yes Figure 1 The circuit connection schematic diagram of the core controller N201B of the control unit;
[0013] Figure 4 yes Figure 1 The circuit connection schematic diagram of the USB_HOST interface of the control unit;
[0014] Figure 5 yes Figure 1 The schematic diagram of the USB_OTG interface circuit connection of the central control unit;
[0015] Figure 6 yes Figure 1The connection schematic diagram of the RS-232 interface circuit 1 of the control unit;
[0016] Figure 7 yes Figure 1 The circuit connection schematic diagram of the interface unit controller;
[0017] Figure 8 yes Figure 1 The connection principle diagram of the RS-485 interface circuit 1 of the middle interface unit;
[0018] Fig. 9 yes Figure 1 The connection principle diagram of the RS-485 interface circuit 2 of the middle interface unit;
[0019] Fig.10 yes Figure 1 The connection principle diagram of the RS-232 interface circuit 2 of the middle interface unit;
[0020] Fig.11 yes Figure 1 The circuit connection schematic diagram of the relay 1 in the middle interface unit;
[0021] Fig.12 yes Figure 1 The circuit connection schematic diagram of the relay 2 in the middle interface unit;
[0022] Fig.13 This is a flow chart of the optical receiving-electrical sending message function test of the present invention;
[0023] Fig.14 This is a flow chart of the electrical receiving-optical sending message function test of the present invention;
[0024] Fig.15 It is a delay function test flow chart of the present invention;
[0025] Fig.16 This is a flow chart of the optical receiving power test of the present invention;
[0026] Fig.17 It is a flow chart of the optical transmission power test of the present invention. DETAILED DESCRIPTION
[0027] The present invention will be further described below in conjunction with the accompanying drawings.
[0028] like Figure 1As shown, the test circuit of the optical link module includes a control unit, an interface unit, an optical unit, and a power supply unit. The control unit uses the SAM-3732 embedded system module of Shengbo Technology as the core controller, the interface unit uses the STM32F407VET6 embedded single-chip computer as the controller, the optical unit has a built-in Siemens PROFIBUS OLM / G12 V4.0 optical link module, and the power supply unit uses a 24V6AH rechargeable 18650 lithium battery pack as the core device. The lithium battery pack outputs 5V power and 3.3V power through DC / DC circuit 1 and DC / DC circuit 2 to power the control unit and the interface unit.
[0029] Among them, the JTAG function pin of the interface unit controller expands a JTAG interface, the UART2 function pin of the controller expands an RS-232 interface circuit 2, the UART1 and UART6 function pins of the controller expand RS-485 interface circuit 1 and RS-485 interface circuit 2, and the controller is connected to the optical link module to be tested and the optical link module of the optical unit through RS-485 interface circuit 1 and RS-485 interface circuit 2 respectively; the controller is connected to the optical link module to be tested and the optical link module of the optical unit through relay 1 and relay 2 respectively.
[0030] The interface unit controller connects the optical link module of the optical unit and the optical link module to be tested through two built-in A / D channels to accurately test the power of the optical link module, and connects the lithium battery pack through a built-in A / D channel via a voltage divider circuit to calculate the current remaining battery power.
[0031] The lithium battery pack of the power supply unit is connected to the optical link module to be tested and the optical link module of the optical unit through relay 1 and relay 2 respectively, so as to cut off or supply power for the optical link module of the optical unit and the optical link module to be tested.
[0032] The control unit core controller (N201A, N201B) is connected to a 7-inch LCD touch screen through the LVDS bus and the IIC bus for human-computer interaction. At the same time, the USB_HOST interface circuit, USB_OTG interface circuit and RS-232 interface circuit 1 are expanded through the USB_HOST, USB_OTG and UART1 function pins of the core controller for developers to perform online debugging, firmware burning and LOG printing.
[0033] like Figure 3 , Figure 4As shown, in the control unit USB_HOST interface circuit, the electrical connection points USB_HOST_P and USB_HOST_N are connected to the USB_HOST_DP pin and USB_HOST_DN pin of the core controller N201B through resistors R211 and R213; at the same time, the 1st and 6th pins of the TVS tube VD301 of model NUP4202W1T2G are connected respectively through the inductor L301 (model SDCW2012-2-900TF), and the 2nd pin of the TVS tube VD301 is grounded; and then they are respectively connected to the 3rd pin of the USB socket XS303 of model 8968-A04C00RW. Pin 1 and pin 2; Pin 4 of the USB socket XS303 is grounded through a magnetic bead FB303 (interference suppression, model PBY1608087-100Y-N), pin 5 and pin 6 of the USB socket XS303 are connected and grounded, pin 1 of the USB socket XS303 is connected to the positive electrode of electrolytic capacitor C301, the positive electrode of electrolytic capacitor C302 and one end of capacitor C303 and capacitor C304 through a magnetic bead FB301, and then connected to a 5V power supply through a fuse F302 (model 1206L050 / 15YR), and the negative electrode of electrolytic capacitor C301, electrolytic capacitor C302 and the other end of capacitor C303 and capacitor C304 are connected and grounded.
[0034] like Figure 3 , Figure 5 As shown, in the USB_OTG interface circuit of the control unit, the electrical connection points USB_OTG_P and USB_OTG_N are connected to the USB_OTG_DP pin and USB_OTG_DN pin of the core controller N201B through the resistors R214 and R212; at the same time, the 1st and 6th pins of the TVS tube VD303 of the model NUP4202W1T2G are respectively connected through the inductor L302 (model SDCW2012-2-900TF), and the 2nd pin of the TVS tube VD303 is grounded; then they are respectively connected to the 3rd and 2nd pins of the USB socket XS304 of the model 8968-A04C00RW; the 4th pin of the USB socket XS304 is connected to the ground through the magnetic bead FB305 (interference suppression, model PBY1608087-100Y-N) is grounded, the 5th and 6th pins of the USB socket XS304 are connected and grounded, the 1st pin of the USB socket XS304 is connected to the positive electrode of the electrolytic capacitor C305, the positive electrode of the electrolytic capacitor C306 and one end of the capacitor C307 and the capacitor C308 through the magnetic bead FB304, and then connected to the power supply 5V through the fuse F306, the negative electrode of the electrolytic capacitor C305, the electrolytic capacitor C306 and the other end of the capacitor C307 and the capacitor C308 are connected and grounded.
[0035] like Figure 2 , Figure 6As shown, in the RS-232 interface circuit 1 of the control unit, a transceiver chip N301 of model MAX3232CUE+T is used, and pins 1 and 3 of the transceiver chip N301 are respectively connected to both ends of capacitor C310, pin 2 is connected to power supply 3.3V through capacitor C309, pins 4 and 5 are respectively connected to both ends of capacitor C312, pin 6 is grounded through capacitor C313, one end of capacitor C311 is connected to power supply 3.3V, and the other end is grounded; the electrical connection points UART1_TX and UART1_RX of pins 11 and 12 are connected to the serial port UART1_TX pin and UART1_RX pin of the core controller N201A through resistors R203 and R204; pin 13 is connected to the serial port UART1_TX pin and UART1_RX pin of the core controller N201A through fuse F308 (model 08005L010 / 24 ) is connected to one end of the TVS diode VD304 (model SMA518CA), the other end of the TVS diode VD304 is grounded, and at the same time, pin 13 is connected to pin 2 of the socket XS305 model B03B-XASK-1; pin 14 is connected to one end of the TVS diode VD305 through a fuse F307, and the other end of the TVS diode VD305 is grounded; at the same time, pin 14 is connected to pin 1 of the socket XS305, pin 15 is grounded, pin 16 is connected to the power supply 3.3V, and pin 3 of the socket XS305 is grounded through a resistor R307.
[0036] like Figure 7As shown in the interface unit controller circuit, the controller uses a single-chip microcomputer N1 of model STM32F407VET6, the 32nd pin of the single-chip microcomputer N1 is connected to the cathode of the light-emitting diode VD4, and the anode of the light-emitting diode VD4 is connected to the power supply 3.3V through the resistor R33; the 14th pin of the single-chip microcomputer N1 is connected to the power supply 3.3V through the resistor R1 and is grounded through the capacitor C1, and the 14th pin of the single-chip microcomputer N1 is connected to the 1st pin of the button N12, and the 2nd pin of the button N12 is grounded; the 12th pin, Pin 13 is connected to both ends of resistor R2 and passive crystal oscillator X1, and grounded through capacitor C2 and capacitor C3 respectively; pin 8 and pin 9 of single-chip microcomputer N1 are connected to both ends of resistor R3 and passive crystal oscillator X2, and grounded through capacitor C4 and capacitor C5 respectively; pin 11, pin 19, pin 28, pin 50, pin 75, and pin 100 of single-chip microcomputer N1 are connected to one end of capacitor C49, capacitor C48, capacitor C47, capacitor C46, capacitor C45, and capacitor C44, and then connected to power supply 3.3V, The other ends of capacitors C49, C48, C47, C46, C45 and C44 are connected and grounded; pin 94 of microcontroller N1 is connected to pin 2 of transistor VT5 (model S8550) through resistor R7 and grounded through resistor R8; pin 3 of transistor VT5 is connected to power supply 3.3V through resistor R6; pin 1 of transistor VT5 is connected to power supply 3.3V through resistor R5 and resistor R4, and connected to pin 1 of dip switch chip N11 (model A6S-2104-H) through resistor R5; pin 4 of dip switch chip N11 is grounded.
[0037] like Figure 8 As shown, in the RS-485 interface circuit 1 of the interface unit, an RS-485 transceiver chip N3 of model ADM2582EBRWZ and a dip switch chip N13 of model A6S-5104-H are used, and the electrical connection points USART1_RX and USART1_TX of the 1-pin and 2-pin of the dip switch chip N13 are connected to the 69-pin and 68-pin of the single-chip computer N1; the electrical connection points RS-485-1_TX and RS-485-1_RX of the 9-pin and 10-pin of the dip switch chip N13 are connected to the 7-pin and 4-pin of the RS-485 transceiver chip N3;
[0038] The 13th and 15th pins of the RS-485 transceiver chip N3 are connected to the 18th and 17th pins, and then connected to both ends of the resistor R44, and at the same time connected to the 1st and 2nd pins of the socket XS17 of the model B03B-XASK-1 through the fuses F26 and F27; the 3rd pin of the socket XS17 is grounded; the 2nd and 8th pins of the RS-485 transceiver chip N3 are connected to one end of the capacitors C14, C13, C12 and C11, and then connected to the power supply 3.3V, the capacitor C 14. The other ends of capacitors C13, C12, and C11 are connected and grounded; pins 5 and 6 of the RS-485 transceiver chip N3 are connected to pin 70 of the microcontroller N1; pins 1, 3, 9, and 10 are connected and grounded, and pins 11, 14, 16, and 20 are connected and grounded; pins 12 and 19 are connected to one end of capacitors C15, C16, C17, and C18, and the other ends of capacitors C15, C16, C17, and C18 are grounded.
[0039] like Fig. 9 As shown, in the interface unit RS-485 interface circuit 2, an RS-485 transceiver chip N4 of model ADM2582EBRWZ and a dip switch chip N14 of model A6S-5104-H are used, and the electrical connection points USART6_RX and USART6_TX of the 1-pin and 2-pin of the dip switch chip N14 are connected to the 64-pin and 63-pin of the single-chip computer N1; the electrical connection points RS-485-2_TX and RS-485-2_RX of the 9-pin and 10-pin of the dip switch chip N14 are connected to the 7-pin and 4-pin of the RS-485 transceiver chip N4;
[0040] The 13th and 15th pins of the RS-485 transceiver chip N4 are connected to the 18th and 17th pins, and then connected to both ends of the resistor R45, and at the same time connected to the 1st and 2nd pins of the socket XS16 of the model B03B-XASK-1 through the fuses F28 and F29; the 3rd pin of the socket XS16 is grounded; the 2nd and 8th pins of the RS-485 transceiver chip N4 are connected to one end of the capacitors C22, C21, C20, and C19, and then connected to the power supply 3.3V, and the capacitor C 22. The other ends of capacitor C21, capacitor C20, and capacitor C19 are connected and grounded; pins 5 and 6 of RS-485 transceiver chip N4 are connected to pin 65 of microcontroller N1; pins 1, 3, 9, and 10 are connected and grounded, and pins 11, 14, 16, and 20 are connected and grounded; pins 12 and 19 are connected to one end of capacitor C23, capacitor C24, capacitor C25, and capacitor C26, and the other ends of capacitors C23, capacitor C24, capacitor C25, and capacitor C26 are grounded.
[0041] like Fig.10 As shown, in the interface unit RS-232 interface circuit 2, a transceiver chip N2 of model MAX3232CUE+T is used, pins 1 and 3 of the transceiver chip N2 are connected to both ends of a capacitor C6, pins 4 and 5 are connected to both ends of a capacitor C7, and the electrical connection points USART2_TX and USART2_RX of pins 11 and 12 are connected to pins 86 and 87 of the single-chip computer N1; pin 16 is connected to a power supply of 3.3V and is grounded through a capacitor C8; pins 2 and 6 of the transceiver chip N2 are grounded through capacitors C9 and C10 respectively; the electrical connection points RS-232_TX and RS-232_RX of pins 14 and 13 are connected to pins 1 and 2 of a socket XS10 of model B03B-XASK-1 through fuses F5 and F17, and pin 3 of the socket XS10 is grounded.
[0042] like Fig.11 As shown, in the relay 1 circuit of the interface unit, a relay N9 of model APAN3105 is used, pin 6 of the relay N9 is connected to DC24V, pin 5 is connected to pin 1 of the socket XS3 of model B2P-VH (LF) (SN), and pin 2 of the socket XS3 is grounded; pin 2 of the relay N9 is connected to the power supply 5V through a resistor R13, pin 1 is connected to pin 3 of the transistor VT3 (model MMBT5551LT1G), pin 1 of the transistor VT3 is connected to the electrical connection point POWER1_CON through a resistor R12, the electrical connection point POWER1_CON is connected to pin 1 of the microcontroller N1, and pin 2 of the transistor VT3 is grounded.
[0043] The electrical connection point POWER1_CON is connected to pin 1 of the microcontroller N1. When pin 1 of the microcontroller N1 outputs a high level, the base of the transistor VT3 is at a high level. Since the emitter is grounded, the collector and the emitter are turned on, so that pin 1 of the relay N9 is at a low level, and there is a voltage difference between pin 1 and pin 2 of the relay N9, so that pin 5 and pin 6 of the relay N9 are closed and connected, and pin 5 of the relay N9 is connected to pin 1 of the socket XS3. Therefore, the 24V voltage passes through the relay N9, and the socket XS3 supplies power to the optical link module to be tested.
[0044] like Fig.12As shown, in the circuit of the interface unit relay 2, a relay N10 of model APAN3105 is used, pin 6 of the relay N10 is connected to DC24V, pin 5 is connected to pin 1 of the socket XS4 of model B2P-VH (LF) (SN), and pin 2 of the socket XS4 is grounded; pin 2 of the relay N10 is connected to the power supply 5V through a resistor R14, pin 1 is connected to pin 3 of the transistor VT4, pin 1 of the transistor VT4 is connected to the electrical connection point POWER2_CON through a resistor R15, the electrical connection point POWER2_CON is connected to pin 2 of the microcontroller N1, and pin 2 of the transistor VT4 is grounded.
[0045] Implementation method of the test circuit of the optical link module: When the optical link module needs to be tested, the optical unit is connected to the optical link module to be tested through the optical fiber transmission line, and the interface unit is connected to the optical link module to be tested through the RS-485 interface circuit 1 and the A / D interface, and the following functional tests are performed: optical reception-electrical transmission message function test, electrical reception-optical transmission message function test, delay function test, optical reception power test, and optical transmission power test.
[0046] like Fig.13As shown, the optical receiving-electrical sending message function test: the test mode is triggered by the LCD touch screen of the control unit, the control unit sends the mode test command to the interface unit through the UART2 interface, the interface unit operates the relays (relay 2, relay 1) to power on the optical unit and the optical link module to be tested, and the interface unit sends the PROFIBUS bus protocol data frame "10 02 04 49 4F" to the optical unit through the RS-485 interface circuit 2. 16", the optical unit loads the data frame into the optical link and sends it to the optical link module to be tested; the interface unit listens to another set of RS-485 interface circuits 1 to receive the data frame replied by the external optical link module to be tested, and then determines whether the data frame is received within 1 second. If the data frame is received, it determines whether the contents of the received and sent data frames are the same. If they are the same, the interface unit returns the successful reception information of this cycle to the control unit, and the core controller of the control unit displays the successful reception information on the LCD touch screen; then further determines whether the cycle number is reached. If the cycle number is reached, the interface unit operates the relays (relay 2, relay 1) to the control unit to power off the optical unit and the optical link module to be tested. If it is determined that the cycle number has not been reached, it directly returns to the interface unit through the RS-485 interface power supply. The interface unit sends a PROFIBUS bus protocol data frame to the optical unit through RS-485 interface circuit 2 and enters the next cycle; if it is determined that the contents of the received and sent data frames are different, the interface unit reports an error message to the control unit, the control unit displays the error message on the LCD touch screen, and then returns to the interface unit to send a PROFIBUS bus protocol data frame to the optical unit through RS-485 interface circuit 2 and enters the next cycle; if it is determined that no data frame is received within 1 second, the interface unit determines that the cycle has timed out, reports the timeout information to the control unit, the control unit displays the timeout information on the LCD touch screen, and then returns to the interface unit to send a PROFIBUS bus protocol data frame to the optical unit through RS-485 interface circuit 2 and enters the next cycle; the optical reception-electrical transmission message test is completed.
[0047] like Fig.14As shown, the electrical receiving-optical sending message function test: the control unit sends the mode test command to the interface unit through the UART2 interface, the interface unit operates the relays (relay 2, relay 1) to power on the optical unit and the optical link module to be tested, and the interface unit sends the PROFIBUS bus protocol data frame "10 02 04 49 4F" to the optical link module to be tested through the RS-485 interface circuit 1. 16", the optical link module to be tested loads the data frame into the optical link and sends it to the optical unit; the interface unit listens to another set of RS-485 interface circuit 2 to receive the data frame replied by the optical unit, and then determines whether the data frame is received within 1 second. If the data frame is received, it determines whether the contents of the received and sent data frames are the same. If they are the same, the interface unit returns the successful reception information of this cycle to the control unit, and the control unit core controller displays the successful reception information on the LCD touch screen; then further determines whether the cycle number is reached. If the cycle number is reached, the interface unit operates the relays (relay 2, relay 1) to the control unit to power off the optical unit and the optical link module to be tested. If it is determined that the cycle number is not reached, it directly returns to the interface unit to send the PROFIBUS bus protocol data frame "10 02 04 49 4F to the optical unit through the RS-485 interface circuit 2. 16", and enter the next cycle; if it is determined that the contents of the received and sent data frames are different, the interface unit reports an error message to the control unit, the control unit displays the error message on the LCD touch screen, and then returns to the interface unit to send the PROFIBUS bus protocol data frame to the optical unit through the RS-485 interface circuit 2, and enters the next cycle; if it is determined that no data frame is received within 1 second, the interface unit determines that the cycle has timed out, reports the timeout information to the control unit, the control unit displays the timeout information on the LCD touch screen, and then returns to the interface unit to send the PROFIBUS bus protocol data frame to the optical unit through the RS-485 interface circuit 2, and enters the next cycle. The electrical reception-optical transmission message function test is completed.
[0048] like Fig.15As shown, delay function test: after selecting the corresponding baud rate, frame length and test time on the LCD touch screen setting interface, the control unit sends the test command to the interface unit through the UART2 interface, and the interface unit controller randomly generates a PROFIBUS data frame of corresponding length according to the set frame length, and adjusts the serial port baud rate to the set value; the interface unit operates the relay (relay 2, relay 1) to power on the optical unit and the optical link module to be tested, the interface unit controller generates a data frame, sends a message through the RS-485 interface circuit 2, transmits the message between the optical unit and the optical link module to be tested, and the RS-485 interface circuit 1 of the interface unit receives the data frame. The interface unit controller calculates and records the difference between the current time and the timestamp inside the data packet, and takes the average value of the recorded results of all data frames as the delay and reports it to the control unit. The control unit compares the test value with the required value, obtains the performance test result of the optical link module to be tested and displays it on the LCD touch screen, and the interface unit operates the relay (relay 2, relay 1) to power off the optical unit and the optical link module to be tested, and the delay function test is completed.
[0049] like Fig.16 As shown, optical receiving power test: when the user sets the number of test cycles through the LCD touch screen of the control unit, the optical receiving power mode test operation is triggered. First, the control unit sends the test instruction to the interface unit through the UART2 interface. The interface unit operates the relays (relay 2, relay 1) to power on the optical unit and the optical link module to be tested. The interface unit sends the PROFIBUS bus protocol data frame "10 02 0449 4F 16" to the optical unit through the RS-485 interface circuit 2. The optical unit loads the data packet into the optical link and sends it to the optical link module to be tested. The A / D channel of the interface unit collects the channel output voltage of the optical link module to be tested. The interface unit controller reports the voltage value to the core controller of the control unit. The core controller obtains the optical receiving power parameter corresponding to the current voltage level and displays the optical receiving power parameter on the LCD touch screen. The interface unit operates the relays (relay 2, relay 1) to power off the optical unit and the optical link module to be tested. The optical receiving power test is completed.
[0050] like Fig.17As shown, optical transmission power test: when the user sets the number of test cycles through the LCD touch screen of the control unit, the optical transmission power mode test operation is triggered. First, the control unit sends the test instruction to the interface unit through the UART2 interface. The interface unit operates the relays (relay 2, relay 1) to power on the optical unit and the optical link module to be tested. The interface unit sends the PROFIBUS bus protocol data frame "10 02 04 49 4F 16" to the optical link module to be tested through the RS-485 interface circuit 1. The optical link module to be tested loads the data packet into the optical link and sends it to the optical unit. The A / D channel of the interface unit collects the channel output voltage of the optical link module to be tested. The interface unit controller reports the voltage value to the core controller of the control unit. The core controller obtains the optical transmission power parameter corresponding to the current voltage level, and displays the optical transmission power parameter on the LCD touch screen. The interface unit operates the relays (relay 2, relay 1) to power off the optical unit and the optical link module to be tested, and the optical transmission power test is completed.
[0051] The interface unit controller uses the RS-485 transceiver chip N3 and the RS-485 transceiver chip N4 to expand two groups of RS-485 interface circuits and interfaces through two groups of UART function pins. One group is used to communicate with the optical unit, and the other group is used to communicate with the optical link module to be tested. At the same time, the 15-pin and 35-pin of the controller are connected to the optical unit and the optical link module to be tested through two built-in A / D channels to accurately test the optical power of the optical link module to be tested; through the 17-pin built-in A / D channel, the lithium battery pack is connected through the voltage divider circuit to measure the current remaining battery power, and the relay is controlled through the 1-pin and 2-pin to control the optical unit and the optical link module to be tested to power on. At the same time, the JTAG pin of the controller is used to expand the JTAG interface, and the transceiver chip N2 is used to expand the RS-232 interface circuit and interface; user developers perform online debugging, firmware burning, LOG printing and other maintenance work; the optical unit has a built-in Siemens PROFIBUS OLM / G12 The V4.0 optical link module is used to complete the "electrical-optical" signal conversion required for the test; the power supply unit uses a set of 24V6AH rechargeable 18650 lithium battery packs as the core device, which is used to store energy and power the test equipment. At the same time, the built-in 24V fine-tunable switching power supply charges the lithium battery pack; the power supply unit supports "charging and discharging at the same time", that is, the test equipment can be turned on and used normally during the charging process of the external AC power supply, and can also use the power supply unit to store electricity for work when it is disconnected from the AC power supply.
Claims
1. A test circuit for an optical link module, characterized in that: It includes a control unit, an interface unit, an optical unit, and a power supply unit. The control unit adopts a SAM-3732 core controller, the interface unit adopts a STM32F407VET6 controller, the optical unit has a built-in PROFIBUS OLM / G12 V4.0 optical link module, and the power supply unit adopts a 18650 lithium battery pack as a core device. The lithium battery pack outputs a 5V power supply and a 3.3V power supply to the control unit and the interface unit through a DC / DC circuit 1 and a DC / DC circuit 2; The JTAG function pin of the interface unit controller is extended to form a JTAG interface, the UART2 function pin of the controller is extended to form an RS-232 interface circuit 2, the UART1 and UART6 function pins of the controller are extended to form an RS-485 interface circuit 1 and an RS-485 interface circuit 2, and the controller is connected to the optical link module to be tested and the optical link module of the optical unit through the RS-485 interface circuit 1 and the RS-485 interface circuit 2 respectively; the controller is connected to the optical link module to be tested and the optical link module of the optical unit through the relay 1 and the relay 2 respectively; The interface unit controller is connected to the optical link module of the optical unit and the optical link module to be tested through two built-in A / D channels to accurately test the power of the optical link module, and is connected to the lithium battery pack through a built-in A / D channel via a voltage divider circuit to measure the current remaining battery power; The lithium battery pack of the power supply unit is connected to the optical link module to be tested and the optical link module of the optical unit through relay 1 and relay 2 respectively, so as to cut off or supply power for the optical link module of the optical unit and the optical link module to be tested; The control unit core controller is connected to the LCD touch screen through the LVDS bus and the IIC bus to complete human-computer interaction. At the same time, the USB_HOST interface circuit, USB_OTG interface circuit and RS-232 interface circuit 1 are expanded through the USB_HOST, USB_OTG and UART1 function pins of the core controller respectively, which are used by developers to perform online debugging, firmware burning and LOG printing.
2. The test circuit of an optical link module according to claim 1, characterized in that: In the control unit USB_HOST interface circuit, the electrical connection points USB_HOST_P and USB_HOST_N are connected to the USB_HOST_DP pin and USB_HOST_DN pin of the core controller N201B through resistors R211 and R213; at the same time, the 1st and 6th pins of the TVS tube VD301 of model NUP4202W1T2G are respectively connected through the inductor L301, and the 2nd pin of the TVS tube VD301 is grounded; and then they are respectively connected to the USB_HOST_DP pin and the USB_HOST_DN pin of the core controller N201B through the resistors R211 and R213. Pin 3 and pin 2 of the SB socket XS303; pin 4 of the USB socket XS303 is grounded through a magnetic bead FB303, pin 5 and pin 6 of the USB socket XS303 are connected and grounded, pin 1 of the USB socket XS303 is connected to the positive electrode of the electrolytic capacitor C301, the positive electrode of the electrolytic capacitor C302 and one end of the capacitor C303 and the capacitor C304 through a magnetic bead FB301, and then connected to a power supply of 5V through a fuse F302, and the negative electrode of the electrolytic capacitor C301, the electrolytic capacitor C302 and the other end of the capacitor C303 and the capacitor C304 are connected and grounded.
3. The test circuit of an optical link module according to claim 2, characterized in that: In the control unit USB_OTG interface circuit, the electrical connection points USB_OTG_P and USB_ OTG _N are connected to the USB_ OTG _DP pin and USB_ OTG _DP pin of the core controller N201B through resistors R214 and R212. _DN pins are connected; at the same time, pins 1 and 6 of TVS tube VD303 with model NUP4202W1T2G are connected respectively through inductor L302, and pin 2 of TVS tube VD303 is grounded; then they are connected to pins 3 and 2 of USB socket XS304 with model 8968-A04C00RW respectively; pin 4 of USB socket XS304 is grounded through magnetic bead FB305, pins 5 and 6 of USB socket XS304 are connected and then grounded, pin 1 of USB socket XS304 is connected to the positive electrode of electrolytic capacitor C305, the positive electrode of electrolytic capacitor C306 and one end of capacitor C307 and capacitor C308 through magnetic bead FB304, and then connected to power supply 5V through fuse F306, and the negative electrode of electrolytic capacitor C305, electrolytic capacitor C306 and the other end of capacitor C307 and capacitor C308 are connected and then grounded.
4. The test circuit of an optical link module according to claim 3, characterized in that: In the RS-232 interface circuit 1 of the control unit, a transceiver chip N301 of model MAX3232CUE+T is used. Pins 1 and 3 of the transceiver chip N301 are respectively connected to both ends of capacitor C310, pin 2 is connected to power supply 3.3V through capacitor C309, pins 4 and 5 are respectively connected to both ends of capacitor C312, pin 6 is grounded through capacitor C313, one end of capacitor C311 is connected to power supply 3.3V, and the other end is grounded; the electrical connection points UART1_TX and UART1_RX of pins 11 and 12 are connected to the serial port UART1_TX pin and UART1_RX pin of the core controller N201A through resistors R203 and R204; pin 13 is connected to one end of TVS diode VD304 through fuse F308, and the other end of TVS diode VD304 is grounded, and pin 13 is connected to socket XS305 of model B03B-XASK-1 Pin 2 of the socket XS305; Pin 14 is connected to one end of the TVS diode VD305 through the fuse F307, and the other end of the TVS diode VD305 is grounded; at the same time, pin 14 is connected to pin 1 of the socket XS305, pin 15 is grounded, pin 16 is connected to the power supply 3.3V, and pin 3 of the socket XS305 is grounded through the resistor R307.
5. The test circuit of an optical link module according to claim 4, characterized in that: In the interface unit controller circuit, the controller uses a single-chip microcomputer N1 of model STM32F407VET6, the 32nd pin of the single-chip microcomputer N1 is connected to the cathode of the light-emitting diode VD4, and the anode of the light-emitting diode VD4 is connected to the power supply 3.3V through the resistor R33; the 14th pin of the single-chip microcomputer N1 is connected to the power supply 3.3V through the resistor R1, and is grounded through the capacitor C1, and the 14th pin of the single-chip microcomputer N1 is connected to the 1st pin of the button N12, and the 2nd pin of the button N12 is grounded; Pins 12 and 13 of the single-chip microcomputer N1 are connected to the resistor R2 and the passive crystal oscillator X1 respectively, and are grounded through capacitors C2 and C3 respectively; pins 8 and 9 of the single-chip microcomputer N1 are connected to the resistor R3 and the passive crystal oscillator X2 respectively, and are grounded through capacitors C4 and C5 respectively; Pins 11, 19, 28, 50, 75 and 100 of the single-chip computer N1 are connected to one end of capacitors C49, C48, C47, C46, C45 and C44 and then connected to a power supply 3.3V, and the other ends of capacitors C49, C48, C47, C46, C45 and C44 are connected to ground; Pin 94 of the single-chip computer N1 is connected to pin 2 of the transistor VT5 through resistor R7 and to ground through resistor R8. Pin 3 of the transistor VT5 is connected to the power supply 3.3V through resistor R6. Pin 1 of the transistor VT5 is connected to the power supply 3.3V through resistors R5 and R4, and is connected to pin 1 of the dip switch chip N11 through resistor R5. Pin 4 of the dip switch chip N11 is grounded.
6. The test circuit of an optical link module according to claim 5, characterized in that: In the RS-485 interface circuit 1 of the interface unit, an RS-485 transceiver chip N3 of model ADM2582EBRWZ and a dip switch chip N13 of model A6S-5104-H are used. The electrical connection points USART1_RX and USART1_TX of the 1-pin and 2-pin of the dip switch chip N13 are connected to the 69-pin and 68-pin of the single-chip computer N1; the electrical connection points RS-485-1_TX and RS-485-1_RX of the 9-pin and 10-pin of the dip switch chip N13 are connected to the 7-pin and 4-pin of the RS-485 transceiver chip N3; The 13th and 15th pins of the RS-485 transceiver chip N3 are connected to the 18th and 17th pins, and then connected to both ends of the resistor R44, and at the same time connected to the 1st and 2nd pins of the socket XS17 of the model B03B-XASK-1 through the fuses F26 and F27; the 3rd pin of the socket XS17 is grounded; the 2nd and 8th pins of the RS-485 transceiver chip N3 are connected to one end of the capacitor C14, the capacitor C13, the capacitor C12, and the capacitor C11, and then connected to the power supply 3.3V, and the other ends of the capacitors C14, the capacitors C13, the capacitors C12, and the capacitors C11 are connected and then grounded; Pins 5 and 6 of the RS-485 transceiver chip N3 are connected to pin 70 of the microcontroller N1; pins 1, 3, 9, and 10 are connected and grounded, and pins 11, 14, 16, and 20 are connected and grounded; pins 12 and 19 are connected to one end of capacitors C15, C16, C17, and C18, and the other ends of capacitors C15, C16, C17, and C18 are grounded.
7. The test circuit of an optical link module according to claim 6, characterized in that: In the RS-485 interface circuit 2 of the interface unit, an RS-485 transceiver chip N4 of model ADM2582EBRWZ and a dip switch chip N14 of model A6S-5104-H are used, and the electrical connection points USART6_RX and USART6_TX of the 1-pin and 2-pin of the dip switch chip N14 are connected to the 64-pin and 63-pin of the single-chip computer N1; the electrical connection points RS-485-2_TX and RS-485-2_RX of the 9-pin and 10-pin of the dip switch chip N14 are connected to the 7-pin and 4-pin of the RS-485 transceiver chip N4; The 13th and 15th pins of the RS-485 transceiver chip N4 are connected to the 18th and 17th pins, and then connected to both ends of the resistor R45, and at the same time connected to the 1st and 2nd pins of the socket XS16 of the model B03B-XASK-1 through the fuses F28 and F29; the 3rd pin of the socket XS16 is grounded; the 2nd and 8th pins of the RS-485 transceiver chip N4 are connected to one end of the capacitor C22, the capacitor C21, the capacitor C20, and the capacitor C19, and then connected to the power supply 3.3V, and the other ends of the capacitors C22, the capacitors C21, the capacitors C20, and the capacitors C19 are connected and then grounded; Pins 5 and 6 of the RS-485 transceiver chip N4 are connected to pin 65 of the microcontroller N1; pins 1, 3, 9, and 10 are connected to ground, and pins 11, 14, 16, and 20 are connected to ground; pins 12 and 19 are connected to one end of capacitors C23, C24, C25, and C26, and the other ends of capacitors C23, C24, C25, and C26 are grounded.
8. The test circuit of an optical link module according to claim 7, characterized in that: In the interface unit RS-232 interface circuit 2, a transceiver chip N2 of model MAX3232CUE+T is used, pins 1 and 3 of the transceiver chip N2 are connected to both ends of capacitor C6, pins 4 and 5 are connected to both ends of capacitor C7, and the electrical connection points USART2_TX and USART2_RX of pins 11 and 12 are connected to pins 86 and 87 of the microcontroller N1; pin 16 is connected to the power supply 3.3V and is grounded through capacitor C8; Pins 2 and 6 of the transceiver chip N2 are grounded through capacitors C9 and C10 respectively; the electrical connection points RS-232_TX and RS-232_RX of pins 14 and 13 are connected to pins 1 and 2 of the socket XS10 of model B03B-XASK-1 through fuses F5 and F17, and pin 3 of the socket XS10 is grounded.
9. The test circuit of an optical link module according to claim 8, characterized in that: In the relay 1 circuit of the interface unit, a relay N9 of model APAN3105 is used, the 6th pin of the relay N9 is connected to DC24V, the 5th pin is connected to the 1st pin of the socket XS3 of model B2P-VH (LF) (SN), and the 2nd pin of the socket XS3 is grounded; the 2nd pin of the relay N9 is connected to the power supply 5V through the resistor R13, the 1st pin is connected to the 3rd pin of the transistor VT3, the 1st pin of the transistor VT3 is connected to the electrical connection point POWER1_CON through the resistor R12, the electrical connection point POWER1_CON is connected to the 1st pin of the microcontroller N1, and the 2nd pin of the transistor VT3 is grounded; In the relay 2 circuit of the interface unit, relay N10 of model APAN3105 is used. Pin 6 of relay N10 is connected to DC24V, pin 5 is connected to pin 1 of socket XS4 of model B2P-VH (LF) (SN), and pin 2 of socket XS4 is grounded; pin 2 of relay N10 is connected to power supply 5V through resistor R14, pin 1 is connected to pin 3 of transistor VT4, pin 1 of transistor VT4 is connected to electrical connection point POWER2_CON through resistor R15, electrical connection point POWER2_CON is connected to pin 2 of microcontroller N1, and pin 2 of transistor VT4 is grounded.
10. A method for implementing a test circuit of an optical link module, characterized in that: When the optical link module needs to be tested, the optical unit is connected to the optical link module to be tested through the optical fiber transmission line, and the interface unit is connected to the optical link module to be tested through the RS-485 interface circuit 1 and the A / D interface, and the following functional tests are performed: optical reception-electrical transmission message function test, electrical reception-optical transmission message function test, delay function test, optical reception power test, and optical transmission power test; 1. Optical reception-electrical transmission message function test: The control unit sends the mode test instruction to the interface unit through the UART2 interface. The interface unit operates the relay to power on the optical unit and the optical link module to be tested. The interface unit sends the PROFIBUS bus protocol data frame to the optical unit through the RS-485 interface circuit 2. The optical unit loads the data frame into the optical link and sends it to the optical link module to be tested. The interface unit listens to another set of RS-485 interface circuits 1 to receive the data frame replied by the external optical link module to be tested, and then determines whether the data frame is received within 1 second. If the data frame is received, it determines whether the contents of the received and sent data frames are the same. If they are the same, the interface unit returns the successful reception information of this cycle to the control unit, and the control unit core controller displays the successful reception information on the LCD touch screen. Then it further determines whether the number of cycles is reached. If the number of cycles is reached, the interface unit sends a signal to the control unit. The operation relay cuts off the power to the optical unit and the optical link module to be tested. If it is determined that the number of cycles has not been reached, it directly returns to the interface unit to send the PROFIBUS bus protocol data frame to the optical unit through the RS-485 interface circuit 2, and enters the next cycle; if it is determined that the contents of the received and sent data frames are different, the interface unit reports error information to the control unit, the control unit displays the error information on the LCD touch screen, and then returns to the interface unit to send the PROFIBUS bus protocol data frame to the optical unit through the RS-485 interface circuit 2, and enters the next cycle; if it is determined that no data frame is received within 1 second, the interface unit determines that the cycle has timed out, reports the timeout information to the control unit, the control unit displays the timeout information on the LCD touch screen, and then returns to the interface unit to send the PROFIBUS bus protocol data frame to the optical unit through the RS-485 interface circuit 2, and enters the next cycle; The optical receiving-electrical sending message test is completed; 2. Electrical reception-optical transmission message function test: The control unit sends the mode test instruction to the interface unit through the UART2 interface, and the interface unit operates the relay to power on the optical unit and the optical link module to be tested. The interface unit sends the PROFIBUS bus protocol data frame to the optical link module to be tested through the RS-485 interface circuit 1, and the optical link module to be tested loads the data frame into the optical link and sends it to the optical unit; the interface unit listens to another set of RS-485 interface circuits 2 to receive the data frame replied by the optical unit, and then determines whether the data frame is received within 1 second. If the data frame is received, it determines whether the contents of the received and sent data frames are the same. If they are the same, the interface unit returns the reception success information of this cycle to the control unit, and the control unit core controller displays the reception success information on the LCD touch screen; then it further determines whether the number of cycles is reached. If the number of cycles is reached, the interface unit operates the relay to the control unit to power on the optical unit. The element and the optical link module to be tested are powered off. If it is determined that the number of cycles has not been reached, it directly returns to the interface unit to send the PROFIBUS bus protocol data frame to the optical unit through the RS-485 interface circuit 2, and enters the next cycle; if it is determined that the contents of the received and sent data frames are different, the interface unit reports error information to the control unit, the control unit displays the error information on the LCD touch screen, and then returns to the interface unit to send the PROFIBUS bus protocol data frame to the optical unit through the RS-485 interface circuit 2, and enters the next cycle; if it is determined that no data frame is received within 1 second, the interface unit determines that the cycle has timed out, reports the timeout information to the control unit, the control unit displays the timeout information on the LCD touch screen, and then returns to the interface unit to send the PROFIBUS bus protocol data frame to the optical unit through the RS-485 interface circuit 2, and enters the next cycle. The electrical reception-optical transmission message function test is completed; 3. Delay function test: the control unit sends the test instruction to the interface unit through the UART2 interface, the interface unit operates the relay to power on the optical unit and the optical link module to be tested, the interface unit controller generates a data frame, sends a message through the RS-485 interface circuit 2, transmits the message between the optical unit and the optical link module to be tested, the RS-485 interface circuit 1 of the interface unit receives the data frame, the interface unit controller calculates and records the difference between the current time and the timestamp inside the data packet, and counts the average value of the recorded results of all data frames as the delay and reports it to the control unit, the control unit compares the value obtained by the test with the required value, obtains the performance test result of the optical link module to be tested and displays it on the LCD touch screen, the interface unit operates the relay to power off the optical unit and the optical link module to be tested, and the delay function test is completed; 4. Optical receiving power test: the control unit sends the test command to the interface unit through the UART2 interface, the interface unit operates the relay to power on the optical unit and the optical link module to be tested, the interface unit sends the PROFIBUS bus protocol data frame to the optical unit through the RS-485 interface circuit 2, the optical unit loads the data packet into the optical link and sends it to the optical link module to be tested, the A / D channel of the interface unit collects the channel output voltage of the optical link module to be tested, the interface unit controller reports the voltage value to the control unit core controller, the core controller obtains the optical receiving power parameter corresponding to the current voltage level, and displays the optical receiving power parameter on the LCD touch screen, the interface unit operates the relay to power off the optical unit and the optical link module to be tested, and the optical receiving power test is completed; 5. Optical emission power test: The control unit sends the test command to the interface unit through the UART2 interface. The interface unit operates the relay to power on the optical unit and the optical link module to be tested. The interface unit sends the PROFIBUS bus protocol data frame to the optical link module to be tested through the RS-485 interface circuit 1. The optical link module to be tested loads the data packet into the optical link and sends it to the optical unit. The A / D channel of the interface unit collects the channel output voltage of the optical link module to be tested. The interface unit controller reports the voltage value to the core controller of the control unit. The core controller obtains the optical emission power parameter corresponding to the current voltage level, and displays the optical emission power parameter on the LCD touch screen. The interface unit operates the relay to power off the optical unit and the optical link module to be tested, and the optical emission power test is completed.
Citation Information
Patent Citations
Automatic testing device and method for optical transmitting and receiving chip
CN106936495A
Connection equipment and test system
CN112187352A