Multiplexed pin method and circuit for i2c communication and led driving

CN123019682APending Publication Date: 2026-10-30WUXI SI POWER MICRO ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611496257.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

传统方案中,I2C通信引脚和LED驱动引脚通常相互独立,导致芯片引脚数量增加、封装成本上升,且系统灵活性不足

Benefits of technology

[0014]本发明的有益效果如下:实现I2C通信引脚与LED驱动引脚复用,减少引脚数量,降低封装和系统成本。通过阻抗/电压检测自动识别外部连接,无需额外配置引脚。电压钳位防止检测时误点亮LED。双引脚检测结果比对,提高检测可靠性。降低LED应用方案成本,增强灵活性和应用边界。支持低成本电参数修调、温度补偿和复杂灯效应用,拓展LED应用边界。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123019682A_ABST
    Figure CN123019682A_ABST
Patent Text Reader

Abstract

The application discloses a kind of I2C communication and LED driving multiplex pin method and circuit.After chip power reset, communication mode switch and drive mode switch are disconnected, and detection current is respectively applied to two multiplex pins by pull-down detection current source.Comparator compares pin voltage with reference voltage provided by threshold judgment voltage source, and judges whether external connection is pull-up resistor or LED lamp.Two multiplex pins are detected by chip in succession, if the results are consistent and both are pull-up resistor, it is determined that communication mode, and communication mode switch is closed to connect communication controller;if both are LED, it is determined that drive mode, and drive mode switch is closed to connect LED driving power supply;if it is inconsistent, it is determined that abnormal and latches, and switch is kept disconnected.The application realizes I2C communication and LED driving pin multiplexing, reduces the number of pins, reduces the cost of scheme, enhances the flexibility and scalability of LED application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical fields of I2C communication and LED driving, and specifically to a multiplexed pin method and circuit for I2C communication and LED driving. Background Technology

[0002] LED (Light-Emitting-Diode) is a new generation of solid-state light source, characterized by high efficiency, small size, low cost, long life and excellent vibration resistance, and is increasingly widely used in various lighting fields.

[0003] In engineering, some inherent defects of LEDs need to be addressed. For example, LED parameters have large dispersion, and electrical parameter adjustments are required in applications that require brightness and spectral consistency. LEDs have a large temperature coefficient, and the temperature coefficient difference between different colors is even greater, so temperature compensation is required to meet the requirements. In complex lighting effect application scenarios, it is necessary to constantly adjust the driving current and duty cycle, and to find ways to avoid interface communication speed and computing power bottlenecks.

[0004] How to improve the defects of LEDs at low cost, how to expand the application boundaries of LEDs, and how to enhance the flexibility of LED applications have gradually attracted the attention of engineers in the LED field. In traditional solutions, I2C communication pins and LED driver pins are usually independent of each other, which leads to an increase in the number of chip pins, higher packaging costs, and insufficient system flexibility. Therefore, there is an urgent need for a method and circuit that can multiplex I2C communication functions and LED driver functions on the same group of pins. Summary of the Invention

[0005] This invention provides a pin reuse method and circuit for I2C communication and LED driving. By detecting the impedance of the chip pin to the power supply connection, it determines whether the pin is connected to a resistor or an LED, thereby identifying whether the pin is for I2C communication or driving functions. This invention, by reusing I2C pins, can improve the shortcomings of LED applications, expand the application boundaries of LEDs, enhance the flexibility of LED applications, and reduce the solution cost of LED applications.

[0006] This invention provides a multiplexed pin method for I2C communication and LED driving, comprising: S10: After power-on reset, disconnect the communication mode switch and the drive mode switch. The communication mode switch is used to control the connection and disconnection between the two multiplexed pins and the communication controller, and the drive mode switch is used to control the connection and disconnection between the two multiplexed pins and the LED driver power supply. S20: Apply a detection current to each of the two multiplexed pins using a pull-down detection current source to detect the pin voltage of the two multiplexed pins; S30: The comparator compares the voltage of the two pins with the reference voltage to determine whether the two multiplexed pins are connected to pull-up resistors or LEDs. S40: When the external connections of the two multiplexed pins are consistent, determine whether it is in communication mode or drive mode. When it is in communication mode, close the communication mode switch; when it is in drive mode, close the drive mode switch. S50: When the external connections of the two multiplexed pins are inconsistent, it is determined that the system is in an abnormal mode and the communication mode switch and drive mode switch remain open.

