Current detection circuit and integrated circuit chip
By using multiple comparators and digital control circuits in the current detection circuit between the DSI master and the slave, the problem of DSI master distinguishing communication current accuracy and adapting to changes in the number of slaves is solved, and high-precision current detection and rapid overpass are achieved Flow protection improves system stability and security.
Patent Information
- Application Number
- CN202410974139.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-08
AI Technical Summary
The comparator of the DSI host is difficult to accurately distinguish between communication currents at different levels, especially when the number of DSI slaves changes or disconnects, the detection accuracy decreases, and the prior art cannot effectively solve the abnormality of the receiving circuit output when the host carries different numbers of slaves. Problems, resulting in a decrease in system stability and reliability.
A current detection circuit is designed, including a master and a slave. The master is connected to the slave through a transmitting circuit and a receiving circuit. The receiving circuit uses multiple comparators. Each comparator has a different offset voltage and generates a comparison signal through a differential voltage. To detect the communication current, and adjust the current of the current source through a digital control circuit to adapt to different conditions.
It improves the current detection accuracy, enhances the system's adaptability and stability, ensures rapid response to overcurrent protection, avoids circuit damage or equipment failure, and improves the stability and safety of automotive electronic systems.
Smart Images

Figure CN118914637A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of integrated circuit technology, and in particular, to a current detection circuit and an integrated circuit chip. Background Art
[0002] In modern automotive electronic systems, Distributed System Interface technology is a common communication protocol used to implement data exchange between a host and multiple slaves. For example, the host may include a central control unit or an electronic control unit (ECU), and the slaves may include sensors or actuators. DSI3 (Distributed System Interface version 3) is a version of the above communication protocol. It is a distributed bus interface designed for automotive applications. DSI3 supports efficient and reliable communication and can adapt to the harsh conditions in the automotive environment.
[0003] In the prior art, the comparator of the DSI host may have difficulty distinguishing different levels of communication current, especially when the number of DSI slaves changes or a DSI slave is offline, the comparator's flip threshold may be affected, resulting in reduced detection accuracy. In addition, the output of the comparator may produce errors due to circuit noise and offset voltage, further resulting in reduced detection accuracy. These errors need to be overcome through certain circuit designs. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a current detection circuit and an integrated circuit chip for improving current detection accuracy.
[0005] A first aspect provides a current detection circuit, comprising a host and a slave, the host comprising a transmitting circuit and a receiving circuit, the transmitting circuit and the receiving circuit are electrically connected, the transmitting circuit is also electrically connected to the slave through an output node, the receiving circuit is electrically connected to the slave, the output node is electrically connected to a communication bus, the receiving circuit comprises a plurality of comparators, each of the comparators has a different offset voltage;
[0006] The sending circuit is used to send a voltage signal to the slave;
[0007] The slave is used to extract the current signal through the output node and send the current signal to the receiving circuit;
[0008] The receiving circuit is used to generate a differential voltage of each comparator through the current signal, so that each comparator outputs a comparison signal according to the differential voltage, and the comparison signal is used to detect communication currents of different levels.
[0009] In a possible implementation, the current detection circuit further includes a digital control circuit, the receiving circuit further includes a plurality of current sources, and the digital control circuit is electrically connected to the plurality of current sources and the plurality of comparators;
[0010] The digital control circuit is used to output a control signal to at least one of the current sources according to the comparison signal to adjust the current of the current source.
[0011] In a possible implementation, the digital control circuit is further configured to identify that the slave device is offline when a change in a comparison signal output by at least one of the comparators is detected.
[0012] In a possible implementation, the sending circuit includes a first variable current source, a first resistor, an operational amplifier, a second resistor, a third resistor, and a fourth resistor;
[0013] A first terminal of the first variable current source is electrically connected to a first voltage terminal, and a second terminal of the first variable current source is electrically connected to a positive polarity terminal of the operational amplifier;
[0014] The first end of the first resistor is electrically connected to the positive polarity terminal of the operational amplifier, and the second end of the first resistor is electrically connected to the second voltage terminal;
[0015] A first end of the second resistor is electrically connected to the output end of the operational amplifier, and a second end of the second resistor is electrically connected to the output node;
[0016] A first end of the third resistor is electrically connected to the output node, and a second end of the third resistor is electrically connected to the negative polarity terminal of the operational amplifier;
[0017] A first end of the fourth resistor is electrically connected to the negative polarity terminal of the operational amplifier, and a second end of the fourth resistor is electrically connected to the second voltage terminal.
[0018] In a possible implementation manner, the range of the differential voltage and the magnitude of the offset voltage of the comparator are set by adjusting the resistance value of the second resistor.
[0019] In a possible implementation, the receiving circuit further includes a first differential voltage generating circuit and a second differential voltage generating circuit, the first differential voltage generating circuit is electrically connected to the output terminal of the operational amplifier and the positive polarity terminal of each of the comparators, and the second differential voltage generating circuit is electrically connected to the output node and the negative polarity terminal of each of the comparators;
[0020] The first differential voltage generating circuit is used to output a positive polarity voltage corresponding to the comparator to the positive polarity terminal of each comparator;
[0021] The second differential voltage generating circuit is used to output a negative polarity voltage corresponding to the comparator to the negative polarity end of each comparator, and the difference between the positive polarity voltage and the negative polarity voltage of each comparator is the differential voltage of the comparator.
[0022] In a possible implementation, the first differential voltage generating circuit includes a fifth resistor, a sixth resistor, a seventh resistor, a second variable current source, a third variable current source, and a fourth variable current source;
[0023] A first end of the fifth resistor is electrically connected to the output end of the operational amplifier, a second end of the fifth resistor is electrically connected to the first node, a first end of the sixth resistor is electrically connected to the first node, a second end of the sixth resistor is electrically connected to the first end of the second variable current source, and a second end of the second variable current source is electrically connected to the second voltage end;
[0024] The first end of the seventh resistor is electrically connected to the first node, the second end of the seventh resistor is electrically connected to the first end of the third variable current source, and the second end of the third variable current source is electrically connected to the second voltage end;
[0025] A first terminal of the fourth variable current source is electrically connected to the first node, and a second terminal of the fourth variable current source is electrically connected to the second voltage terminal.
[0026] In a possible implementation, the second differential voltage generating circuit includes an eighth resistor, a ninth resistor, a tenth resistor, a fifth variable current source, a sixth variable current source, and a seventh variable current source;
[0027] A first end of the eighth resistor is electrically connected to the output node, a second end of the eighth resistor is electrically connected to the second node, a first end of the ninth resistor is electrically connected to the second node, a second end of the ninth resistor is electrically connected to a first end of the fifth variable current source, and a second end of the fifth variable current source is electrically connected to the second voltage terminal;
[0028] The first end of the tenth resistor is electrically connected to the second node, the second end of the tenth resistor is electrically connected to the first end of the sixth variable current source, and the second end of the sixth variable current source is electrically connected to the second voltage end;
[0029] A first terminal of the seventh variable current source is electrically connected to the second node, and a second terminal of the seventh variable current source is electrically connected to the second voltage terminal.
[0030] In a possible implementation, the plurality of comparators include a first comparator, a second comparator, and a third comparator;
[0031] The positive polarity terminal of the first comparator is electrically connected to the first terminal of the second variable current source;
[0032] The positive polarity terminal of the second comparator is electrically connected to the first terminal of the third variable current source;
[0033] The positive polarity terminal of the third comparator is electrically connected to the first terminal of the fourth variable current source.
[0034] In a possible implementation, the plurality of comparators include a first comparator, a second comparator, and a third comparator;
[0035] The negative polarity terminal of the first comparator is electrically connected to the first terminal of the fifth variable current source;
[0036] The negative polarity terminal of the second comparator is electrically connected to the first terminal of the sixth variable current source;
[0037] A negative polarity terminal of the third comparator is electrically connected to the first terminal of the seventh variable current source.
[0038] In a possible implementation, the slave includes a current source, a first terminal of the current source is electrically connected to the output node, and a second terminal of the current source is electrically connected to the second voltage terminal.
[0039] A second aspect provides an integrated circuit chip, comprising the current detection circuit in the first aspect or any possible implementation of the first aspect.
[0040] In the technical solution provided in the embodiment of the present application, the current detection circuit includes a host and a slave, the host includes a sending circuit and a receiving circuit, the receiving circuit includes multiple comparators, each comparator has a different offset voltage, the sending circuit sends a voltage signal to the slave, the slave extracts the current signal through the output node and sends the current signal to the receiving circuit, the receiving circuit generates a differential voltage for each comparator through the current signal, so that each comparator outputs a comparison signal according to the differential voltage, and the comparison signal is used to detect different levels of communication currents, so that the comparator can accurately distinguish different levels of communication currents, thereby improving the current detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0042] Figure 1 A schematic diagram of the structure of a current detection circuit provided in an embodiment of the present application;
[0043] Figure 2 A relationship diagram of a differential voltage and current signal provided in an embodiment of the present application;
[0044] Figure 3 Another relationship diagram of differential voltage and current signals provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of identifying a slave device being offline provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of the structure of an integrated circuit chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0048] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0049] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0050] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0051] The solutions of the related art have the following technical problems: the comparator of the DSI host is difficult to accurately distinguish different levels of communication current, especially when the number of DSI slaves changes, for example, when the DSI slave is connected or disconnected, it will affect the flip threshold of the comparator, resulting in a decrease in the accuracy of current detection; when the DSI slave sends a current signal to the DSI host, the number of DSI slaves is uncertain, resulting in abnormal function of the DSI host receiving RX circuit (receiver) and output of an error signal. The existing technology cannot solve the problem of abnormal output of the DSI host receiving circuit when the DSI host carries different numbers of DSI slaves; both current detection and overcurrent protection lack adaptive capabilities and cannot adapt well to current changes or load changes, resulting in reduced system stability and reliability; the overcurrent protection response speed is insufficient and cannot cut off the abnormal current in time, which will cause circuit damage or equipment failure.
[0052] In order to solve the above technical problems, an embodiment of the present application provides a current detection circuit. Figure 1 A schematic diagram of a current detection circuit provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the current detection circuit includes: a host and a slave, the host includes a transmitting circuit and a receiving circuit, the transmitting (TX) circuit and the receiving (RX) circuit are electrically connected, the transmitting circuit is also electrically connected to the slave through an output node, the slave is also electrically connected to a communication bus through the output node, and the receiving circuit includes multiple comparators, each comparator has a different offset voltage.
[0053] The sending circuit is used to send a voltage signal to the slave; the slave is used to extract a current signal through an output node and send the current signal to the receiving circuit; the receiving circuit is used to generate a differential voltage for each comparator through the current signal, so that each comparator outputs a comparison signal according to the differential voltage, and the comparison signal is used to detect different levels of communication current.
[0054] The communication bus can be a communication bus of various communication protocols, such as Figure 1 As shown, the communication bus is described as a DSI bus as an example, and the embodiments of the present application are not limited thereto.
[0055] like Figure 1As shown, the sending circuit includes a first variable current source I1, a first resistor R1, an operational amplifier op, a second resistor R2, a third resistor R3 and a fourth resistor R4. The first end of the first variable current source I1 is electrically connected to the first voltage end, and the second end of the first variable current source I1 is electrically connected to the positive polarity end of the operational amplifier op; the first end of the first resistor R1 is electrically connected to the positive polarity end of the operational amplifier op, and the second end of the first resistor R1 is electrically connected to the second voltage end; the first end of the second resistor R2 is electrically connected to the output end of the operational amplifier op, and the second end of the second resistor R2 is electrically connected to the output node DSI; the first end of the third resistor R3 is electrically connected to the output node DSI, and the second end of the third resistor R3 is electrically connected to the negative polarity end of the operational amplifier op; the first end of the fourth resistor R4 is electrically connected to the negative polarity end of the operational amplifier op, and the second end of the fourth resistor R4 is electrically connected to the second voltage end.
[0056] In the embodiment of the present application, the first voltage terminal is a power supply voltage terminal. For example, the voltage of the first voltage terminal may be a high-level voltage. Figure 1 As shown, the high level voltage may be a power supply voltage VDD; the second voltage terminal is a low voltage terminal, for example, the voltage of the second voltage terminal may be a low level voltage or a ground voltage, such as Figure 1 As shown, the voltage of the second voltage terminal is the ground voltage, that is, the second voltage terminal can be the ground terminal GND.
[0057] In the embodiment of the present application, the receiving circuit further includes a first differential voltage generating circuit and a second differential voltage generating circuit, the first differential voltage generating circuit is electrically connected to the output end of the operational amplifier OP and the positive polarity end of each comparator, and the second differential voltage generating circuit is electrically connected to the output node DSI and the negative polarity end of each comparator. The first differential voltage generating circuit is used to output the positive polarity voltage corresponding to the comparator to the positive polarity end of each comparator; the second differential voltage generating circuit is used to output the negative polarity voltage corresponding to the comparator to the negative polarity end of each comparator, and the difference between the positive polarity voltage and the negative polarity voltage of each comparator is the differential voltage of the comparator.
[0058] like Figure 1As shown, the first differential voltage generating circuit includes a fifth resistor R5, a sixth resistor R6, a seventh resistor R7, a second variable current source I2, a third variable current source I3 and a fourth variable current source I4. The first end of the fifth resistor R5 is electrically connected to the output end of the operational amplifier op, the second end of the fifth resistor R5 is electrically connected to the first node a, the first end of the sixth resistor R6 is electrically connected to the first node a, the second end of the sixth resistor R6 is electrically connected to the first end of the second variable current source I2, and the second end of the second variable current source I2 is electrically connected to the second voltage end; the first end of the seventh resistor R7 is electrically connected to the first node a, the second end of the seventh resistor R7 is electrically connected to the first end of the third variable current source I3, and the second end of the third variable current source I3 is electrically connected to the second voltage end; the first end of the fourth variable current source I4 is electrically connected to the first node a, and the second end of the fourth variable current source I4 is electrically connected to the second voltage end.
[0059] like Figure 1 As shown, the second differential voltage generating circuit includes an eighth resistor R8, a ninth resistor R9, a tenth resistor R10, a fifth variable current source I5, a sixth variable current source I6 and a seventh variable current source I7. The first end of the eighth resistor R8 is electrically connected to the output node DSI, the second end of the eighth resistor R8 is electrically connected to the second node b, the first end of the ninth resistor R9 is electrically connected to the second node b, the second end of the ninth resistor R9 is electrically connected to the first end of the fifth variable current source I5, and the second end of the fifth variable current source I5 is electrically connected to the second voltage terminal; the first end of the tenth resistor R10 is electrically connected to the second node b, the second end of the tenth resistor R10 is electrically connected to the first end of the sixth variable current source I6, and the second end of the sixth variable current source I6 is electrically connected to the second voltage terminal; the first end of the seventh variable current source I7 is electrically connected to the second node b, and the second end of the seventh variable current source I7 is electrically connected to the second voltage terminal.
[0060] like Figure 1 As shown, the multiple comparators include a first comparator Z0, a second comparator Z1 and a third comparator Z2. The positive polarity terminal of the first comparator Z0 is electrically connected to the first end of the second variable current source I2, and the negative polarity terminal of the first comparator Z0 is electrically connected to the first end of the fifth variable current source I5; the positive polarity terminal of the second comparator Z2 is electrically connected to the first end of the third variable current source I3, and the negative polarity terminal of the second comparator Z2 is electrically connected to the first end of the sixth variable current source I6; the positive polarity terminal of the third comparator Z3 is electrically connected to the first end of the fourth variable current source I4, and the negative polarity terminal of the third comparator Z3 is electrically connected to the first end of the seventh variable current source I7. The differential voltage of each comparator is the difference between the voltage at the positive polarity terminal and the voltage at the negative polarity terminal of the comparator, such as Figure 1 As shown, the differential voltage V diff0 =V Z0P -V Z0N, the differential voltage V of the second comparator Z1 diff1 =V Z1P -V Z1N , the differential voltage V of the third comparator Z2 diff2 =V Z2P -V Z2N Among them, V Z0P is the voltage of the positive terminal of the first comparator Z0, V Z0P or the voltage of the first terminal of the second variable current source I2; V Z0N is the voltage of the negative terminal of the first comparator Z0, V Z0N is also the voltage of the first terminal of the fifth variable current source I5; V Z1P is the voltage of the positive terminal of the second comparator Z1, V Z1P is also the voltage of the first terminal of the third variable current source I3; V Z1N is the voltage of the negative terminal of the second comparator Z1, V Z1N is also the voltage of the first terminal of the sixth variable current source I6; V Z2P is the voltage of the positive terminal of the third comparator Z3, V Z2P is also the voltage of the first terminal of the fourth variable current source I4; V Z1N is the voltage of the negative terminal of the third comparator Z3, V Z2N It is also the voltage of the first terminal of the seventh variable current source I6. Figure 1 As shown, if the differential voltage of the comparator is less than 0, the comparison signal output by the comparator is a low level; if the differential voltage of the comparator is greater than 0, the comparison signal output by the comparator is a high level. For example, the differential voltage V diff0 When the comparison signal output by the first comparator Z0 is low level, the differential voltage V diff0 When the differential voltage V diff1 When the comparison signal output by the second comparator Z1 is low level, the differential voltage V diff1 When the differential voltage V diff2 When the differential voltage V diff2 When it is greater than 0, the comparison signal output by the third comparator Z2 is at a high level.
[0061] like Figure 1 As shown, the slave includes a current source I8, a first end of the current source I8 is electrically connected to the output node DSI, and a second end of the current source I8 is electrically connected to the second voltage terminal. The current source I8 is electrically connected to the DSI bus through the output node DSI, and the current signal extracted by the current source I8 from the DSI bus may include a static current Iq and communication current I level For example, the communication current I level It may include 0, 12mA or 24mA, wherein 0, 12mA and 24mA correspond to different levels of communication current, respectively, so that the current measuring circuit can distinguish different levels of communication current through 0, 12mA and 24mA. level When it is 0, it indicates a static state or a state where there is no data transmission.
[0062] As an optional solution, the current detection circuit further includes a digital control circuit, the receiving circuit further includes a plurality of current sources, and the digital control circuit is electrically connected to the plurality of current sources and the plurality of comparators. The digital control circuit is used to output a control signal to at least one current source according to the comparison signal to adjust the current of the current source.
[0063] Specifically, Figure 1 As shown, the digital control circuit is electrically connected to the output terminal of the first comparator Z0, the output terminal of the second comparator Z1 and the output terminal of the third comparator Z2, and the digital control circuit is also electrically connected to the second variable current source I2, the third variable current source I3, the fourth variable current source I4, the fifth variable current source I5, the sixth variable current source I6 and the seventh variable current source I7. The multiple control signals may include trim0 to trimN, for example, N=5, then the digital control signal may output a control signal trim0 to the seventh variable current source I7, a control signal trim1 to the sixth variable current source I6, a control signal trim2 to the fifth variable current source I5, a control signal trim3 to the fourth variable current source I4, a control signal trim4 to the third variable current source I3, and a control signal trim5 to the second variable current source I2.
[0064] like Figure 1 As shown, the formula for the differential signal of the three comparators can be shown as follows:
[0065] V diff0 =V Z0P -V Z0N =R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P )+R9*I Z0N –R6*I Z0P +R2*(I q+ I level+ I Z0N +I Z1N +I Z2N )Formula (1)
[0066] V diff1 =V Z1P V Z1N =R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P )+R10*I Z1N –R7*I Z1P +R2*(I q+ I level+ I Z0N +I Z1N +I Z2N )Formula (2)
[0067] V diff2 =V Z2P -V Z2N =R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P )+R2*(I q+ I level+ I Z0N +I Z1N +I Z2N ) Formula (3)
[0068] Among them, I Z0P is the current drawn from the second variable current source I2 by the positive polarity terminal of the first comparator Z0, I Z1P is the current drawn from the third variable current source I3 by the positive polarity terminal of the second comparator Z2, I Z2P is the current drawn from the fourth variable current source I4 by the positive polarity terminal of the third comparator Z2, I Z0N is the current drawn from the fifth variable current source I5 by the positive polarity terminal of the first comparator Z0, I Z1N It is the current drawn from the sixth variable current source I6 by the positive polarity terminal of the second comparator Z1.
[0069] Among them, R5=R8, R6=R7=R9=R10, so the common quantity in the above three formulas is R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P ), in formula (1), the specific amount is R9*I ZN0 –R6*I ZP0 , in formula (2) the specific amount is R10*IZ1N –R7*I Z1P , in the three formulas R2*(I q+ I level+ I Z0N +I Z1N +I Z2N ) where the current to be detected is the communication current I level .
[0070] Figure 2 A relationship diagram of a differential voltage and current signal provided in an embodiment of the present application, such as Figure 2 As shown, the horizontal axis is the current signal I extracted by the slave through the output node DSI DSI , I DSI =I q +I level ; The vertical axis is the differential signal V diff .exist Figure 2 In the above formula (1), the oblique line corresponding to the first comparator Z0 can be drawn, the oblique line corresponding to the second comparator Z1 can be drawn according to formula (2), and the oblique line corresponding to the third comparator Z2 can be drawn according to formula (3). It should be noted that: due to I Z0P ,I Z1P and I Z2P The size is uA level, I q and I level The size is mA level, I Z0P ,I Z1P and I Z2P The size is much smaller than I q and I level The size of Figure 2 Ignored I Z0P ,I Z1P and I Z2P In the embodiment of the present application, for example, the resistance values of the fifth resistor R5 and the eighth resistor R8 are both 100 times the resistance value of the second resistor R2, and the resistance values of the sixth resistor R6, the seventh resistor R7, the ninth resistor R9 and the tenth resistor R10 are all 2000 times the resistance value of the second resistor R2.
[0071] like Figure 2 As shown, each oblique line represents a differential signal V diff and the current signal I DSI The relationship between the slope of the diagonal line is V diff =R2*I DSI From the slope formula, we can see that the current I DSI The change of V diff , then the slope refers to the differential voltage V diff Relative to current I DSIThe slope of the curve is R2, which is the rate of change of the slope. Therefore, according to the above slope formula, the slope can actually be R2. Since R2 is fixed, Figure 2 The slopes of the three lines are the same.
[0072] like Figure 2 As shown, the Y-axis intercept of the oblique line corresponding to the first comparator Z0 can be R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P )+R9*I Z0N –R6*I Z0P The Y-axis intercept of the oblique line corresponding to the second comparator Z1 can be R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P )+R10*I Z1N –R7*I Z1P The Y-axis intercept of the oblique line corresponding to the third comparator Z2 can be R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P ).
[0073] Combine the following Figure 2 , the working principle of current detection by the current detection circuit in the embodiment of the present application is described.
[0074] In the current detection circuit, the current drawn from the positive polarity end of the comparator is by default greater than the current drawn from the negative polarity end. For example, the current I drawn from the positive polarity end of the first comparator Z0 is Z0P Greater than the current I drawn from the negative terminal Z0N , the current I drawn from the positive terminal of the second comparator Z1 Z1P Greater than the current I drawn from the negative terminal Z1N , the current I drawn from the positive polarity terminal of the third comparator Z2 Z2P Greater than the current I drawn from the negative terminal Z2N Therefore, R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P ) is a negative value, R10*I Z1N –R7*I Z1P is a negative value, R9*IZ0N –R6*I Z0P Is a negative value.
[0075] According to the above three formulas and Figure 2 It can be concluded that the offset voltages of the three comparators are different, wherein the offset voltage of the first comparator Z0 is R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P ) produces a negative offset voltage. The offset voltage of the second comparator Z1 refers to R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P ) and R10*I Z1N –R7*I Z1P The negative offset voltage generated by the negative value of the third comparator Z2 is R8*(I Z0N +I Z1N +I Z2N )–R5*(I Z0P +I Z1P +I Z2P ) and R9*I Z0N –R6*I Z0P A negative value of will produce a negative offset voltage. Figure 2 As shown, since the Y-axis intercepts of the three comparators are all negative numbers, the three Y-axis intercepts can be offset voltages.
[0076] According to the above Figure 2 and three From this formula, we can conclude that the order of difficulty of flipping the three comparators from easy to difficult is: the third comparator Z2> the second comparator Z1> the first comparator Z0. Since the current drawn from the positive polarity end of the first comparator Z0 is higher than the current drawn from the positive polarity end of the second comparator Z1 in the circuit design, the first comparator Z0 is the least likely to flip. During communication, if the first comparator Z0 and the second comparator Z1 have flipped, the third comparator Z2 must flip. Therefore, the comparison signals output by the three comparators during communication can be shown in Table 1 below:
[0077] Table 1
[0078] The third comparator Z2 The second comparator Z1 The first comparator Z0 <![CDATA[I q ]]> 1 0 0 <![CDATA[I q +12mA]]> 1 1 0 <![CDATA[I q +24mA]]> 1 1 1
[0079] The current detection circuit can detect different levels of communication current I by comparing the signal levelAs shown in Table 1 above, if the comparison signal of the third comparator Z2 is 1, the comparison signal of the second comparator Z1 is 0, and the comparison signal of the first comparator Z0 is 0, the current signal only includes I q , the communication current I detected at this time level is 0; if the comparison signal of the third comparator Z2 is 1, the comparison signal of the second comparator Z1 is 1, and the comparison signal of the first comparator Z0 is 0, the current signal includes I q +12mA, the communication current detected at this time is I level is 12mA; if the comparison signal of the third comparator Z2 is 1, the comparison signal of the second comparator Z1 is 1, and the comparison signal of the first comparator Z0 is 1, the current signal includes I q +24mA, the communication current detected at this time is I level is 24mA.
[0080] As an optional solution, the range of the differential voltage and the magnitude of the offset voltage of the comparator may be set by adjusting the resistance value of the second resistor R2.
[0081] Figure 3 Another relationship diagram of differential voltage and current signals provided in an embodiment of the present application is as follows: Figure 3 As shown, the resistance of the second resistor R2 can affect both the slope and the intercept of the Y axis, which will affect the orientation of the differential voltage of the comparator and the magnitude of the offset voltage. Therefore, the resistance of the second resistor R2 is adjusted so that the comparator reaches the optimal flip point, thereby being able to detect the communication current more accurately. Figure 3 As shown, the point corresponding to the dotted line on the horizontal axis is the optimal flip point. For example, the optimal flip point of the first comparator Z0 is C, the optimal flip point of the second comparator Z1 is B, and the optimal flip point of the third comparator Z3 is A. Figure 3 As shown, the point corresponding to the solid line on the horizontal axis is the actual flip point. For example, the actual flip point of the first comparator Z0 is C', and the actual flip point of the second comparator Z1 is B'. Due to the influence of circuit noise and the offset voltage of the comparator, the actual flip point will have an error range. Figure 3 The error range is represented by the range of double arrows. The range of blue double arrows is a certain distance from the optimal flip point. The distance can be represented by a single arrow. The distance is the margin of the comparator. By adjusting the resistance value of the second resistor R2, the actual flip point is closer to the optimal flip point.
[0082] In the embodiment of the present application, the response of the comparator is optimized by adjusting the resistance value of the second resistor R2, so that the actual flip point is closer to the ideal state, thereby improving the accuracy of the detected current; adjusting the resistance value of the second resistor R2 helps to reduce the impact caused by circuit noise and the inherent offset voltage of the comparator, so that the output of the comparator is more stable, thereby reducing the possibility of misjudgment; by adjusting the resistance value of the second resistor R2, the flip threshold of the comparator can be adjusted, so that the comparator is more sensitive and responds quickly to signal changes when it is close to the optimal flip point, thereby improving the dynamic performance of the entire circuit.
[0083] As another optional solution, by setting different offset voltages, the comparator can match and compare different communication currents. The flipping difficulty of the comparator can be adjusted through circuit design to adapt to different communication requirements to enhance flexibility.
[0084] In the embodiment of the present application, the current detection circuit may also cause an overcurrent problem. The overcurrent problem caused by the current detection circuit and the working principle of the overcurrent protection are described in detail below.
[0085] In the actual signal transmission process, when the slave sends a current signal to the host, the number of slaves is uncertain, which may cause the host's receiving circuit to malfunction and output an erroneous signal.
[0086] For example, when the number of slaves is 1 and the slave only generates a quiescent current I q No communication current I is generated level At this time, the initialization signals of the voltage difference between the positive and negative terminals of the three comparators are V diff2_0 、V diff1_0 and V diff0_0 , the three initialization signals are all less than 0, and the comparison signals output by the three comparators are all low level. level The voltage of the output node DSI remains unchanged, the voltage drop across the second resistor R2 increases, and the voltage at the output end of the operational amplifier OP rises by R2*I level , the voltage drop across the fifth resistor R5 remains unchanged, so the voltage V at the first node a ZP2 Rise R2*I level At the same time, the voltage V at the first end of the third variable current source I3 ZP1 and the voltage V at the first terminal of the second variable current source I2 ZP0 It will also increase R*I level , the voltage increase at the positive terminals of the three comparators will eventually cause V diff2 、V diff1 and V diff0 All of them change from less than 0 to greater than 0, making the comparison signals output by the three comparators all high level. Assume that at this time Ilevel Just for I DSI_0 , and under this condition, the initialization signals of the voltage difference between the positive and negative terminals of the three comparators are V diff2_0 、V diff1_0 and V diff0_0 And they are all less than 0.
[0087] For another example, when the number of slaves is 2 and the slave only generates static power consumption I q No communication current I is generated level , at this time, the comparison signals output by the three comparators are at a low level. A static current I of the slave is added to the output node DSI. q , the voltage of the output node DSI remains unchanged, the voltage drop across the second resistor R1 increases, and the voltage at the output of the operational amplifier op rises by R2*I q , the voltage drop across the fifth resistor R5 remains unchanged, so the voltage V at the first node a ZP2 Rising R*I q At the same time, the voltage V at the first end of the third variable current source I3 Z1P and the voltage V at the first terminal of the second variable current source I2 Z0P It will also increase R*I q The voltage increase of the positive terminals of the three comparators will eventually lead to the initialization signal V of the voltage difference between the positive and negative terminals of the comparators. diff2_0 、V diff1_0 and V diff0_0 will increase, so the communication current I required for the comparison signals output by the three output comparators to change from low level to high level level Less than I DSI_0 , that is I level Less than I DSI_0 When the comparison signals output by the comparator are all high level, the receiving function of the host's receiving circuit is abnormal.
[0088] Similarly, when the number of slaves is 3, the current I required for the comparison signals output by the three comparators of the host's receiving circuit to change from low level to high level is level Therefore, the more slaves there are, the more current I is needed when the comparison signal output by the comparator changes from low level to high level. level The smaller.
[0089] In summary, when the number of slaves is uncertain, the initialization signal of the voltage difference between the two input terminals of the comparator of the host's receiving circuit will also change, that is, the initial voltage difference between the two input terminals of the comparator will change, causing the comparator to output an error signal when receiving a current signal.
[0090] In order to solve the above technical problems, in the embodiments of the present application, Figure 1 As shown, the digital control circuit can monitor the comparison signals output by the first comparator Z0, the second comparator Z1 and the third comparator Z2, and then output a control signal to at least one current source according to the comparison signal to adjust the current of the current source, wherein the control signal is a dynamic adjustment signal, and the size of the current source is continuously adjusted by the control signal to adjust the voltage difference V between the positive polarity end and the negative polarity end of the three comparators diff For example, the current I of the seventh variable current source I7 is adjusted by the control signal trim0. Z2N , the current I of the sixth variable current source I6 is adjusted by the control signal trim1 ZN1 , ..., and so on, the current I of the second variable current source I2 is adjusted by controlling the signal trim5. ZP0 .
[0091] For example, the regulation function of the control signal trim0 is: when the number of slaves is 2, the voltage V ZP2 Rising R*I q At the same time, the voltage V at the first end of the third variable current source I3 Z2P and the voltage V at the first terminal of the second variable current source I2 Z0P It will also increase R*I q , the voltage difference between the two input terminals of the three comparators is the initialization signal V diff2 、V diff1 and V diff0 The current I of the seventh variable current source I7 is dynamically adjusted by controlling the signal trim0. Z2N , to reduce the current I of the seventh variable current source I7 Z2N , the voltage V at the second node b Z2N While increasing, the voltage V at the first end of the sixth variable current source I6 Z1N and the voltage V at the first terminal of the fifth variable current source I5 Z0N will also increase, and finally initialize the signal V diff2 、V diff1 and V diff0 will be reduced to the initialization signal V for normal operation diff2_0 、V diff1_0 and V diff0_0 , the receiving function of the host receiving circuit is restored to the initial state. Similarly, when the number of slaves is 3, the current I of the seventh variable current source I7 is dynamically adjusted by the control signal trim0. Z2N , to reduce the current I of the seventh variable current source I7 Z2N , the voltage V at the second node b Z2N Increases, so that the host's receiving circuit returns to its initial state.
[0092] For another example, the regulation function of the control signal trim3 is: when the number of slaves is 2, the voltage V Z2P Rising R*I q At the same time, the voltage V at the first end of the third variable current source I3 Z1P and the voltage V at the first terminal of the second variable current source I2 Z0P It will also increase R*I q , the voltage difference between the two input terminals of the three comparators is the initialization signal V diff2 、V diff1 and V diff0 The current I of the fourth variable current source I4 is dynamically adjusted by controlling the signal trim3. Z2P , to increase the current I of the fourth variable current source I4 Z2P , the voltage V at the first node a ZP2 While decreasing, the voltage V at the first end of the third variable current source I3 Z1P and the voltage V at the first terminal of the second variable current source I2 Z0P will also decrease, initializing signal V diff2 、V diff1 and V diff0 will be reduced to the initialization signal V for normal operation diff2_0 、V diff1_0 and V diff0_0 , the receiving function of the receiving circuit of the host is restored to the initial state. When the number of slaves is 3, the principle of dynamic adjustment through the control signal trim3 is the same as the adjustment principle when the number of slaves is 2, and will not be repeated here.
[0093] According to equation V diff2 =V Z2P -V Z2N 、Vdiff1=V Z1P -V Z1N and V diff0 =V Z0P -V Z0N The dynamic adjustment principle of other control signals is the same as that of the control signal trim0, and will not be repeated here.
[0094] In summary, the current detection circuit can monitor the comparison signals output by the first comparator Z0, the second comparator Z1 and the third comparator Z2 through the digital control circuit according to the number of slaves, and then output a control signal to at least one current source according to the comparison signal to dynamically adjust the current size of the current source, so that the differential voltage V diff is adjusted back to the initialization signal V diff2_0 、V diff1_0 and V diff0_0This avoids the problem of abnormal output of the host receiving circuit when the host is loaded with different numbers of slaves.
[0095] As an optional solution, the digital control circuit is further configured to identify that the slave is offline when a change in a comparison signal output by at least one comparator is detected.
[0096] In order to adapt to the influence of the static current of different numbers of slaves on the flip threshold of the comparator. When the number of slaves increases, the current drawn by the comparator from the variable current source gradually increases; when the comparison signal output by the comparator flips, the current drawn by the comparator from the variable current source gradually decreases to maintain the stability of the comparator output; when the slave is offline, the change of the comparison signal output by the comparator can be detected, thereby identifying the situation of the slave being offline.
[0097] Figure 4 A schematic diagram of identifying a slave disconnection provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, when the slave is connected and not offline (that is, initialized after mounting in the figure), I q remains unchanged; when the slave is first connected, I q Greater than I Z2P , so the comparison signal output by the third comparator Z2 is high level; the digital control circuit controls the current I Z2P Gradually rise until I Z2P Greater than I q , at this time, the comparison signal of the third comparator Z2 turns low; when the comparison signal of the third comparator Z2 turns low, the digital control circuit controls the current I Z2P Gradually reduce, so that I Z2P Reduced to less than I q , and the comparison signal of the third comparator Z2 turns high; when the comparison signal output by the third comparator Z2 turns high, the current I Z2P remains unchanged and no longer decreases, the current I Z2P remains stable, and the third comparator Z2 is also in a high level stable state. When a slave is offline, I q Will suddenly decrease to I Z2P Next, the comparison signal output by the third comparator Z2 will turn low, and the slave is detected to be offline. Therefore, the digital control circuit can also be used to identify the slave offline when the comparison signal output by the third comparator turns low.
[0098] In the embodiment of the present application, the comparison signal change of the comparator can be directly used to detect the situation of the slave being offline, thereby improving the system's diagnostic ability when the slave fails; the current detection circuit can dynamically adjust the current according to the connection and disconnection of the slave, ensuring that the comparator can correctly judge the state of the communication current under various working conditions, thereby improving the system adaptability.
[0099] In an embodiment of the present application, a current detection circuit includes a host and a slave, the host includes a transmitting circuit and a receiving circuit, the receiving circuit includes multiple comparators, each comparator has a different offset voltage, the transmitting circuit sends a voltage signal to the slave, the slave extracts the current signal through the output node and sends the current signal to the receiving circuit, the receiving circuit generates a differential voltage for each comparator through the current signal, so that each comparator outputs a comparison signal according to the differential voltage, and the comparison signal is used to detect different levels of communication current, so that the comparator can accurately distinguish different levels of communication current, thereby improving the current detection accuracy.
[0100] In the embodiment of the present application, the digital control circuit can output a control signal to the current source according to the comparison signal output by the comparator to adjust the current of the current source, so that the differential voltage of the comparator is adjusted back to the initialization signal, and the automatic adjustment of the current source is realized, thereby realizing overcurrent protection. The overcurrent protection has a fast response speed and can cut off the abnormal current in time, thereby avoiding circuit damage or equipment failure.
[0101] In the embodiment of the present application, the built-in adaptive adjustment mechanism allows the circuit to automatically adapt to different working conditions and slave configurations, so that the current detection and overcurrent protection have adaptive capabilities, achieving accurate current detection and fast-response overcurrent protection, thereby reducing the risks brought by current changes or load changes, improving system stability and reliability, and significantly enhancing the stability and safety of the entire automotive electronic system.
[0102] Figure 5 A schematic diagram of the structure of an integrated circuit chip provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the integrated circuit chip includes a current detection circuit. The description of the current detection circuit can be found in the above Figures 1 to 4 The description of the current detection circuit in the illustrated embodiment will not be repeated here.
[0103] In the embodiments of the present application, the integrated circuit chip includes but is not limited to a microcontroller unit (MCU), a DSP, a microprocessor unit (MPU), a central processing unit (CPU), and the like, which can process digital signals, analog signals, or perform signal control functions, instruction processing, and calculation functions, and other micro central control chips and system-on-chip chips.
[0104] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A current detection circuit, characterized in that: The device comprises a host and a slave, wherein the host comprises a transmitting circuit and a receiving circuit, wherein the transmitting circuit and the receiving circuit are electrically connected, the transmitting circuit is also electrically connected to the slave through an output node, the receiving circuit is electrically connected to the slave, the output node is electrically connected to a communication bus, and the receiving circuit comprises a plurality of comparators, each of which has a different offset voltage; The sending circuit is used to send a voltage signal to the slave; The slave is used to extract the current signal through the output node and send the current signal to the receiving circuit; The receiving circuit is used to generate a differential voltage of each comparator through the current signal, so that each comparator outputs a comparison signal according to the differential voltage, and the comparison signal is used to detect communication currents of different levels.
2. The circuit according to claim 1, characterized in that The current detection circuit further includes a digital control circuit, the receiving circuit further includes a plurality of current sources, and the digital control circuit is electrically connected to the plurality of current sources and the plurality of comparators; The digital control circuit is used to output a control signal to at least one of the current sources according to the comparison signal to adjust the current of the current source.
3. The circuit according to claim 2, characterized in that The digital control circuit is further configured to identify that the slave device is offline when a change in a comparison signal output by at least one of the comparators is detected.
4. The circuit according to claim 1, characterized in that The transmitting circuit includes a first variable current source, a first resistor, an operational amplifier, a second resistor, a third resistor and a fourth resistor; A first terminal of the first variable current source is electrically connected to a first voltage terminal, and a second terminal of the first variable current source is electrically connected to a positive polarity terminal of the operational amplifier; The first end of the first resistor is electrically connected to the positive polarity terminal of the operational amplifier, and the second end of the first resistor is electrically connected to the second voltage terminal; A first end of the second resistor is electrically connected to the output end of the operational amplifier, and a second end of the second resistor is electrically connected to the output node; A first end of the third resistor is electrically connected to the output node, and a second end of the third resistor is electrically connected to the negative polarity terminal of the operational amplifier; A first end of the fourth resistor is electrically connected to the negative polarity terminal of the operational amplifier, and a second end of the fourth resistor is electrically connected to the second voltage terminal.
5. The circuit according to claim 4, characterized in that The range of the differential voltage and the magnitude of the offset voltage of the comparator are set by adjusting the resistance value of the second resistor.
6. The circuit according to claim 1, characterized in that The receiving circuit further includes a first differential voltage generating circuit and a second differential voltage generating circuit, the first differential voltage generating circuit is electrically connected to the output terminal of the operational amplifier and the positive polarity terminal of each of the comparators, and the second differential voltage generating circuit is electrically connected to the output node and the negative polarity terminal of each of the comparators; The first differential voltage generating circuit is used to output a positive polarity voltage corresponding to the comparator to the positive polarity terminal of each comparator; The second differential voltage generating circuit is used to output a negative polarity voltage corresponding to the comparator to the negative polarity end of each comparator, and the difference between the positive polarity voltage and the negative polarity voltage of each comparator is the differential voltage of the comparator.
7. The circuit according to claim 6, characterized in that The first differential voltage generating circuit includes a fifth resistor, a sixth resistor, a seventh resistor, a second variable current source, a third variable current source and a fourth variable current source; A first end of the fifth resistor is electrically connected to the output end of the operational amplifier, a second end of the fifth resistor is electrically connected to the first node, a first end of the sixth resistor is electrically connected to the first node, a second end of the sixth resistor is electrically connected to the first end of the second variable current source, and a second end of the second variable current source is electrically connected to the second voltage end; The first end of the seventh resistor is electrically connected to the first node, the second end of the seventh resistor is electrically connected to the first end of the third variable current source, and the second end of the third variable current source is electrically connected to the second voltage end; A first terminal of the fourth variable current source is electrically connected to the first node, and a second terminal of the fourth variable current source is electrically connected to the second voltage terminal.
8. The circuit according to claim 6, characterized in that The second differential voltage generating circuit includes an eighth resistor, a ninth resistor, a tenth resistor, a fifth variable current source, a sixth variable current source and a seventh variable current source; A first end of the eighth resistor is electrically connected to the output node, a second end of the eighth resistor is electrically connected to the second node, a first end of the ninth resistor is electrically connected to the second node, a second end of the ninth resistor is electrically connected to a first end of the fifth variable current source, and a second end of the fifth variable current source is electrically connected to the second voltage terminal; The first end of the tenth resistor is electrically connected to the second node, the second end of the tenth resistor is electrically connected to the first end of the sixth variable current source, and the second end of the sixth variable current source is electrically connected to the second voltage end; A first terminal of the seventh variable current source is electrically connected to the second node, and a second terminal of the seventh variable current source is electrically connected to the second voltage terminal.
9. The circuit according to claim 7, characterized in that The plurality of comparators include a first comparator, a second comparator, and a third comparator; The positive polarity terminal of the first comparator is electrically connected to the first terminal of the second variable current source; The positive polarity terminal of the second comparator is electrically connected to the first terminal of the third variable current source; The positive polarity terminal of the third comparator is electrically connected to the first terminal of the fourth variable current source.
10. The circuit according to claim 8, characterized in that The plurality of comparators include a first comparator, a second comparator, and a third comparator; The negative polarity terminal of the first comparator is electrically connected to the first terminal of the fifth variable current source; The negative polarity terminal of the second comparator is electrically connected to the first terminal of the sixth variable current source; A negative polarity terminal of the third comparator is electrically connected to the first terminal of the seventh variable current source.
11. The circuit according to claim 1, characterized in that The slave includes a current source, a first terminal of the current source is electrically connected to the output node, and a second terminal of the current source is electrically connected to the second voltage terminal.
12. An integrated circuit chip, characterized in that: include: The current detection circuit according to any one of claims 1 to 11.
Citation Information
Cited By
Signal acquisition monitoring equipment for DSI3 bus
CN121657553A
