Multi-port device, method and device for cable impedance detection
By directly connecting cables to multi-port devices and calculating the cable path and load switch module impedance, the problem of the limited applicability of cable impedance testing methods is solved, enabling the widespread application of cable impedance.
Patent Information
- Application Number
- CN202511288486.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2025-11-18
AI Technical Summary
Existing cable impedance testing methods have limited applicability and cannot be widely applied to the consumer end, especially since it is difficult to achieve voltage and current information communication between non-original adapters and equipment.
A multi-port device is provided, comprising a control module, a power supply module, a current sampling module, a voltage sampling module, a grounding switch module, a load switch module, and a path switch module. By directly connecting cables to two ports of the multi-port device, the cable path impedance and the load switch module impedance are calculated to determine the cable impedance.
It enables direct testing of cable impedance, without being limited by multi-port devices or whether the device supports the acquisition of port voltage and current information. It has a wide range of applications, including adapters, power banks, outdoor power supplies, etc., and is widely used in consumer applications.
Smart Images

Figure CN120971818A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of cable impedance detection, in particular to a multi-port device, method and device for cable impedance detection. BACKGROUND
[0002] The current device charging power / current is getting larger and larger, and a corresponding quality cable is needed to ensure charging safety, in which the cable impedance is the most critical indicator of quality.
[0003] With the consideration of environmental protection and other factors, companies such as Apple no longer provide original adapters. However, due to the characteristics of multi-port adapters, such as compatibility with multiple protocols, wide power range, and the ability to charge multiple devices simultaneously, they are favored by consumers and are commonly seen on the market.
[0004] In order to obtain the cable impedance, the current mainstream method is to sample the port voltage of the power supply end (adapter or other), the device end port voltage and the current flowing through when the device (mobile phone or notebook or other) is charging, and then calculate the impedance of the cable by communicating these data to the power supply end or device end. Alternatively, an additional testing device or method is used to obtain the cable impedance.
[0005] The current mainstream cable impedance testing method requires that both the adapter and the device end support the collection of port voltage, and both can support the communication of voltage / current information. For the original adapter charging the device, since they are from the same manufacturer, it can be better solved. However, for non-original adapters, it is more difficult to solve. Therefore, this cable impedance testing method, which requires both the adapter and the device end to support the collection of port voltage and the communication of voltage / current information, has a small application range, making the cable impedance unable to be widely applied to the consumer end. SUMMARY
[0006] The purpose of the present application is to provide a multi-port device, method and device for cable impedance detection, to solve the problem that the current cable impedance testing method has a small application range and the cable impedance cannot be widely applied to the consumer end.
[0007] To achieve the above-mentioned purpose, the present application provides the following solutions:
[0008] In a first aspect, the present application provides a multi-port device, method and device for cable impedance detection, comprising a control module, and a power supply module, a current sampling module, a voltage sampling module, a ground switch module, a load switch module, a pass switch module and a power supply / receiving module connected to the control module.
[0009] The voltage sampling module is connected with the first USB port and the second USB port, and is used for sampling the voltage of VBUS and GND on the first USB port and the voltage of VBUS and GND on the second USB port; one end of the cable is connected to the first USB port, and the other end of the cable is connected to the second USB port;
[0010] The current sampling module is connected with the power supply module and the second USB port, and is used for sampling the current of the power supply path of the power supply module and the current flowing through the second USB port;
[0011] The ground switch module is connected with the first USB port and the load switch module, and is used for connecting or disconnecting the ground of the first USB port and the ground of the whole system;
[0012] The load switch module is connected with the first USB port and the path switch module, and is used for connecting or disconnecting VBUS and GND in the first USB port;
[0013] The path switch module is connected with the power supply / receiving module, and is used for opening or closing the power supply path of the first USB port and the power supply / receiving module; the power supply / receiving module is used for providing power supply to the outside or drawing power from the outside;
[0014] When the current flows through the VBUS line and the GND line of the cable, the control module is used for calculating the cable path impedance according to the voltage drop and the current generated on the cable, calculating the load switch module impedance according to the voltage drop and the current between the two ends of the load switch module, and determining the cable impedance according to the cable path impedance and the load switch module impedance.
[0015] In a second aspect, a cable impedance detection method comprises:
[0016] When the current flows through the VBUS line and the GND line of the cable, the cable path impedance is calculated according to the voltage drop and the current generated on the cable;
[0017] The load switch module impedance is calculated according to the voltage drop and the current between the two ends of the load switch module;
[0018] The difference between the cable path impedance and the load switch module impedance is taken as the cable impedance, and specifically comprises:
[0019] When the cable impedance is tested, the switch tube Q2 in the load switch module is controlled to be turned on, the switch tube Q1 in the ground switch module is controlled to be turned off, the switch tube Q3 and the switch tube Q4 in the path switch module are controlled to be turned on, and the power supply module is controlled to output a set voltage;
[0020] When the multi-port device is normally applied, the switch tube Q2 is controlled to be turned off, the switch tube Q1 is controlled to be turned on, and the switch tubes Q3 and Q4 are controlled to be turned on.
[0021] In a third aspect, an embedded device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the computer program to implement the above cable impedance detection method.
[0022] According to the embodiments provided in the present application, the present application has the following technical effects:
[0023] The cable is directly connected to two ports in the multi-port device for cable impedance detection provided in the present application, i.e., a first USB port and a second USB port, wherein the second USB port can include multiple ports. When the current flows through the VBUS line and the GND line of the cable, the cable path impedance is calculated according to the voltage drop and the current generated on the cable, and the load switch module impedance is calculated according to the voltage drop and the current across the load switch module, and the cable impedance is determined according to the cable path impedance and the load switch module impedance, so that the user can directly test the cable impedance through the multi-port device, which is beneficial to the commercial application of the technology, and is not limited by the support of collecting port voltage and the support of voltage and current information communication of the multi-port device and the device end, wherein the multi-port device includes an adapter and a mobile power supply, or more likely an outdoor power supply with multiple USB ports, an energy storage power supply, etc., which has a wide range of applications and can be widely applied to consumer ends. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0025] Figure 1 A multi-port device, method and device diagram for cable impedance detection are provided for an embodiment of the present application;
[0026] Figure 2 A voltage sampling module structure diagram is provided for an embodiment of the present application;
[0027] Figure 3 A power supply module structure diagram is provided for an embodiment of the present application;
[0028] Figure 4 Another power supply module structure diagram is provided for an embodiment of the present application;
[0029] Figure 5 This is a schematic diagram of the current flow direction when testing the impedance of a cable according to an embodiment of this application;
[0030] Figure 6 This is a schematic diagram of the current flow direction of a first USB port during normal use, provided in an embodiment of this application.
[0031] Figure 7 A schematic diagram of the second USB port in normal use - external power supply according to an embodiment of this application;
[0032] Figure 8 This is a schematic diagram of the second USB port charging itself during normal use, as provided in an embodiment of this application.
[0033] Figure 9 This is a schematic diagram of the current flow direction when testing cable impedance according to another embodiment of this application;
[0034] Figure 10 This is a schematic diagram illustrating a first practical application of a power supply module provided in an embodiment of this application;
[0035] Figure 11 This is a schematic diagram illustrating a second practical application of the power supply module provided in one embodiment of this application;
[0036] Figure 12 This is a schematic diagram illustrating a third practical application of the power supply module provided in one embodiment of this application;
[0037] Figure 13 This is a schematic diagram illustrating a fourth practical application of the power supply module provided in one embodiment of this application. Detailed Implementation
[0038] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0039] To make the objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0040] like Figure 1 As shown in the figure, this application provides a multi-port device, method and apparatus for cable impedance detection, including: a control module 1, and a power supply module 2, a current sampling module 3, a voltage sampling module 4, a grounding switch module 5, a load switch module 6, a path switch module 7 and a power supply / receiving module 8 connected to the control module.
[0041] As shown in Figure 2 The voltage sampling module 4 is connected with the first USB port 9 and the second USB port 10, and is used for sampling the voltage of the VBUS and the GND of the first USB port 9 and the voltage of the VBUS and the GND of the second USB port 10. One end of a cable is connected to the first USB port 9, and the other end of the cable is connected to the second USB port 10.
[0042] In actual application, the second USB port 10 is connected with the voltage sampling module 4. The function of the second USB port 10 is to connect the cable, and the port can be a Type-C port or a Type-A port. The function of the voltage sampling module 4 is to obtain the voltage of the VBUS and the GND of the second USB port 10.
[0043] The first USB port 9 is connected with the voltage sampling module 4. The function of the first USB port 9 is to connect the cable, and the second USB port 10 is generally a Type-C port. The function of the voltage sampling module 4 is to obtain the voltage of the VBUS and the GND of the first USB port 9.
[0044] The current sampling module 3 is connected with the power supply module 2 and the second USB port 10, and is used for sampling the current of the power supply path of the power supply module 2 and the current flowing through the second USB port 10.
[0045] In actual application, the power supply module 2 is connected with the current sampling module 3, and is connected to the second USB port 10 through the current sampling module 3. The function of the power supply module 2 is to provide power supply externally, and the function of the current sampling module 3 is to sample the current of the power supply path.
[0046] The power supply module 2 is connected to the control module 1. The function of the control module 1 is to control the opening / closing of the power supply module 2 and the output voltage value.
[0047] For the application of Type-C port, the opening or closing of the pass-through pipe is generally controlled by a protocol chip; the control module 1 communicates with the protocol chip through a communication mode such as universal asynchronous receiver / transmitter (UART) / inter-integrated circuit (I2C); the control module 1 can inform the protocol chip to open or close the pass-through pipe when there is no type-c protocol connection, and in this case, inform the protocol IC to control the required voltage value of direct current to direct current (DCDC) or alternating current to direct current (ACDC) output; the protocol chip controls the output voltage value of ACDC or DCDC through feedback or optocoupler or I2C.
[0048] For the application of Type-A, some pass-through pipes are always open; for pass-through pipes, similar to type-C applications.
[0049] The current sampling module 3 is connected with the control module 1: the function of the control module 1 is to obtain current data from the current sampling module 3.
[0050] In actual application, the current is obtained by obtaining the voltage across the current sampling resistor; in general application, the protocol chip or IC has a current sampling function, wherein the current sampling can use Figure 3 or Figure 4 the CSP pin and the CSN pin of the protocol chip in the middle; the position of the sampling resistor can be placed at the high end (power end) or at the low end (ground end).
[0051] The ground switch module 5 is connected with the first USB port 9 and the load switch module 6, and is used for connecting or disconnecting the connection between the ground line of the first USB port 9 and the whole system ground.
[0052] In actual application, the ground switch module 5 is connected with the first USB port 9: the function of the ground switch module 5 is to connect or disconnect the connection between the ground line of the first USB port 9 and the whole system ground.
[0053] The ground switch module 5 is connected with the control module 1: the control module 1 controls the connection or disconnection of the ground switch module 5.
[0054] The load switch module 6 is connected with the first USB port 9 and the pass-through switch module 7, and is used for connecting or disconnecting the VBUS and GND in the first USB port 9.
[0055] In practical application, the first USB port 9 is connected with the load switch module 6; the function of the load switch module 6 is to connect or disconnect the VBUS and GND in the first USB port 9.
[0056] The load switch module 6 is connected with the control module 1; the function of the control module 1 is to control the connection or disconnection of the load switch.
[0057] The pass switch module 7 is connected with the power supply / receiving module 8, and is used to open or close the power supply pass of the first USB port 9 and the power supply / receiving module 8; the power supply / receiving module 8 is used to provide power supply externally or draw power from outside.
[0058] In practical application, the first USB port 9 is connected with the pass switch module 7; the function of the pass switch module 7 is to open or close the power supply pass of the first USB port 9 and the power supply / receiving module 8.
[0059] The pass switch module 7 is connected with the power supply / receiving module 8; the function of the power supply / receiving module 8 is to provide power supply externally or draw power from outside.
[0060] The pass switch module 7 is connected with the control module 1; the function of the control module 1 is to control the opening or closing of the pass switch.
[0061] The power supply / receiving module 8 is connected with the control module 1; the function of the control module 1 is to control the power supply / receiving module 8 to output power supply externally or draw power.
[0062] When the current flows through the VBUS line and the GND line of the cable, the control module 1 is used to calculate the cable pass impedance according to the voltage drop and the current generated on the cable, calculate the load switch module 6 impedance according to the voltage drop and the current between the two ends of the load switch module 6, and determine the cable impedance according to the cable pass impedance and the load switch module 6 impedance.
[0063] The power supply module 2 is generally an ACDC chip or a chip+protocol chip or a chip, or a DCDC chip or a chip+protocol chip or a chip; the general protocol chip or chip further includes a current sampling function, a voltage sampling function and a pass control function.
[0064] The power supply / receiving module 8 is generally an ACDC chip or a chip+protocol chip or a chip, or a DCDC chip or a chip+protocol chip or a chip; the general protocol chip further includes a current sampling function, a voltage sampling function and a pass control function.
[0065] The control module 1 is an MCU chip; if the power supply module 2 or the power supply / receiving module 8 also contains an MCU and can realize the functions required by the control module 1, the control module 1 can be omitted.
[0066] In practical application, the power supply module 2 further comprises a protocol chip connected with the power supply unit; the CSP pin and the CSN pin of the protocol chip are used for current sampling, and the GPIO0 pin and the GPIO1 pin of the protocol chip are used for voltage sampling.
[0067] The power supply unit is a DCDC chip or an ACDC chip.
[0068] When high-end current detection is performed, the power supply unit is an ACDC chip, and the sampling resistor is connected with the power supply end of the protocol chip.
[0069] When low-end current detection is performed, the power supply unit is an ACDC chip, and the sampling resistor is grounded.
[0070] In an exemplary embodiment, the power supply module 2 specifically comprises a power supply unit; the power supply unit is a DCDC converter or an ACDC converter.
[0071] As shown in Figure 3 , the power supply unit is connected with the VBUS line through a resistor and a pass switch.
[0072] As shown in Figure 4 , the power supply unit is connected with the VBUS line through a resistor.
[0073] Figure 10 A first practical application schematic diagram of the power supply module provided by an embodiment of the present application is shown in Figure 10 , which does not contain a control module and contains the following devices.
[0074] DCDC chip: providing output power, and the protocol chip controls the output voltage value.
[0075] Protocol chip: used for communication connection with electronic equipment and communication protocol voltage, etc.; and the current is obtained through the voltage across the sampling resistor; and whether to open the pass switch is determined according to the connection state with the electronic equipment.
[0076] Current sampling: a precision sampling resistor is used to facilitate the protocol chip to sample the voltage across the sampling resistor to obtain the current; wherein the sampling resistor is placed at the power supply end.
[0077] When cable impedance detection is performed, the control module communicates with the protocol chip to control the output voltage of the DCDC and the pass switch, and to obtain the current on the pass, and the voltage of the USB port VBUS and GND.
[0078] Figure 11 A second practical application schematic diagram of the power supply module provided by an embodiment of the present application is shown in , in which an ACDC+ protocol is adopted, and the sampling resistor is used for high-end current detection.Figure 11 As shown, compared with Figure 10 As shown, compared with Figure 11 The DCDC chip is replaced by an ACDC chip, Figure 11 In the ACDC chip, only the transformer part is shown, and the previous control part is not shown; the protocol chip controls the output voltage value by controlling the optical coupling.
[0079] Figure 12 The third actual application schematic diagram of the power supply module provided by an embodiment of the present application is shown, in which the ACDC+ protocol is adopted, the sampling resistor is a low-end current detection, and compared with Figure 11 As shown, compared with Figure 11 The difference is that Figure 12 In the ACDC chip, the current sampling resistor can be placed at the low end (ground end).
[0080] Figure 13 The fourth actual application schematic diagram of the power supply module provided by an embodiment of the present application is shown, in which the DCDC protocol is adopted, and compared with Figure 10 As shown, compared with Figure 13 It is emphasized that the DCDC chip and the protocol chip can be one chip, that is, a DCDC protocol chip, which is the power supply unit.
[0081] In an exemplary embodiment, the ground switch module 5 is a switch tube Q1.
[0082] In an exemplary embodiment, the load switch module 6 is a resistor R1 and a switch tube Q2 in series.
[0083] In an exemplary embodiment, the pass-through switch module 7 is a back-to-back switch tube Q3 and a switch tube Q4.
[0084] Among them, the switch tube Q1-Q4 is an N-channel metal-oxide-semiconductor (NMOS) tube or a P-channel metal-oxide-semiconductor (PMOS) tube.
[0085] The working principle of the present application is that the grounding of each port of a multi-port device causes the grounding of the cable when connecting two ports of the cable; the present application uses a simple way to make a certain size of current flow through the VBUS line and the GND line of the cable, to generate a voltage drop on the cable, and to measure the voltage drop and the current, so as to obtain the cable pass-through impedance; then the voltage drop across the load switch module 6 is tested, so as to obtain the impedance of the load switch module 6. The impedance of the cable is obtained by subtracting the impedance of the load switch module 6 from the cable pass-through impedance.
[0086] In an exemplary embodiment, asFigure 5 As shown, when testing the cable impedance, the control module 1 controls the switch tube Q2 to be on, controls the switch tube Q1 to be off; controls the switch tube Q3 and the switch tube Q4 to be on; and controls the power supply module 2 to output a set voltage.
[0087] The current sampling module 3 acquires the current of the current loop, and the voltage sampling module 4 acquires the voltage of the power supply point of the second USB port 10, the voltage of the ground of the second USB port 10, the voltage of the power supply point of the first USB port 9, and the voltage of the ground of the first USB port 9.
[0088] The control module 1 determines the cable path impedance based on the current of the current loop, the voltage of the power supply point of the second USB port 10, and the voltage of the ground of the second USB port 10, determines the load switch module 6 impedance based on the current of the current loop, the voltage of the power supply point of the first USB port 9, and the voltage of the ground of the first USB port 9, and determines the cable impedance according to the cable path impedance and the load switch module 6 impedance.
[0089] In actual application, when testing the cable impedance, the control module 1 controls Q2 to be on, Q1 to be off, and Q3 and Q4 to be off; then the power supply module 2 is turned on to output a set voltage; the control module 1 can be an MCU or a SOC system, which can be connected to the Internet or PIN buttons, and when connected to the Internet, it can receive the instruction for impedance detection through a mobile phone APP or the like; or the impedance detection is started by pressing an external button or a special button.
[0090] The current flow of the cable path is: the power supply module 2—>the sampling resistor R2—>the power supply point P0 of the second USB port 10—>the VBUS line in the USB cable—>the power supply point P2 of the first USB port 9—>the power resistor R1—>Q2—>the ground P3 of the first USB port 9—>the GND line in the USB cable—>the ground P1 of the second USB port 10—>the system ground GND.
[0091] The current sampling module 3 acquires the current I of the current loop.
[0092] The voltage sampling module 4 acquires the voltages V0, V1, V2, and V3 of P0, P1, P2, and P3, respectively.
[0093] Therefore, the impedance R of the cable is (V0-V1) / I-(V2-V3) / I.
[0094] In an exemplary embodiment, as shown, Figure 6 As shown, when the multi-port device is normally applied, the control module 1 controls the switch tube Q2 to be off, controls the switch tube Q1 to be on; and controls the switch tube Q3 and the switch tube Q4 to be on.
[0095] The first USB port 9 connects electronic devices, and the power supply module 2 outputs voltage; the electronic device is a power drawing device.
[0096] In actual application, when no APP instruction or external instruction such as button is received, the multi-port device is normally applied, the control module 1 makes Q2 disconnected, Q1 conducted, and Q3 and Q4 conducted; the second USB port 9 connects electronic devices (power drawing devices such as mobile phones), and the power supply module 2 outputs voltage.
[0097] The current flows as follows: the power supply module 2—>the sampling resistor R2—>the power supply point P0 of the second USB port 10—>the VBUS line in the USB cable—>the electronic device—>the GND line in the USB cable—>the ground P1 of the second USB port 10—>the system ground.
[0098] In an exemplary embodiment, as shown in Figure 7 When the electronic device connected by the first USB port 9 is a power drawing device, the power supply / receiving module 8 outputs voltage.
[0099] In actual application, the electronic device connected by the first USB port 9 is a power drawing device (such as a mobile phone or a computer device), and the power supply / receiving module 8 outputs voltage.
[0100] The current flows as follows: the power supply / receiving module 8—>Q4 / Q3—>the power supply point P2 of the first USB port 9—>the VBUS line in the USB cable—>the electronic device—>the GND line in the USB cable—>the ground P3 of the first USB port 9—>the multi-port device system ground.
[0101] In an exemplary embodiment, as shown in Figure 8 When the electronic device connected by the first USB port 1 is a power supply device, the power supply / receiving module 8 draws current.
[0102] In actual application, the electronic device connected by the first USB port 1 is a power supply device (such as an adapter), and the power supply / receiving module 8 draws current.
[0103] The current flows as follows: the power supply of the electronic device—>the VBUS line in the USB cable—>the power supply point P2 of the first USB port 9—>Q4 / Q3—>the power supply / receiving module 8—>the multi-port device system ground—>Q1—>the ground P3 of the first USB port 9—>the GND line in the USB cable—>the ground 2 of the electronic device.
[0104] In an exemplary embodiment, the first USB port 9 is a Type-C port; and the second USB port 10 is a Type-C port or a Type-A port.
[0105] In practical applications, as shown in Figure 9 The first USB port 9 and the ground of the power supply / receiving module 8 can also be connected or disconnected with the system ground by the ground control module 1.
[0106] For expansion from two ports to multiple ports, only the power supply module 2 and the second USB port 10 are expanded.
[0107] In an exemplary embodiment, the present application also provides a cable impedance detection method, comprising:
[0108] The cable path impedance is calculated according to the voltage drop and the current generated on the cable when the current flows through the VBUS line and the GND line of the cable.
[0109] The load switch module impedance is calculated according to the voltage drop and the current across the load switch module.
[0110] The difference between the cable path impedance and the load switch module impedance is taken as the cable impedance, specifically comprising:
[0111] When testing the cable impedance, the switch tube Q2 in the load switch module is turned on, the switch tube Q1 in the ground control module is turned off, the switch tube Q3 and the switch tube Q4 in the path switch module are turned on, and the power supply module outputs a set voltage.
[0112] When the multi-port device is normally applied, the switch tube Q2 is turned off, the switch tube Q1 is turned on, and the switch tube Q3 and the switch tube Q4 are turned on.
[0113] In an exemplary embodiment, the present application also provides an embedded device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned cable impedance detection method.
[0114] In practical applications, the embedded device can be a chip, a computer device, etc.
[0115] The technical features of the above embodiments can be combined in any way. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present disclosure.
[0116] The principles and implementation manners of the present application are described herein by using specific examples, and the above examples are only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges will have changes. In conclusion, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A multi-port device for cable impedance detection, characterized in that, include: The control module, and the power supply module, current sampling module, voltage sampling module, grounding switch module, load switch module, path switch module and power supply / receiving module connected to the control module; The voltage sampling module is connected to the first USB port and the second USB port, and is used to sample the voltages of VBUS and GND on the first USB port and the voltages of VBUS and GND on the second USB port; one end of the cable is connected to the first USB port and the other end of the cable is connected to the second USB port. The current sampling module is connected to the power supply module and the second USB port, and is used to sample the current in the power supply path of the power supply module and the current flowing through the second USB port. The grounding switch module is connected to the first USB port and the load switch module, and is used to connect or disconnect the ground wire of the first USB port and the ground of the entire system. The load switch module is connected to the first USB port and the access switch module, and is used to connect or disconnect VBUS and GND in the first USB port. The circuit switch module is connected to the power supply / receiving module and is used to open or close the power supply path between the first USB port and the power supply / receiving module; the power supply / receiving module is used to provide power to external sources or draw power from external sources. When current flows through the VBUS and GND lines of the cable, the control module calculates the cable path impedance based on the voltage drop and current generated on the cable, calculates the load switch module impedance based on the voltage drop and current across the load switch module, and determines the cable impedance based on the cable path impedance and the load switch module impedance.
2. The multi-port device for cable impedance detection according to claim 1, characterized in that, The power supply module specifically includes: a power supply unit; the power supply unit is a DC-DC converter or an A-DC converter; The power supply unit is connected to the VBUS line via a resistor; or, the power supply unit is connected to the VBUS line via a resistor and a circuit switch.
3. The multi-port device for cable impedance detection according to claim 2, characterized in that, The power supply module further includes: a protocol chip connected to the power supply unit; the CSP pin and CSN pin of the protocol chip are used for current sampling, and the GPIO0 pin and GPIO1 pin of the protocol chip are used for voltage sampling. The power supply unit is a DC-DC chip or an A-DC chip; When performing high-side current detection, the power supply unit is an AC-DC chip, and the sampling resistor is connected to the power supply terminal of the protocol chip; When performing low-end current detection, the power supply unit is an AC-DC chip, and the sampling resistor is grounded.
4. The multi-port device for cable impedance detection according to claim 1, characterized in that, The grounding switch module is a switching transistor Q1.
5. The multi-port device for cable impedance detection according to claim 4, characterized in that, The load switch module consists of a resistor R1 and a switching transistor Q2 connected in series.
6. The multi-port device for cable impedance detection according to claim 5, characterized in that, The circuit switch module consists of back-to-back switching transistors Q3 and Q4.
7. The multi-port device for cable impedance detection according to claim 6, characterized in that, When testing cable impedance, the control module controls switch Q2 to turn on and switch Q1 to turn off; controls switches Q3 and Q4 to turn on; and controls the power supply module to output a set voltage. The current sampling module acquires the current in the current loop, and the voltage sampling module acquires the power point voltage of the second USB port, the ground voltage of the second USB port, the power point voltage of the first USB port, and the ground voltage of the first USB port. The control module determines the cable path impedance based on the current in the current loop, the power supply voltage of the second USB port, and the ground voltage of the second USB port. It also determines the load switch module impedance based on the current in the current loop, the power supply voltage of the first USB port, and the ground voltage of the first USB port. The difference between the cable path impedance and the load switch module impedance is taken as the cable impedance.
8. The multi-port device for cable impedance detection according to claim 6, characterized in that, When the multi-port device is in normal operation, the control module controls the switch Q2 to be disconnected, controls the switch Q1 to be turned on, and controls the switches Q3 and Q4 to be turned on. The second USB port is connected to an electronic device, and the power supply module outputs voltage; the electronic device is a power-on device. When the electronic device connected to the first USB port is a power-draining device, the power supply / power receiving module outputs voltage; When the electronic device connected to the first USB port is a power supply device, the power supply / receiving module draws current.
9. The multi-port device for cable impedance detection according to claim 1, characterized in that, The first USB port is a Type-C port; The second USB port is either a Type-C port or a Type-A port.
10. A method for detecting cable impedance, characterized in that, The cable impedance detection method is applied to the multi-port device for cable impedance detection as described in any one of claims 1-9, and the cable impedance detection method includes: When current flows through the VBUS and GND lines of the cable, the cable path impedance is calculated based on the voltage drop and current generated on the cable. Calculate the impedance of the load switch module based on the voltage drop and current across the load switch module. The difference between the cable path impedance and the load switch module impedance is used as the cable impedance, specifically including: When testing cable impedance, the switch Q2 in the load switch module is turned on, and the switch Q1 in the grounding switch module is turned off; the switch Q3 and the switch Q4 in the circuit switch module are turned on; and the power supply module is controlled to output the set voltage.
11. An embedded device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the cable impedance detection method of claim 10.