[0007] Furthermore, while applying the detection current to the two multiplexed pins by the pull-down detection current source, the voltage of the two multiplexed pins is limited by the voltage clamping module to prevent the LED from being accidentally lit during detection.

[0008] Furthermore, S30 includes: when the pin voltage is higher than the comparison reference voltage, the multiplexed pin is externally connected to a pull-up resistor; when the pin voltage is lower than the comparison reference voltage, the multiplexed pin is externally connected to an LED.

[0009] Furthermore, S40 includes: when both multiplexed pins are externally connected to pull-up resistors, it is determined that the system is in communication mode; when both multiplexed pins are externally connected to LEDs, it is determined that the system is in driving mode.

[0010] The present invention also provides a multiplexed pin circuit for I2C communication and LED driving, including: a pull-down detection current source, a threshold judgment voltage source, a comparator module, a logic control module, a selection switch module, a communication mode switch, and a driving mode switch; One end of the communication mode switch is connected to two multiplexed pins, the other end is connected to the communication controller, and the control end is connected to the logic control module; One end of the drive mode switch is connected to two multiplexed pins, the other end is connected to the LED driver power supply, and the control end is connected to the logic control module. The two input terminals of the selection switch module are respectively connected to two multiplexed pins, the output terminal is connected to the inverting input terminal of the comparator module, and the control terminal is connected to the logic control module. The selection switch module is used to select one of the two multiplexed pins to connect to the inverting input terminal of the comparator module. The positive terminal of the pull-down detection current source is connected to the inverting input terminal of the comparator module, and the negative terminal of the pull-down detection current source is grounded. The positive input of the comparator module is connected to a threshold voltage source, and the output is connected to a logic control module. The threshold voltage source is used to provide a comparison reference voltage. The logic control module is used to control the selection switch module, the communication mode switch, and the drive mode switch according to the above method.

[0011] Furthermore, it also includes a voltage clamping module, one end of which is connected to the operating voltage and the other end is connected to the inverting input of the comparator module.

[0012] Furthermore, it also includes a first switch SW1 and a second switch SW2. One end of the second switch SW2 is connected to the positive terminal of the pull-down detection current source, and the other end of the second switch SW2 is connected to the inverting input terminal of the comparator module. One end of the first switch SW1 is connected to the other end of the voltage clamping module, and the other end of the first switch SW1 is connected to the inverting input terminal of the comparator module. The control terminals of the first switch SW1 and the second switch SW2 are both connected to the logic control module.

[0013] Furthermore, the selection switch module includes a third switch SW3 and a fourth switch SW4. One end of the third switch SW3 is connected to a multiplexed pin, and the other end is connected to the inverting input of the comparator module. One end of the fourth switch SW4 is connected to another multiplexed pin, and the other end is connected to the inverting input of the comparator module. The control terminals of both the third switch SW3 and the fourth switch SW4 are connected to the logic control module.

[0014] The beneficial effects of this invention are as follows: It enables the reuse of I2C communication pins and LED driver pins, reducing the number of pins and lowering packaging and system costs. External connections are automatically identified through impedance / voltage detection, eliminating the need for additional pin configuration. Voltage clamping prevents accidental LED lighting during detection. Dual-pin detection result comparison improves detection reliability. It reduces the cost of LED application solutions, enhancing flexibility and application boundaries. It supports low-cost electrical parameter tuning, temperature compensation, and complex lamp effect applications, expanding the application boundaries of LEDs. Attached Figure Description

[0015] Figure 1 This is a circuit diagram illustrating the I2C communication and LED driver multiplexing of the present invention.

[0016] Figure 2 This is a schematic diagram of the detection process of the present invention.

[0017] Figure 3 This is a circuit diagram of the present invention, in which external resistors are connected to the pins for communication function.

[0018] Figure 4 This is a schematic diagram of the detection process of connecting an external resistor to the pin of the present invention for communication function.

