A charging state detection circuit and method for a single IO port based on dynamic voltage
Patent Information
- Application Number
- CN202411761689.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-01
AI Technical Summary
The existing lithium battery charging technology occupies the MCU multi-IO port to detect charging status, resulting in tight IO port resources and increasing costs and development time.
A single IO port charging state detection circuit based on dynamic voltage is adopted, and the charging state detection is realized through the coordinated work of the charging module, the status monitoring module and the MCU module, and the corresponding relationship between the voltage ratio and the resistance ratio is used.
Only single IO of the MCU module can realize several charging state detection of the charging chip, save IO resources, reduce costs and development time, reduce module size, and support module miniaturization and standardization.
Smart Images

Figure CN119742881A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of charging detection circuits, and in particular to a charging state detection circuit and method for a single IO port based on dynamic voltage. Background Art
[0002] In the field of electronic cigarettes, lithium batteries are often used as product power supplies, and the lithium batteries are charged by configuring a USB charger. The charging circuit has both overvoltage protection and low-voltage protection functions. Specifically, when the voltage connected to the USB end exceeds 6.5±0.5V, the charging circuit enters overvoltage protection; when the voltage is lower than 4.0V±0.5V, it is forced to enter low-voltage protection. At this time, the electronic cigarette charging circuit automatically shuts off the charging current, the digital tube display goes out, and no operation is allowed, thereby protecting the electronic devices in the circuit. After overvoltage, when the user unplugs the USB charging port, there will be a pull-out prompt and it will enter a dormant state, making it impossible to smoke normally.
[0003] In the prior art, one IO port is usually required to detect the USB plugged into the charging detection port and the voltage on the USB, one IO port is used to detect whether the last charging function pin of the charger is in the charging state, and another IO port is required to identify whether it is full. Three IO ports are required to realize charging state detection, which easily leads to the shortage of MCU's IO port resources during use and wastes the MCU's IO port resources. Furthermore, when the MCU chip has no idle IO ports for charging state detection, it is necessary to replace the MCU chip with a larger number of pins to realize the same function, further increasing the cost.
[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a charging status detection circuit and method for a single IO port based on dynamic voltage, aiming to solve the problem that the existing lithium battery charging technology occupies multiple IO ports of MCU to detect the charging status.
[0006] The technical solution of the present invention is as follows: The present invention discloses a charging state detection circuit of a single IO port based on dynamic voltage, comprising: a charging module, a state monitoring module and an MCU module; a chip power supply terminal of the charging module is used to be connected to an external charging terminal, a voltage output terminal of the charging module is used to be connected to a positive electrode of a lithium battery, a state indicating terminal of the charging module is connected to the state monitoring module, and the charging module is used to adjust the conduction relationship of the state indicating terminal accordingly according to the charging state of the lithium battery, so as to adjust the voltage value output by the state monitoring module; the state monitoring module is connected to the positive electrode of the lithium battery, and the state monitoring module is used to receive a conduction signal at the state indicating terminal of the charging module, and perform voltage division sampling on the voltage value at the positive electrode of the lithium battery, and input the sampled voltage to the state detection terminal of the MCU module; the state detection terminal of the MCU module is connected to the state monitoring module, and is used to obtain a voltage ratio according to the sampled voltage and the power supply voltage, obtain a current resistance ratio according to the voltage ratio, and determine the charging state of the charging module according to the current resistance ratio and a preset resistance ratio.
[0007] A further configuration of the present invention further includes a switch module, a first end of the switch module is connected to an external charging end, a second end of the switch module is connected to the status monitoring module, a third end of the switch module is grounded, and the switch module is used to detect whether the chip power supply end of the charging module is connected to a power supply.
[0008] According to a further configuration of the present invention, the charging module includes: a first charging chip; the first charging chip has a chip power supply terminal, a first status indication terminal and a second status indication terminal, the chip power supply terminal of the first charging chip is connected to the external charging terminal, and the status indication terminal of the status monitoring module is connected to the charging module.
[0009] A further arrangement of the present invention is that the state monitoring module includes a first resistor, a second resistor, a third resistor and a fourth resistor, one end of the first resistor is connected to the first state indication end of the first charging chip, one end of the second resistor is connected to the second state indication end of the first charging chip, one end of the third resistor is connected to the positive electrode of the lithium battery, the other end of the first resistor, the other end of the second resistor and the other end of the third resistor are respectively connected to the MCU module and one end of the fourth resistor, and the other end of the fourth resistor is connected to the switch module.
[0010] According to a further configuration of the present invention, the first charging chip is a linear lithium battery charging IC.
[0011] According to a further configuration of the present invention, the switch module includes: a fifth resistor, a sixth resistor, and a first switch tube, one end of the fifth resistor is connected to the external charging end, the other end of the fifth resistor is respectively connected to the gate of the switch tube and the common end of the sixth resistor, the emitter of the first switch tube is connected to the state monitoring module, and the source of the first switch tube and the other end of the sixth resistor are grounded.
[0012] According to a further configuration of the present invention, the charging module includes: a first charging chip and a first resistor; the first charging chip has a chip power supply terminal and a first status indication terminal, the chip power supply terminal of the first charging chip is respectively connected to the status monitoring module and the USB charging terminal, the first status indication terminal of the first charging chip is connected to one end of the first resistor, and the other end of the first resistor is connected to the status monitoring module.
[0013] A further configuration of the present invention further includes an absorption module, which includes a seventh resistor and a first capacitor, one end of the seventh resistor is connected to the external charging end, the other end of the seventh resistor is connected to one end of the first capacitor, and the other end of the first capacitor is grounded.
[0014] According to a further configuration of the present invention, the MCU module comprises: a microcontroller chip, wherein a status detection terminal of the microcontroller chip is connected to the status monitoring module, and a power port VDD is connected to a positive electrode of a lithium battery; the microcontroller chip is pre-burned with a plurality of resistance ratios for obtaining a voltage ratio according to the sampled voltage and the power supply voltage, obtaining a current resistance ratio according to the voltage ratio, and determining a charging state of the charging module according to the current resistance ratio and a preset resistance ratio.
[0015] Based on the same inventive concept, the present invention also discloses a detection method of a charging state detection circuit of a single IO port based on dynamic voltage as described above, comprising the following steps: The MCU module detects the lithium battery voltage and obtains the voltage value at the status detection terminal of the MCU module; Based on the lithium battery voltage and the sampled voltage at the state detection terminal of the MCU module, a voltage ratio between the two is calculated, and the voltage ratio corresponds to the resistance ratio; Based on the determined resistance ratio, the charging state is determined.
[0016] The present invention provides a charging state detection circuit and method of a single IO port based on dynamic voltage, which comprises: a charging module, a state monitoring module and an MCU module; a chip power supply terminal of the charging module is used to be connected to an external charging terminal, a voltage output terminal of the charging module is used to be connected to a positive electrode of a lithium battery, a state indication terminal of the charging module is connected to the state monitoring module, and the charging module is used to adjust the conduction relationship of the state indication terminal according to the charging state of the lithium battery, so as to adjust the voltage value output by the state monitoring module; the state monitoring module is connected to the positive electrode of the lithium battery, and the state monitoring module is used to receive a conduction signal at the state indication terminal of the charging module, and perform voltage division sampling on the voltage value at the positive electrode of the lithium battery, and input the sampled voltage to the state detection terminal of the MCU module; the state detection terminal of the MCU module is connected to the state monitoring module, and is used to obtain a voltage ratio according to the sampled voltage and the power supply voltage, obtain a current resistance ratio according to the voltage ratio, and determine the charging state of the charging module according to the current resistance ratio and a preset resistance ratio. The present invention can identify the states of USB charging, full charge, overvoltage and overcurrent by using one IO port of MCU, and can realize several charging state detections of charging chip only by using a single IO of MCU module, thereby saving IO resources and effectively reducing cost and development time, and further reducing the resources occupied by IO ports, so there is no need to replace MCU chip with more pins to realize the same function, and the module volume is reduced, thus laying a technical foundation for module miniaturization and standardization. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary personnel in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0018] Figure 1 It is a module architecture diagram of a charging status detection circuit of a single IO port based on dynamic voltage in the present invention.
[0019] Figure 2 It is a module architecture diagram of a single IO port charging state detection circuit based on dynamic voltage with a switch module in some preferred embodiments of the present invention.
[0020] Figure 3 It is a circuit diagram of a charging state detection circuit of a single IO port based on dynamic voltage in the present invention.
[0021] Figure 4 It is a schematic diagram of an MCU module of a charging state detection circuit of a single IO port based on dynamic voltage in the present invention.
[0022] Figure 5 It is a circuit diagram of another preferred embodiment of the charging state detection method of a single IO port based on dynamic voltage in the present invention.
[0023] Figure 6 It is a schematic diagram of the steps of the charging state detection method of a single IO port based on dynamic voltage in the present invention.
[0024] The symbols in the accompanying drawings are: 100, charging module; 200, status monitoring module; 300, MCU module; 400, switch module; 500, absorption module. DETAILED DESCRIPTION
[0025] The present invention provides a charging state detection circuit and method for a single IO port based on dynamic voltage. In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0026] In the embodiments and the scope of the patent application, unless the text specifically defines the article, "a", "an", "the" and "the" may also include plural forms. If there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0027] It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be intermediate elements. In addition, the "connection" or "coupling" used herein can include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0028] Those skilled in the art will understand that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the field to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0029] In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0030] like Figure 1 and Figure 3 As shown, the present invention provides a charging state detection circuit of a single IO port based on dynamic voltage, which includes: a charging module 100, a state monitoring module 200 and an MCU module 300; the chip power supply terminal of the charging module 100 is used to connect to an external charging terminal, the voltage output terminal of the charging module 100 is used to connect to the positive electrode of a lithium battery, the state indication terminal of the charging module 100 is connected to the state monitoring module 200, and the charging module 100 is used to adjust the conduction relationship of the state indication terminal according to the charging state of the lithium battery to adjust the voltage value output by the state monitoring module 200; the state monitoring module 200 is connected to the positive electrode of the lithium battery The state monitoring module 200 is used to receive the conduction signal at the state indication terminal of the charging module 100, and to perform voltage division sampling on the voltage value at the positive electrode of the lithium battery, and to input the sampled voltage to the state detection terminal STDBY / CHRG / USB_ADC of the MCU module 300; the state detection terminal STDBY / CHRG / USB_ADC of the MCU module 300 is connected to the state monitoring module 200, and is used to obtain a voltage ratio according to the sampled voltage and the power supply voltage, obtain a current resistance ratio according to the voltage ratio, and determine the charging state of the charging module 100 according to the current resistance ratio and a preset resistance ratio.
[0031] For details, please refer to Figure 3 and Figure 4When the user chooses to charge the electronic cigarette, the corresponding port of the first jumper socket is connected to the USB charging terminal. At this time, the chip power supply terminal of the charging module 100 is powered on and starts working. At this time, one end of the state monitoring module 200 is grounded, and the other end of the state monitoring module 200 is connected to the positive pole of the power supply. The state detection terminal STDBY / CHRG / USB_ADC of the MCU module 300 samples the voltage value at the state monitoring module 200 at this time. Therefore, the voltage value at the state detection terminal STDBY / CHRG / USB_ADC of the MCU module 300 is the sampled voltage obtained by the state monitoring module after dividing the positive voltage of the lithium battery. The state indication terminal of the charging module 100 is connected to the state monitoring module 200. When the circuit is in different charging states, the conduction relationship of the state indication terminal of the charging module 100 changes, so that the voltage at the single IO port changes accordingly: when the lithium battery charger is in a normal charging state, the first state indication terminal of the charging module 100 is connected to the ground; when the lithium battery charger is in a full state, the second state indication terminal of the charging module 100 is connected to the ground; when the lithium battery charger is in an overvoltage, undervoltage, overtemperature or other overvoltage or undervoltage fault state, charging is stopped, and the first state indication terminal and the second state indication terminal are both turned off. The charging module 100 has different voltage division conditions in the circuit under different charging states, thereby changing the voltage value at the state detection terminal STDBY / CHRG / USB_ADC of the MCU module 300. The working range of the lithium battery voltage V (BAT+) is 3-4.2V fluctuation. The power supply voltage and the voltage value at the state detection end of the MCU module 300 are variable, but there is a fixed corresponding relationship between the voltage ratio between the power supply voltage and the voltage at the state detection end and the resistance value. The lithium battery voltage can be obtained by the MCU module 300 itself through measurement. Therefore, the MCU module 300 is pre-set with a resistance ratio corresponding to the charging state. When the voltage ratio corresponds to the resistance ratio, the lithium battery charger is in the corresponding charging state. The charging status information corresponding to the electronic cigarette can be stored in the memory to facilitate subsequent reading operations, display the current charging status of the electronic cigarette, and enhance the user experience during smoking.
[0032] Further, the first charging chip; the first charging chip has a chip power supply terminal, a first state indication terminal and a second state indication terminal, the chip power supply terminal of the first charging chip is connected to the external charging terminal, and the first state indication terminal and the second state indication terminal are connected to the state monitoring module. The first charging chip U1 has a charging indication function and a full indication function. In some preferred embodiments, the first charging chip U1 adopts a 1.2A linear lithium battery charging IC chip WSCH6057T. The charging chip WSCH6057T has two drain open circuit state indication output terminals, CHRG and STDBY, where the first state indication terminal is CHRG and the second state indication terminal is STDBY, both of which can be connected to an external LED light as a charging state indication of the first charging chip U1. When the charging chip is in the charging state, the CHRG terminal is pulled to a low voltage, and the STDBY terminal is in a high impedance state. At this time, the CHRG terminal is internally connected to ground, and the STDBY terminal is internally regarded as an open circuit as an indication of the corresponding charging state. Similarly, when the charger is full, CHRG is in a high impedance state and STDBY is pulled to a low voltage. When in an abnormal state, both the CHRG terminal and the STDBY terminal are in a high-impedance state.
[0033] When the lithium battery starts to charge, the CHRG terminal in the first charging chip U1 is turned on by the switch tube inside the chip and pulled down, then the CHRG terminal is grounded and connected, and the voltage value at the state detection terminal of the MCU module is a first voltage value. When the lithium battery is full, the STDBY terminal is pulled down because the switch tube inside the chip is turned on, then the STDBY terminal is grounded and connected, and the voltage value at the state detection terminal of the MCU module is a second voltage value. When the circuit is in an overvoltage or undervoltage fault state, the CHRG terminal and the STDBY terminal chip are both considered open circuits, then the voltage value at the state detection terminal of the MCU module is a third voltage value, and then the voltage ratio between the sampled voltage and the power supply voltage is different, and the current resistance ratio is obtained according to the voltage ratio, and the charging state of the charging module is determined according to the current resistance ratio and the preset resistance ratio. The resistance of the first resistor R1 is much greater than the resistance of the second resistor R2, so the voltage division ratio of the first resistor R1 and the second resistor R2 is different. The charging module may further include: an eighth resistor, which is connected to the charging current adjustment terminal PROG of the charging chip and is used to adjust the current value when the charging module charges the lithium battery. The lithium battery positive terminal of the first charging chip U1 is connected to the positive electrode of the lithium battery. Exemplarily, in some preferred embodiments of the present invention, when connected to the USB charging terminal, the first charging chip U1 charges the lithium battery with a charging current of 1A.
[0034] Furthermore, the state monitoring module 200 includes a third resistor R3 and a fourth resistor R4, one end of the third resistor R3 is connected to the positive electrode BAT+ of the lithium battery, the other end of the third resistor R3 is respectively connected to the common end of the first resistor R1, the second resistor R2 and the fourth resistor R4, and the other end of the fourth resistor R4 is connected to the charging module 100, the switch module 400 and the absorption module 500.
[0035] One end of the third resistor R3 is connected to the lithium battery voltage, and the other end of the third resistor R3 and one end of the fourth resistor R4 are connected to the state detection terminal STDBY / CHRG / USB_ADC of the MCU module 300, then the third resistor R3 and the fourth resistor R4 are connected in series. When the lithium battery starts to charge, the CHRG terminal in the first charging chip U1 is turned on by the internal switch tube of the chip and pulled down, then the STDBY terminal is connected. When the lithium battery is full, the STDBY terminal is pulled down because the internal switch tube of the chip is turned on, and the second resistor R2 participates in the voltage division. Exemplarily, in some preferred embodiments of the present invention, the resistance of the first resistor R1 is much greater than the resistance of the second resistor R2, so the voltage division ratio of the first resistor R1 and the second resistor R2 is different.
[0036] When no resistor other than the third resistor R3 and the fourth resistor R4 is connected between the positive electrode BAT+ of the lithium battery and the ground level for voltage division, the voltage ratio between the lithium battery voltage and the voltage at the status detection terminal of the MCU module 300 is: V(BAT+) / V(STDBY / CHRG / USB_ADC)=R3 / R4. At this time, the first status indication terminal and the second status indication terminal of the charging module 100 do not work, and the charging status of the first charging chip U1 is an overvoltage or undervoltage fault state. When the first resistor R1 is connected between the positive electrode BAT+ of the lithium battery and the ground level for voltage division, the lithium battery voltage V (BAT+) is connected to the status detection terminal STDBY / CHRG / USB_ADC of the MCU module 300 through the third resistor R3, and the first resistor R1 and the fourth resistor R4 are connected in parallel for voltage division and grounded, then the voltage ratio: V (BAT+) / V (STDBY / CHRG / USB_ADC) = R3 / (R4 / / R1), at this time, the first indication terminal of the charging module 100 works, and the charging state of the first charging chip U1 is that the battery is fully charged. When the second resistor R2 is connected to divide the voltage between the positive electrode BAT+ of the lithium battery and the ground level, and the first resistor R1 is connected in series with the second resistor R2 and the fourth resistor R4 in parallel and then divided and grounded, the voltage ratio is: V (BAT+) / V (STDBY / CHRG / USB_ADC) = R3 / (R4 / / R2), at this time, the second indication terminal of the charging module 100, that is, the charging indication terminal CHRG, works, and the charging state of the first charging chip U1 is charging. The single IO serial port of the MCU module 300, that is, the state detection terminal STDBY / CHRG / USB_ADC samples the voltage after the voltage division to obtain the current charging state.
[0037] A first charging chip U1, a first resistor R1, and a second resistor R2; the first charging chip U1 has a chip power supply terminal, a first state indication terminal, and a second state indication terminal, the chip power supply terminal of the first charging chip U1 is respectively connected to the state monitoring module 200 and the USB charging terminal, the first state indication terminal of the first charging chip U1 is connected to one end of the first resistor R1, the second state indication terminal of the first charging chip U1 is connected to one end of the second resistor R2, and the other ends of the first resistor R1 and the second resistor R2 are connected to the state monitoring module 200.
[0038] Furthermore, in some other preferred embodiments, the charging module 100 may also include: a first charging chip U1; the first charging chip U1 has a chip power supply terminal and a first state indication terminal, the chip power supply terminal of the first charging chip U1 is connected to the USB charging terminal, and the first state indication terminal of the first charging chip U1 is connected to one end of the state monitoring module. At this time, the first charging chip U1 only has a charging state indication terminal CHRG for indicating the charging state of the first charging chip. When the lithium battery starts to charge, the CHRG terminal in the first charging chip U1 is pulled down because the internal switch tube of the chip is turned on. At this time, the state monitoring module participates in voltage division; when the lithium battery is full, the charging indication terminal CHRG, i.e., the first state indication terminal, jumps, and the CHRG terminal is regarded as an open circuit inside the chip. The corresponding voltage dividing resistor of the state monitoring module does not participate in voltage division, and the lithium battery voltage V (BAT+) detection value is the working voltage range of the lithium battery. When in abnormal states such as overvoltage, undervoltage, and overtemperature, the lithium battery voltage V (BAT+) cannot reach the working range. Then, through the corresponding relationship between the voltage ratio and the resistance ratio, and the lithium battery voltage V(BAT+) at the current moment, the charging state can also be detected by a single IO port. The lithium battery voltage V(BAT+) can be calculated by the MCU module 300.
[0039] Please also read Figure 2 , Figure 3 , further, the charging state detection circuit of the single IO port based on dynamic voltage also includes a switch module 400, the first end of the switch module 400 is connected to the external charging end, the second end of the switch module 400 is connected to the state monitoring module, the third end of the switch module 400 is grounded, and the switch module 400 is used to detect whether the chip power supply end of the charging module is connected to the power supply. When the user chooses to charge the electronic cigarette, the corresponding port of the first jumper seat is connected to the USB charging end. At this time, the chip power supply end of the charging module 100 is powered on and starts to work. The charging module 100 and the switch module 400 detect that the voltage signal at the chip power supply end of the charging module 100 is high level, and the switch module 400 is turned on. At this time, one end of the state monitoring module 200 is grounded, and the other end of the state monitoring module 200 is connected to the positive pole of the power supply. When the user stops charging the electronic cigarette, the charging state detection circuit of the single IO port based on dynamic voltage does not work, thereby reducing the power loss of the state monitoring module during the use of the electronic cigarette and increasing the length of time that the user can use the electronic cigarette after a single charge.
[0040] The switch module 400 includes: a fifth resistor R5, a sixth resistor R6, and a first switch tube Q1. One end of the fifth resistor R5 is connected to the USB charging end, and the other end of the fifth resistor R5 is respectively connected to the gate of the switch tube and the common end of the sixth resistor R6. The emitter of the first switch tube Q1 is connected to the mode monitoring module, and the other end of the sixth resistor R6 and the source of the first switch tube Q1 are grounded. The USB charging end provides voltage after being connected to the circuit, and the sampling result after the fifth resistor R5 and the sixth resistor R6 are divided is input to the gate of the first switch tube Q1, then the first switch tube Q1 is powered on, and the state monitoring module 200 is grounded and turned on.
[0041] like Figure 5 As shown, in some other preferred embodiments of the present invention, an absorption module 500 is also included, one end of the absorption module 500 is connected to the USB charging end, and the other end is grounded. The absorption module 500 includes a seventh resistor R7 and a first capacitor C1, one end of the seventh resistor R7 is connected to the USB charging end, the other end of the seventh resistor R7 is connected to one end of the first capacitor C1, and the other end of the first capacitor C1 is grounded, and the absorption module 500 is used for power absorption. The absorption module 500 is an RC buffer circuit, which is arranged in parallel with the switch module 400 to reduce the turn-off loss and reduce the peak voltage.
[0042] Furthermore, the schematic diagram of the MCU module 300 is as follows: Figure 4 As shown, it includes: a microcontroller chip U2, a single IO port of the microcontroller chip U2 is connected to the state monitoring module 200, and a power port VDD is connected to the positive electrode BAT+ of the lithium battery. The IO port of the microcontroller chip U2 needs to have an interrupt function or a level jump wake-up function, and also needs to have an ADC detection function. The microcontroller chip U2 is pre-burned with a resistance ratio, which is used to calculate the voltage ratio of the lithium battery voltage V (BAT+) and the voltage at the single IO port, and compare it with the resistance ratio of the corresponding charging state. The microcontroller chip U2 is internally burned with a voltage ratio calculation program, the corresponding relationship between the above-mentioned several resistance ratios and the charging state. The microcontroller chip U2 also has a built-in VDD detection function for detecting the lithium battery voltage V (BAT+). The realization of the VDD power supply voltage detection function of the microcontroller chip U2 is a common technical means in the field, which will not be elaborated here.
[0043] The present invention converts the state parameter into the corresponding relationship between the voltage ratio and the resistance ratio by setting a first charging chip U1 with different charging state indication functions, thereby realizing the detection and indication of different charging states under the environment of lithium battery working voltage fluctuation, reducing the number of IO ports occupied, and saving IO port resources. Here, a charging module 100 with two charging state indication pins, a first state indication terminal and a second state indication terminal, is used as an example for explanation. When the USB charger is inserted into the USB charging terminal of J1, the lithium battery charging circuit starts charging, and the USB charging terminal provides a 5V voltage, and the fifth resistor R5 and the sixth resistor R6 divide the voltage by 5V. At this time, the gate of the first switch tube Q1 has voltage, and the first switch tube Q1 is turned on. Then, the state detection terminal STDBY / CHRG / USB_ADC of the MCU module 300 is pulled up by the initial third resistor R3, and the voltage is pulled up to become the third resistor R3 and the fourth resistor R4. The voltage on the fourth resistor R4 is clamped to be less than 0.3 times the lithium battery voltage, and then the micro control unit is awakened by the level jump, and the micro control unit is awakened from the sleep state. The sixth pin of the first charging chip U1WSCH6057T is the first state indication terminal, and the seventh pin is the second state indication terminal. In the two charging states, the pins of the first charging chip U1 are mutually exclusive, so it can be inserted as a USB with power. At this time, the first switch tube Q1 is turned on, and the third resistor R3 and the fourth resistor R4 divide the voltage. One of the sixth pin and the seventh pin of the first charging chip U1 will be pulled down because the internal switch tube is turned on in the corresponding charging state. In this way, one of the first resistor R1 or the second resistor R2 will divide the voltage with the third resistor R3. The resistance of the first resistor R1 is 1.2kΩ, and the resistance of the second resistor R2 is 100Ω. Because the resistance values of the first resistor R1 and the second resistor R2 are different, the voltage division ratio is also different. The MCU detects the lithium battery voltage, calculates the ratio of the lithium battery voltage to the sampling voltage on the state detection terminal STDBY / CHRG / USB_ADC of the MCU module 300 to obtain a voltage ratio, obtains the current resistance ratio according to the voltage ratio, and determines the charging state of the charging module according to the current resistance ratio and the preset resistance ratio.
[0044] Based on the above single IO port charging status detection circuit based on dynamic voltage, please refer to Figure 6 The present invention also provides a charging state detection method of a single IO port based on dynamic voltage, the detection method comprising the following steps: S100, the MCU module detects the lithium battery voltage and obtains the voltage value at the status detection terminal of the MCU module; S200, calculating a voltage ratio of the lithium battery voltage and the sampled voltage at the state detection terminal of the MCU module based on the voltage of the lithium battery and the sampled voltage at the state detection terminal of the MCU module, wherein the voltage ratio corresponds to the resistance ratio; S300, determining a charging state of the charging module according to a current resistance ratio and a preset resistance ratio; Specifically, the MCU module detects the lithium battery voltage, calculates the voltage ratio at the status detection end of the MCU module, and compares it with a preset resistance ratio. When the current resistance ratio is equal to the first resistance ratio, the USB port is connected to an external power supply and the lithium battery is charging; when the current resistance ratio is equal to the second resistance ratio, the lithium battery charging is complete; when the current resistance ratio is equal to the third resistance ratio, the lithium battery is in an overvoltage or undervoltage fault state.
[0045] In summary, the present invention discloses a charging state detection circuit and method of a single IO port based on dynamic voltage, which has the beneficial effect that several charging state detections of a charging chip can be realized only through a single IO of an MCU module, saving IO resources and effectively reducing costs and development time. Furthermore, by reducing the resources occupied by the IO port, there is no need to replace the MCU chip with a larger number of pins to achieve the same function, reducing the module size, thereby laying a technical foundation for module miniaturization and standardization.
[0046] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A charging status detection circuit for a single IO port based on dynamic voltage, characterized in that: include: Charging module, status monitoring module and MCU module; The chip power supply terminal of the charging module is used to connect to the external charging terminal, the voltage output terminal of the charging module is used to connect to the positive electrode of the lithium battery, the state indication terminal of the charging module is connected to the state monitoring module, and the charging module is used to adjust the conduction relationship of the state indication terminal according to the charging state of the lithium battery, so as to adjust the voltage value output by the state monitoring module; The state monitoring module is connected to the positive electrode of the lithium battery, and is used to receive the conduction signal at the state indication end of the charging module, and perform voltage division sampling on the voltage value at the positive electrode of the lithium battery, and input the sampled voltage to the state detection end of the MCU module; The state detection end of the MCU module is connected to the state monitoring module, and is used to obtain a voltage ratio according to the sampled voltage and the power supply voltage, obtain a current resistance ratio according to the voltage ratio, and determine the charging state of the charging module according to the current resistance ratio and a preset resistance ratio.
2. The charging state detection circuit of a single IO port based on dynamic voltage as claimed in claim 1, characterized in that: It also includes a switch module, a first end of the switch module is connected to the external charging end, a second end of the switch module is connected to the status monitoring module, and a third end of the switch module is grounded. The switch module is used to detect whether the chip power supply end of the charging module is connected to the power supply.
3. The charging state detection circuit of a single IO port based on dynamic voltage as claimed in claim 2, characterized in that: The charging module includes: a first charging chip; the first charging chip has a chip power supply terminal, a first status indication terminal and a second status indication terminal, the chip power supply terminal of the first charging chip is connected to the external charging terminal, and the first status indication terminal and the second status indication terminal are connected to the status monitoring module.
4. The charging state detection circuit of a single IO port based on dynamic voltage as claimed in claim 3, characterized in that: The status monitoring module includes a first resistor, a second resistor, a third resistor and a fourth resistor, one end of the first resistor is connected to the first status indication end of the first charging chip, one end of the second resistor is connected to the second status indication end of the first charging chip, one end of the third resistor is connected to the positive electrode of the lithium battery, the other end of the first resistor, the other end of the second resistor and the other end of the third resistor are respectively connected to the MCU module and one end of the fourth resistor, and the other end of the fourth resistor is connected to the switch module.
5. The charging state detection circuit of a single IO port based on dynamic voltage as claimed in claim 3, characterized in that: The first charging chip is a linear lithium battery charging IC.
6. The charging state detection circuit of a single IO port based on dynamic voltage as claimed in claim 2, characterized in that: The switch module includes: a fifth resistor, a sixth resistor, and a first switch tube, one end of the fifth resistor is connected to the external charging end, the other end of the fifth resistor is respectively connected to the gate of the switch tube and the common end of the sixth resistor, the emitter of the first switch tube is connected to the state monitoring module, and the source of the first switch tube and the other end of the sixth resistor are grounded.
7. The charging state detection circuit of a single IO port based on dynamic voltage as claimed in claim 4, characterized in that: The charging module includes: a first charging chip, the first charging chip having a chip power supply terminal and a first status indication terminal, the chip power supply terminal of the first charging chip is respectively connected to the status monitoring module and the USB charging terminal, the first status indication terminal of the first charging chip is connected to one end of the first resistor, and the other end of the first resistor is connected to the status monitoring module.
8. The charging state detection circuit of a single IO port based on dynamic voltage as claimed in claim 1, characterized in that: It also includes an absorption module, which includes a seventh resistor and a first capacitor, one end of the seventh resistor is connected to the external charging end, the other end of the seventh resistor is connected to one end of the first capacitor, and the other end of the first capacitor is grounded.
9. The charging state detection circuit of a single IO port based on dynamic voltage as claimed in claim 1, characterized in that: The MCU module includes: a microcontroller chip, a state detection terminal of the microcontroller chip is connected to the state monitoring module, and a power port VDD is connected to the positive electrode of the lithium battery; the microcontroller chip is pre-burned with a number of preset resistance ratios, which are used to obtain a voltage ratio according to the sampled voltage and the power supply voltage, obtain a current resistance ratio according to the voltage ratio, and determine the charging state of the charging module according to the current resistance ratio and the preset resistance ratio.
10. A detection method for a charging status detection circuit of a single IO port based on dynamic voltage according to any one of claims 1 to 9, characterized in that: The following steps are involved: The MCU module detects the lithium battery voltage and obtains the voltage value at the status detection terminal of the MCU module; Based on the lithium battery voltage and the sampled voltage at the state detection terminal of the MCU module, a voltage ratio between the two is calculated, and the voltage ratio corresponds to the resistance ratio; The charging state of the charging module is determined according to the current resistance ratio and the preset resistance ratio.