[0019] Figure 5 This is a circuit diagram of the present invention, in which an external LED is connected to the pin for driving function.

[0020] Figure 6 This is a schematic diagram of the detection process of connecting an external LED to the pin of the present invention for driving function. Detailed Implementation

[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. The described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0022] In this invention, unless otherwise explicitly defined, the terms "setting," "installing," and "connecting" should be interpreted broadly. For example, they can refer to a direct connection or an indirect connection through an intermediate medium; a fixed connection, a detachable connection, or an integrally formed connection; a mechanical connection, an electrical connection, or a connection capable of mutual communication; or the internal connection of two components or the interaction between two components. Those skilled in the art can reasonably determine the specific meaning of the above terms in this invention based on the specific content of the technical solution.

[0023] In the technical solution of the present invention, Figure 1 and Figure 2 This is a schematic diagram provided by a multiplexed pin method for I2C communication and LED driving according to the present invention, as shown below. Figure 1 and Figure 2 As shown, the specific process of this invention is as follows: S10: Power-on reset and initialization: After power-on reset, disconnect the communication mode switch and the drive mode switch. The communication mode switch is used to control the connection between the two multiplexed pins and the communication controller, and the drive mode switch is used to control the connection between the two multiplexed pins and the LED driver power supply.

[0024] Before the chip powers on and resets, all switches are disconnected. After power-on reset, the logic control module disconnects the communication mode switch and the drive mode switch, ensuring that the two multiplexed pins are neither connected to the communication controller nor to the LED driver power supply. Simultaneously, the logic control module prepares to enter the detection process.

[0025] S20: Apply detection current and detect pin voltage: Apply detection current to the two multiplexed pins respectively by pulling down the detection current source, and detect the pin voltage of the two multiplexed pins.

[0026] While applying detection current to the two multiplexed pins by the pull-down detection current source, the voltage of the two multiplexed pins is limited by the voltage clamping module to prevent the LED from being accidentally lit during detection.

[0027] The logic control module controls the pull-down detection current source to apply detection current to the two multiplexed pins. Specifically, the pull-down detection current source is connected to the inverting input of the comparator module via a switch, and then sequentially connected to the two multiplexed pins via a selector switch module. Simultaneously with the application of the detection current, a voltage clamping module operates to clamp the voltage drop caused by the pull-down detection current source, limiting the voltage on the two multiplexed pins to below the LED's turn-on voltage. This prevents the LED from accidentally lighting up during detection and effectively avoids LED flickering.

[0028] S30: Compare and determine external connection: The comparator compares the voltage of the two pins with the reference voltage to determine whether the external connection of the two multiplexed pins is a pull-up resistor or an LED.

[0029] The comparator module compares the pin voltage with a reference voltage. The reference voltage is provided by a threshold voltage source; the reference voltage VREF is obtained by subtracting the threshold voltage source VDC from the power supply voltage VCC. The positive input of the comparator module is connected to VREF, and the inverting input is connected to the detection pin. When the pin voltage is higher than the reference voltage VREF, it indicates that the voltage drop across the external connection is small, suggesting that a pull-up resistor is connected. When the pin voltage is lower than the reference voltage VREF, it indicates that an LED is connected externally.

[0030] S40: Determine the operating mode when the results of the two multiplexed pins are consistent: When the external connections of the two multiplexed pins are consistent, determine whether it is in communication mode or drive mode. When it is in communication mode, close the communication mode switch; when it is in drive mode, close the drive mode switch.

[0031] The chip sequentially detects two multiplexed pins. Specifically, the logic control module first controls the selection switch module to connect the first multiplexed pin to the inverting input of the comparator module, recording the first comparator output result CMPO_1; then, it controls the selection switch module to connect the second multiplexed pin to the inverting input of the comparator module, recording the second comparator output result CMPO_2. If CMPO_1 and CMPO_2 are the same, the detection result is considered accurate.

[0032] When the pin voltage is higher than the reference voltage, the multiplexed pin is externally connected to a pull-up resistor; when the pin voltage is lower than the reference voltage, the multiplexed pin is externally connected to an LED.

[0033] When pull-up resistors are connected to both of the multiplexed pins, the system is determined to be in communication mode; when LEDs are connected to both of the multiplexed pins, the system is determined to be in driving mode.

[0034] Specifically, when both detection results are low, it indicates that pull-up resistors are connected to both multiplexed pins, indicating that the system is in communication mode. The logic control module controls the communication mode switch to close, connecting the two multiplexed pins to the communication controller (I2C physical layer) to achieve I2C communication function.

[0035] When both test results are high, it indicates that both multiplexed pins are connected to external LEDs, indicating that the system is in drive mode. The logic control module controls the drive mode switch to close, connecting the two multiplexed pins to the LED driver power supply (LED driver current source) to achieve the LED drive function.

[0036] S50: Abnormal judgment when the results of two multiplexed pins are inconsistent: When the external connections of the two multiplexed pins are inconsistent, it is determined that the mode is in an abnormal mode, and the communication mode switch and the drive mode switch are kept open.

[0037] When the results of two comparators differ, the detection result is determined to be abnormal or unreliable. The logic control module latches the detection result and keeps the communication mode switch and drive mode switch open to avoid erroneous operation. At this time, the chip can wait for the next power-on reset to re-detect, or report the abnormal status through other interfaces.

[0038] After the test is completed, the logic control module disconnects the voltage clamping module, pulls down the detection current source and the comparator input path, and maintains the final determined working mode switch state.

[0039] In another technical solution of the present invention, Figure 1 This is a schematic diagram of a multiplexed pin circuit for I2C communication and LED driving according to the present invention, as shown below. Figure 1 As shown, the present invention includes: Voltage clamping module, pull-down detection current source, threshold judgment voltage source, comparator module, logic control module, selection switch module, communication mode switch and drive mode switch.

[0040] One end of the communication mode switch is connected to two multiplexed pins, the other end is connected to the communication controller, and the control end is connected to the logic control module; One end of the drive mode switch is connected to two multiplexed pins, the other end is connected to the LED driver power supply, and the control end is connected to the logic control module. The two input terminals of the selection switch module are respectively connected to two multiplexed pins, the output terminal is connected to the inverting input terminal of the comparator module, and the control terminal is connected to the logic control module. The selection switch module is used to select one of the two multiplexed pins to connect to the inverting input terminal of the comparator module. The positive terminal of the pull-down detection current source is connected to the inverting input terminal of the comparator module, and the negative terminal of the pull-down detection current source is connected to ground. The positive input of the comparator module is connected to a threshold voltage source, and the output is connected to a logic control module. The threshold voltage source is used to provide a comparison reference voltage. The logic control module is used to control the selection switch module, the communication mode switch, and the drive mode switch according to the above method embodiments.

[0041] Furthermore, the multiplexed pin circuit also includes a voltage clamping module, one end of which is connected to the operating voltage and the other end is connected to the inverting input of the comparator module.

[0042] Furthermore, the multiplexed pin circuit also includes: a first switch SW1 and a second switch SW2, one end of the second switch SW2 is connected to the positive terminal of the pull-down detection current source, and the other end of the second switch SW2 is connected to the inverting input terminal of the comparator module. One end of the first switch SW1 is connected to the other end of the voltage clamping module, and the other end of the first switch SW1 is connected to the inverting input terminal of the comparator module. The control terminals of the first switch SW1 and the second switch SW2 are both connected to the logic control module.

[0043] Furthermore, the selection switch module includes a third switch SW3 and a fourth switch SW4. One end of the third switch SW3 is connected to a multiplexed pin, and the other end is connected to the inverting input of the comparator module. One end of the fourth switch SW4 is connected to another multiplexed pin, and the other end is connected to the inverting input of the comparator module. The control terminals of both the third switch SW3 and the fourth switch SW4 are connected to the logic control module.

[0044] In this embodiment, the communication mode switches specifically include a fifth switch SW5 and a sixth switch SW6. One end of the fifth switch SW5 is connected to multiplexed pin IO1, and the other end is connected to the communication controller, with the control terminal connected to the logic control module. One end of the sixth switch SW6 is connected to multiplexed pin IO2, and the other end is connected to the communication controller, with the control terminal connected to the logic control module. The logic control module controls the connection between the two multiplexed pins and the communication controller by controlling the on / off states of the fifth switch SW5 and the sixth switch SW6.

[0045] In this embodiment, the LED driving power supply is specifically LED driving current sources ID1 and ID2, which correspond to two multiplexed pins respectively. When the driving mode is determined, the logic control module controls the driving mode switch to close, so that ID1 and ID2 are connected to the two multiplexed pins respectively, providing driving current to the external LED.

[0046] In this embodiment, the drive mode switch specifically includes a seventh switch SW7 and an eighth switch SW8. One end of the seventh switch SW7 is connected to a multiplexed pin IO1, the other end is connected to the LED drive current source ID1, and the control terminal is connected to the logic control module. One end of the eighth switch SW8 is connected to a multiplexed pin IO2, the other end is connected to the LED drive current source ID2, and the control terminal is connected to the logic control module. The logic control module controls the connection between the two multiplexed pins and the LED drive power supply by controlling the on / off state of the seventh switch SW7 and the eighth switch SW8.

[0047] In this embodiment, the communication controller is specifically an I2C-PHY, used to implement I2C communication, i.e., the reception and transmission of clock and data signals. The communication physical layer is connected to two multiplexed pins via a fifth switch SW5 and a sixth switch SW6. When communication mode is detected, the logic control module controls the fifth switch SW5 and the sixth switch SW6 to close, connecting the communication physical layer to the two multiplexed pins.

[0048] In this embodiment, the voltage clamping module is used to limit the voltage of the multiplexed pin during detection to prevent the LED from being accidentally lit due to the pin voltage being lower than the LED turn-on voltage. One end of the voltage clamping module is connected to the operating voltage VCC, and the other end is connected to the inverting input of the comparator module through the first switch SW1.

[0049] In this embodiment, the pull-down detection current source is used to detect the pull-up resistor or LED from the pin to the power supply. The positive terminal of the pull-down detection current source is connected to the inverting input terminal of the comparator module through the second switch SW2, and the negative terminal is connected to ground. When an external pull-up resistor is connected, the detection current flows through the pull-up resistor, forming a small voltage drop; when an external LED is connected, the detection current turns on the LED or clamps the voltage to near the LED's on-state voltage drop, resulting in a relatively larger voltage drop.

[0050] In this embodiment, the logic control module controls the first switch SW1, the second switch SW2, the third switch SW3, the fourth switch SW4, the fifth switch SW5, the sixth switch SW6, the seventh switch SW7, and the eighth switch SW8, and receives the output result CMPO from the comparator module. The logic control module sequentially detects the two multiplexed pins, recording the first comparison result CMPO_1 and the second comparison result CMPO_2 respectively. When the two results are consistent, the detection is deemed reliable; when the two results are inconsistent, the detection is deemed abnormal and the abnormal state is latched.

[0051] In this embodiment, it should be noted that the logic control module can be implemented using a chip with logic processing capabilities, such as an FPGA or an MCU.

[0052] Combination Figure 1 The specific circuit connections in this embodiment are as follows: The two multiplexed pins are IO1 (SCL) and IO2 (SDA). In communication mode, IO1 and IO2 serve as the clock and data lines for I2C, respectively; in drive mode, IO1 and IO2 serve as LED driver outputs. The positive terminal of the pull-down detection current source ID is connected to the inverting input of the comparator module CMP, and the negative terminal is connected to ground. One end of the voltage clamping module CLAMP is connected to the operating voltage VCC, and the other end is connected to the inverting input of the comparator module CMP via the first switch SW1. One end of the second switch SW2 is connected to the positive terminal of the pull-down detection current source ID, and the other end is connected to the inverting input of the comparator module CMP. One end of the third switch SW3 is connected to the multiplexed pin IO2, and the other end is connected to the inverting input of the comparator module CMP; one end of the fourth switch SW4 is connected to the multiplexed pin IO1, and the other end is connected to the inverting input of the comparator module CMP. The control terminals of the third switch SW3 and the fourth switch SW4 are both connected to the logic control module LOGIC. The comparator module CMP's positive input is connected to the comparison reference voltage VREF provided by the threshold judgment voltage source VDC, its inverting input is connected to the detection pin, and its output is connected to the logic control module LOGIC, outputting the comparison result CMPO. One end of the fifth switch SW5 is connected to the multiplexed pin IO1, and the other end is connected to the communication physical layer I2C-PHY; one end of the sixth switch SW6 is connected to the multiplexed pin IO2, and the other end is connected to the communication physical layer I2C-PHY; the control terminals of both the fifth and sixth switches SW5 are connected to the logic control module LOGIC. One end of the seventh switch SW7 is connected to the multiplexed pin IO1, and the other end is connected to the LED drive current source ID1; one end of the eighth switch SW8 is connected to the multiplexed pin IO2, and the other end is connected to the LED drive current source ID2; the control terminals of both the seventh and eighth switches SW7 are connected to the logic control module LOGIC.

[0053] The working principle of this embodiment is as follows: Before the chip is powered on and reset, all switches are disconnected. After power-on reset, the logic control module LOGIC controls DET to be high, closes the first switch SW1 and the second switch SW2, and respectively turns on the voltage clamping module CLAMP and the pull-down detection current source ID. Then, it controls DET1 to be high, closes the third switch SW3, and connects the second multiplexed pin IO2 to the inverting input of the comparator module CMP. The logic control module LOGIC stores the comparator output result CMPO and records it as CMPO_1. Then, it controls DET1 to be low and DET2 to be high, opens the third switch SW3 and closes the fourth switch SW4, and connects the first multiplexed pin IO1 to the inverting input of the comparator module CMP. The logic control module LOGIC records the second comparator output result CMPO as CMPO_2. After the detection is completed, the logic control module LOGIC controls DET and DET2 to be low, disconnects the voltage clamping module, the pull-down detection current source, and the connection of the multiplexed pin to the inverting input of the comparator module CMP.

[0054] If the two comparison results CMPO_1 and CMPO_2 are the same, the detection result is considered accurate. When both detection results are low, the external pin is determined to be for I2C communication. The logic control module LOGIC controls the fifth switch SW5 and the sixth switch SW6 to close, while keeping the seventh switch SW7 and the eighth switch SW8 open, connecting the two multiplexed pins to the communication controller. When both detection results are high, the external pin is determined to be for LED driving. The logic control module LOGIC controls the seventh switch SW7 and the eighth switch SW8 to close, while keeping the fifth switch SW5 and the sixth switch SW6 open, connecting the two multiplexed pins to the LED driver power supply. If the two comparator results are different, the detection result is considered abnormal. The logic control module LOGIC latches the abnormal state and keeps the fifth switch SW5, the sixth switch SW6, the seventh switch SW7, and the eighth switch SW8 all open.

[0055] In this embodiment, specific parameter examples are as follows: Figure 3 and Figure 4 As shown, the two multiplexed pins are connected to a 10K pull-up resistor to the 5V power supply, and the pull-down detection current source is 20uA, forming a 200mV voltage drop. The clamping voltage of the voltage clamping module is 0.8V, and the voltage at the inverting input of the comparator module CMP is 4.8V; the threshold judgment voltage source VDC is 0.5V, and the non-inverting input VREF of the comparator module CMP is 4.5V. Both detection results are low, indicating that the pin is for I2C communication, controlling the closure of the fifth switch SW5 and the sixth switch SW6, connecting the two pins to the communication controller. Figure 5 and Figure 6As shown, two multiplexed pins are connected to the LED via a 5V power supply. The pull-down detection current source is 20uA, the clamping voltage of the voltage clamping module is 0.8V, and the voltage at the inverting input of the comparator module CMP is pulled down to the clamping voltage of 4.2V by the pull-down detection current source; the voltage at the non-inverting input VREF of the comparator module CMP is 4.5V. Both detection results are high, indicating that the pins are for LED driving. This controls the closing of switches SW7 and SW8, connecting the two pins to the LED driver power supply.

[0056] Finally, it should be noted that the above specific embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to examples, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for multiplexing pins for I2C communication and LED driving, characterized in that, include: S10: After power-on reset, disconnect the communication mode switch and the drive mode switch. The communication mode switch is used to control the connection and disconnection between the two multiplexed pins and the communication controller, and the drive mode switch is used to control the connection and disconnection between the two multiplexed pins and the LED driver power supply. S20: Apply a detection current to each of the two multiplexed pins using a pull-down detection current source to detect the pin voltage of the two multiplexed pins; S30: The comparator compares the voltage of the two pins with the reference voltage to determine whether the two multiplexed pins are connected to pull-up resistors or LEDs. S40: When the external connections of the two multiplexed pins are consistent, determine whether it is in communication mode or drive mode. When it is in communication mode, close the communication mode switch; when it is in drive mode, close the drive mode switch. S50: When the external connections of the two multiplexed pins are inconsistent, it is determined that the system is in an abnormal mode and the communication mode switch and drive mode switch remain open.

2. The multiplexing pin method for I2C communication and LED driving as described in claim 1, characterized in that, Also includes: While applying detection current to the two multiplexed pins by the pull-down detection current source, the voltage of the two multiplexed pins is limited by the voltage clamping module to prevent the LED from being accidentally lit during detection.

3. The multiplexing pin method for I2C communication and LED driving as described in claim 1, characterized in that, S30 includes: When the pin voltage is higher than the comparison reference voltage, the multiplexed pin is externally connected to a pull-up resistor. When the pin voltage is lower than the comparison reference voltage, the multiplexed pin is externally connected to an LED.

4. The multiplexing pin method for I2C communication and LED driving as described in claim 3, characterized in that, S40 includes: When both of the multiplexed pins are connected to external pull-up resistors, it is determined that the system is in communication mode; when both of the multiplexed pins are connected to external LEDs, it is determined that the system is in driving mode.

5. A multiplexed pin circuit for I2C communication and LED driving, characterized in that, include: Pull-down detection current source, threshold judgment voltage source, comparator module, logic control module, selection switch module, communication mode switch and drive mode switch; One end of the communication mode switch is connected to two multiplexed pins, the other end is connected to the communication controller, and the control end is connected to the logic control module; One end of the drive mode switch is connected to two multiplexed pins, the other end is connected to the LED driver power supply, and the control end is connected to the logic control module. The two input terminals of the selection switch module are respectively connected to two multiplexed pins, the output terminal is connected to the inverting input terminal of the comparator module, and the control terminal is connected to the logic control module. The selection switch module is used to select one of the two multiplexed pins to connect to the inverting input terminal of the comparator module. The positive terminal of the pull-down detection current source is connected to the inverting input terminal of the comparator module, and the negative terminal of the pull-down detection current source is grounded. The positive input of the comparator module is connected to a threshold voltage source, and the output is connected to a logic control module. The threshold voltage source is used to provide a comparison reference voltage. The logic control module is used to control the selection switch module, the communication mode switch, and the drive mode switch according to the multiplexing pin method for I2C communication and LED driving according to any one of claims 1-4.

6. The multiplexed pin circuit for I2C communication and LED driving as described in claim 5, characterized in that, Also includes: A voltage clamping module, one end of which is connected to the operating voltage and the other end of which is connected to the inverting input of the comparator module.

7. The multiplexed pin circuit for I2C communication and LED driving as described in claim 6, characterized in that, Also includes: The first switch SW1 and the second switch SW2 are connected. One end of the second switch SW2 is connected to the positive terminal of the pull-down detection current source, and the other end of the second switch SW2 is connected to the inverting input terminal of the comparator module. One end of the first switch SW1 is connected to the other end of the voltage clamping module, and the other end of the first switch SW1 is connected to the inverting input terminal of the comparator module. The control terminals of the first switch SW1 and the second switch SW2 are both connected to the logic control module.

8. The multiplexed pin circuit for I2C communication and LED driving as described in claim 5, characterized in that, The selection switch module includes a third switch SW3 and a fourth switch SW4. One end of the third switch SW3 is connected to a multiplexed pin, and the other end is connected to the inverting input of the comparator module. One end of the fourth switch SW4 is connected to another multiplexed pin, and the other end is connected to the inverting input of the comparator module. The control terminals of the third switch SW3 and the fourth switch SW4 are both connected to the logic control module.