IO interface circuit, control method and chip

By designing an IO interface circuit that can be reused on time, the problem of tight IO interface resources in the electronic system has been solved, and it has realized that the same IO interface has the touch of the touch capacitor value measurement and the LED light control function at the same time. Integration and reduction of costs.

CN118900124BActive Publication Date: 2025-01-28HANGZHOU OCTOPUS MICROELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411375567.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-28
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

In the prior art, electronic systems require a large number of IO interfaces to realize touch capacitance measurement and LED light control functions, resulting in tight IO interface resources, complex circuit layout and high cost.

Method used

Design a type of IO interface circuit, to achieve the current driver unit and the touch capacitor measurement unit through the timing control unit and the touch capacitor measurement unit. The current drive unit controls the brightness of the LED light through the pulse width. Capacity.

Benefits of technology

The same IO interface has the same IO interface with the touch -key capacitance measurement function and the light control function of the LED light, which solves the problem of tightness of the IO interface resources, improves functional integration and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118900124B_ABST
    Figure CN118900124B_ABST
Patent Text Reader

Abstract

The present application provides an IO interface circuit, a control method and a chip, which relates to the field of electronic technology. The circuit includes: a timing control unit, a current driving unit, and a touch capacitance measuring unit, wherein the timing control unit is used to provide a basic clock pulse signal to the current driving unit, and the current driving unit is used to perform pulse width modulation on the basic clock pulse signal and obtain a target driving current, and the target driving current is used to drive an external LED lamp; the touch capacitance measuring unit is used to measure the capacitance value of a touch key, and the timing control unit is also used to control the measurement time of the capacitance value of the touch key by the touch capacitance measuring unit; the timing control unit is used to control the target IO interface through a channel selector to realize the measurement function of the capacitance value of the touch key and the light control function of the LED lamp in time-sharing. The implementation of the technical solution of the present application achieves the effect of improving the functional integration of the IO interface circuit and reducing the cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to an IO interface circuit, a control method and a chip. Background Art

[0002] At present, the touch capacitance measurement function and LED light control function are widely used in electronic systems. Some electronic systems require a large number of touch capacitance measurement channels and a large number of LED lights to be controlled. For example, in an electronic lock, the touch keyboard contains at least 12 touch channels and 12 LED lights. In the related art, if each LED light is to be individually controllable, 24 independent IO interfaces are required to realize the above functions, resulting in a shortage of IO interface resources, which is very difficult for circuit layout, cost control, and reducing the size of the microcontroller. Summary of the invention

[0003] The purpose of this application is to overcome the above-mentioned technical problems. This application provides an IO interface circuit, a control method and a chip.

[0004] In a first aspect, the present application provides an IO interface circuit, comprising: a timing control unit, a current driving unit, and a touch capacitance measuring unit, wherein the current driving unit is electrically connected to the timing control unit, the timing control unit is used to provide a basic clock pulse signal to the current driving unit, the current driving unit is used to perform pulse width modulation on the basic clock pulse signal and obtain a target driving current, wherein the target driving current is used to drive an external LED lamp; the touch capacitance measuring unit is electrically connected to the timing control unit, the touch capacitance measuring unit is used to measure the capacitance value of a touch key, and the timing control unit is also used to control the measurement time of the capacitance value of the touch key measured by the touch capacitance measuring unit; the LED lamp is connected between the target IO interface and the ground terminal, the touch key is electrically connected to the target IO interface, the timing control unit includes a channel selector, the output end of the current driving unit is electrically connected to the channel selector, the channel selector is also electrically connected to the input end of the touch capacitance measuring unit, and the target IO interface is also electrically connected to the channel selector, wherein the timing control unit is also used to control the target IO interface through the channel selector to realize the measurement function of the capacitance value of the touch key and the light control function of the LED lamp in time sharing.

[0005] By adopting the above technical solution, the IO interface circuit can control the time-sharing multiplexing of the current driving unit and the touch capacitance measuring unit through the timing control unit. The current driving unit obtains the target driving current by pulse width modulation of the basic clock pulse signal to accurately control the brightness of the LED lamp; the touch capacitance measuring unit measures the capacitance value of the touch button under the control of the timing control unit, making the touch control more sensitive and accurate. Thus, the touch button capacitance value measurement function and the LED lamp light control function are simultaneously provided on the same IO interface, that is, the touch capacitance measurement function and the light control function are integrated together, which can be realized with only one IO interface, solving the problems of tight IO interface resources, complex circuit layout and high cost in related technologies, and achieving the effect of improving the functional integration of IO interface circuits and reducing costs.

[0006] Optionally, the timing control unit is used to control the target IO interface to implement the measurement function and the light control function in the following manner: control the channel selector to enable the touch capacitance measurement unit in the first time window of the preset period, and the target IO interface is used to implement the measurement function within the first time window; control the channel selector to enable the current driving unit in the second time window of the preset period, and the target IO interface is used to implement the light control function within the second time window, wherein the sum of the duration corresponding to the first time window and the duration corresponding to the second time window is equal to the preset period.

[0007] By adopting the above technical solution, the timing control unit can control the function switching of the target IO interface in time-sharing according to the preset period. Specifically, in the first time window, the touch capacitance measurement unit is selected to realize the measurement function of the touch button capacitance value; in the second time window, the current driving unit is selected to realize the light control function of the LED lamp. The sum of the time of the first time window and the second time window is equal to the preset period, thereby effectively realizing the efficient time-sharing multiplexing of the touch button measurement and LED lamp driving functions. This technical solution realizes the two functions of measurement and light control by time-sharing multiplexing an IO interface, which significantly improves the utilization rate of hardware resources and reduces system costs. Due to the use of precise timing control, each functional module works independently in its own time window without interfering with each other, thereby improving the stability and reliability of the system.

[0008] Optionally, the current driving unit includes: a pulse width regulation circuit, a negative feedback amplifier circuit, and a current proportional amplifier circuit, wherein the input end of the pulse width regulation circuit is electrically connected to the timing control unit, and the pulse width regulation circuit is used to perform pulse width modulation on the basic clock pulse signal to obtain a target pulse signal; the output end of the pulse width regulation circuit is electrically connected to the input end of the negative feedback amplifier circuit, and the negative feedback amplifier circuit is used to generate a constant current output; the output end of the negative feedback amplifier circuit is electrically connected to the input end of the current proportional amplifier circuit, and the output end of the current proportional amplifier circuit is electrically connected to the target IO interface.

[0009] By adopting the above technical solution, the pulse width modulation circuit performs pulse width modulation on the received basic clock pulse signal to generate a target pulse signal; the negative feedback amplifier circuit generates a constant current output based on the target pulse signal; the current proportional amplifier circuit further amplifies the constant current to ensure that the target IO interface outputs a stable and adjustable target drive current, thereby achieving the purpose of effectively driving the LED lamp. Through the pulse width modulation circuit, the negative feedback amplifier circuit, and the current proportional amplifier circuit, the purpose of flexibly adjusting the target drive current is achieved. This flexibility allows the current drive unit to be widely used in various electronic devices and systems, and has a certain scalability to support future functional upgrades and expansions.

[0010] Optionally, the current driving unit further includes a filtering circuit, wherein the output end of the pulse width modulation circuit is electrically connected to the input end of the negative feedback amplifier circuit through the filtering circuit, and the filtering circuit is used to filter the target pulse signal.

[0011] By adopting the above technical solution, the application of the filtering circuit enables the target pulse signal output by the pulse width modulation circuit to be effectively filtered before being transmitted to the negative feedback amplifier circuit, thereby improving the stability of the target driving current output by the current driving unit, ensuring that the brightness of the LED lamp is more uniform and reducing electromagnetic interference.

[0012] Optionally, the filtering circuit includes a first group of capacitors, a first group of switches and a first resistor, the negative feedback amplifier circuit includes a first operational amplifier, a first NMOS tube, a second resistor and a third resistor, and the current proportional amplifier circuit includes a first PMOS tube, a second PMOS tube, a fourth resistor and a fifth resistor, wherein the output end of the pulse width modulation circuit is electrically connected to the in-phase input end of the first operational amplifier through the first resistor, and each capacitor in the first group of capacitors is connected in series with a switch and then connected between the in-phase input end and the ground end of the first operational amplifier, wherein each capacitor in the first group of capacitors corresponds to a switch in the first group of switches; the output end of the first operational amplifier is electrically connected to the first NM The gate of the OS tube is electrically connected, the source of the first NMOS tube is electrically connected to the ground terminal through the second resistor, and the source of the first NMOS tube is also electrically connected to the inverting input terminal of the first operational amplifier through the third resistor; the source of the first PMOS tube is electrically connected to the power supply terminal through the fourth resistor, the source of the second PMOS tube is electrically connected to the power supply terminal through the fifth resistor, the gate of the first PMOS tube is electrically connected to the gate of the second PMOS tube, the drain of the second PMOS tube is electrically connected to the gate of the second PMOS tube, the drain of the second PMOS tube is also electrically connected to the drain of the first NMOS tube, and the drain of the first PMOS tube is electrically connected to the target IO interface.

[0013] By adopting the above technical solution, the filter circuit includes a first group of capacitors, a first group of switches and a first resistor, the negative feedback amplifier circuit includes a first operational amplifier, a first NMOS tube, a second resistor and a third resistor, and the current proportional amplifier circuit includes a first PMOS tube, a second PMOS tube, a fourth resistor and a fifth resistor. The filter circuit can filter the target pulse signal generated by the pulse width modulation circuit, improve the purity of the signal, and thus improve the stability of the target drive current output by the current drive unit. The negative feedback amplifier circuit realizes the output of constant current through the first NMOS tube, the second resistor and the third resistor, ensuring the accuracy and stability of the output current. The current proportional amplifier circuit adjusts the ratio of the output current through the first PMOS tube and the second PMOS tube, thereby realizing precise control of the LED lamp.

[0014] Optionally, the touch capacitance measurement unit includes: a sampling circuit, a conversion circuit, a first switch and a second switch, wherein the target IO interface is electrically connected to the power supply end through the first switch, and the sampling circuit is electrically connected to the target IO interface through the second switch, wherein the sampling circuit is used to sample the charge at both ends of the capacitor corresponding to the touch button to obtain a target charge; the sampling circuit is electrically connected to the conversion circuit, and the sampling circuit is also used to convert the target charge into a target voltage value through the conversion circuit, and the conversion circuit is used to output the target voltage value, wherein the capacitance value of the touch button is calculated based on the target voltage value.

[0015] By adopting the above technical solution, the touch capacitance measurement unit can efficiently sample the charge at both ends of the capacitor corresponding to the touch key and convert it into a target voltage value, thereby accurately calculating the capacitance value of the touch key. This technical solution improves the accuracy and response speed of touch key detection.

[0016] Optionally, the touch capacitance measurement unit also includes: a parameter fine-tuning circuit module and a third switch, wherein the parameter fine-tuning circuit module is electrically connected to the target IO interface through the third switch, the parameter fine-tuning circuit module includes a second group of capacitors and a second group of switches, each capacitor in the second group of capacitors is connected in series with a corresponding switch in the second group of switches and is connected between one end of the third switch and the ground terminal, and the other end of the third switch is electrically connected to the target IO interface, wherein each capacitor in the second group of capacitors corresponds to a switch in the second group of switches; the parameter fine-tuning circuit module adjusts the target charge by controlling whether each capacitor in the second group of capacitors is connected to the circuit.

[0017] By adopting the above technical solution and introducing a parameter fine-tuning circuit module, the target charge amount can be precisely adjusted. The module controls whether each capacitor in the second group of capacitors is connected to the circuit, thereby changing the capacitance value distribution of the entire circuit, and then fine-tuning the measurement result. This fine-tuning mechanism helps to eliminate or reduce measurement errors caused by manufacturing deviations, environmental factors, etc., and improve the accuracy and stability of capacitance value measurement. The parameter fine-tuning circuit module adjusts the target charge amount by controlling whether each capacitor in the second group of capacitors is connected to the circuit, thereby improving the accuracy and flexibility of touch key capacitance value measurement.

[0018] Optionally, the sampling circuit includes a first capacitor, a fourth switch and a fifth switch, and the conversion circuit includes a second operational amplifier, a second capacitor and a third capacitor, wherein the target IO interface is electrically connected to the first end of the first capacitor through the second switch, the second end of the first capacitor is electrically connected to the ground through the fourth switch, and the second end of the first capacitor is also connected to the reference voltage through the fifth switch; the first end of the first capacitor is electrically connected to the inverting input of the second operational amplifier through the second capacitor, the non-inverting input of the second operational amplifier is electrically connected to the reference voltage, and the third capacitor is connected between the inverting input of the second operational amplifier and the output of the second operational amplifier, wherein the output of the second operational amplifier is used to output the target voltage value; the touch capacitance measurement unit also includes: a sixth switch, a seventh switch, an eighth switch and a ninth switch, wherein the sixth switch is arranged between the target IO interface and the ground, the seventh switch is arranged between the first end of the first capacitor and the ground, the eighth switch is arranged between the inverting input of the second operational amplifier and the ground, and the ninth switch is arranged between the output of the second operational amplifier and the ground.

[0019] By adopting the above technical solution, the sampling circuit can accurately sample the amount of charge at both ends of the capacitor corresponding to the touch key, and convert the charge into a target voltage value, thereby improving the accuracy of the touch key capacitance value measurement. Specifically, the first capacitor cooperates with the fourth switch and the fifth switch to store and release the charge under different working conditions to ensure the accuracy of the sampling process. The second operational amplifier and its related second capacitor and third capacitor play a voltage conversion role in the conversion circuit, while ensuring the stability of the output voltage. In addition, by introducing the sixth switch to the ninth switch, the residual charge of the circuit can be quickly discharged, so that the circuit can quickly return to its initial state and prepare for the next measurement.

[0020] In the second aspect, the present application also provides a control method for an IO interface circuit, which is applied to any of the IO interface circuits of the aforementioned items, including: obtaining a preset first time value and a preset second time value, wherein the first time value is used to indicate the duration of controlling the target IO interface to implement a measurement function, and the second time value is used to indicate the duration of controlling the target IO interface to implement a light control function; controlling the target IO interface to implement the measurement function and the light control function in the following manner: controlling the channel selector to enable the touch capacitance measurement unit in a first time window of a preset period, and the target IO interface is used to implement the measurement function within the first time window; controlling the channel selector to enable the current driving unit in a second time window of a preset period, and the target IO interface is used to implement the light control function within the second time window, wherein the sum of the duration corresponding to the first time window and the duration corresponding to the second time window is equal to the preset period.

[0021] By adopting the above technical solution, the control method can effectively realize the IO interface circuit to perform touch button capacitance value measurement and LED lamp drive control in a preset period in a time-sharing manner, thereby efficiently switching different functions on the same IO interface, improving the utilization rate of the IO interface, and ensuring the accuracy of touch button measurement and the stability of LED lamp drive.

[0022] In a third aspect, the present application also provides a chip comprising any of the aforementioned IO interface circuits.

[0023] By adopting the above technical solution, the chip integrates the IO interface circuit, which can coordinate the capacitance measurement function of the touch button and the light control function of the LED lamp through the timing control unit, realize time-sharing multiplexing on the same IO interface, and improve the utilization rate of the IO interface.

[0024] In summary, one or more technical solutions provided in this application have at least the following technical effects or advantages:

[0025] 1. The touch button capacitance measurement function and the LED light control function are realized on the same IO interface, that is, the touch capacitance measurement function and the light control function are integrated together, which can be realized with only one IO interface, solving the problems of tight IO interface resources, complex circuit layout and high cost in related technologies, and achieving the effect of improving the integration of IO interface circuit functions and reducing costs;

[0026] 2. By time-division multiplexing one IO interface to realize the two functions of measurement and lighting control, the utilization rate of hardware resources is significantly improved and the system cost is reduced; due to the use of precise timing control, each functional module works independently within its own time window without interfering with each other, thus improving the stability and reliability of the system;

[0027] 3. Through the pulse width modulation circuit, negative feedback amplifier circuit and current proportional amplifier circuit, the purpose of flexibly adjusting the target driving current is achieved. This flexibility enables the current driving unit to be widely used in various electronic devices and systems, and has a certain scalability to support future functional upgrades and expansions;

[0028] 4. By introducing the parameter fine-tuning circuit module, it helps to eliminate or reduce the measurement errors caused by manufacturing deviations, environmental factors, etc., and improve the accuracy and stability of touch button capacitance value measurement. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a framework diagram of an IO interface circuit provided in an embodiment of the present application;

[0030] Figure 2 This is a flow chart of a control method for an IO interface circuit provided in an embodiment of the present application;

[0031] Figure 3 This is a specific IO interface circuit structure block diagram provided in an embodiment of the present application;

[0032] Figure 4 This is a circuit structure block diagram of a current driving unit provided in an embodiment of the present application;

[0033] Figure 5 This is a circuit structure block diagram of a touch capacitance measurement unit provided in an embodiment of the present application;

[0034] Figure 6 It is a flow chart of a timing control provided by an embodiment of the present application;

[0035] Figure 7 This is an example diagram of a timing control provided in an embodiment of the present application.

[0036] Description of reference numerals:

[0037] The first resistor R1, the second resistor R2, the third resistor R3, the fourth resistor R4, the fifth resistor R5, the first NMOS tube N1, the first PMOS tube P1, the second PMOS tube P2, the first group of capacitors C_Group1, the first group of switches SW_Group1, the first operational amplifier A1, the second operational amplifier A2, the system voltage Vsys, the second group of capacitors C_Group2, the second group of switches SW_Group2, the first switch SW1, the second switch SW2, the third switch SW3, the fourth switch SW4, the fifth switch SW5, the sixth switch SW6, the seventh switch SW7, the eighth switch SW8, the ninth switch SW9, the first capacitor C1, the second capacitor C2, the third capacitor C3, the touch button capacitor Cpad, the equivalent capacitor Ceff, the reference voltage Vref. DETAILED DESCRIPTION

[0038] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0039] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.

[0040] In the description of the embodiments of the present application, the term "plurality" means two or more. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0041] The following is combined with Figure 1-Figure 7 The embodiments of the present application are described in detail.

[0042] The present application provides an IO interface circuit, referring to Figure 1 , Figure 1 is a framework diagram of an IO interface circuit provided in an embodiment of the present application, the circuit comprising: a timing control unit, a current driving unit, and a touch capacitance measuring unit, wherein:

[0043] The current driving unit is electrically connected to the timing control unit, the timing control unit is used to provide a basic clock pulse signal to the current driving unit, the current driving unit is used to perform pulse width modulation on the basic clock pulse signal and obtain a target driving current, wherein the target driving current is used to drive an external LED lamp;

[0044] The touch capacitance measuring unit is electrically connected to the timing control unit, the touch capacitance measuring unit is used to measure the capacitance value of the touch key, and the timing control unit is also used to control the measurement time of the touch capacitance measuring unit measuring the capacitance value of the touch key;

[0045] The LED lamp is connected between the target IO interface and the ground terminal, the touch button is electrically connected to the target IO interface, the timing control unit includes a channel selector, the output end of the current driving unit is electrically connected to the channel selector, the channel selector is also electrically connected to the input end of the touch capacitance measuring unit, and the target IO interface is also electrically connected to the channel selector, wherein the timing control unit is also used to control the target IO interface through the channel selector to realize the measurement function of the capacitance value of the touch button and the light control function of the LED lamp in a time-sharing manner.

[0046] In the above embodiment, the timing control unit provides a basic clock pulse signal, and the current driving unit and the touch capacitance measuring unit are time-divided through the channel selector in the timing control unit, wherein the current driving unit performs pulse width modulation on the basic clock pulse signal to obtain the target driving current to drive the LED lamp, and the touch capacitance measuring unit measures the capacitance value of the touch key, and the touch capacitance measuring unit is mainly used to detect the user's touch operation, and to determine whether the key is pressed by measuring the change of the touch capacitance; and the current driving unit is mainly used to drive the LED lamp, and the brightness of the LED lamp is controlled by pulse width modulation; so that the target IO interface can realize the measurement function of the capacitance value of the touch key and the light control function of the LED, etc. in time-divided. The IO interface circuit can control the time-divided multiplexing of the current driving unit and the touch capacitance measuring unit through the timing control unit, and the current driving unit obtains the target driving current by performing pulse width modulation on the basic clock pulse signal to accurately control the brightness of the LED lamp; the touch capacitance measuring unit measures the capacitance value of the touch key under the control of the timing control unit, so that the touch control is more sensitive and accurate. Thus, the touch button capacitance value measurement function and the LED light control function are simultaneously realized on the same IO interface, that is, the touch capacitance measurement function and the light control function are integrated together, which can be realized with only one IO interface, solving the problems of tight IO interface resources, complex circuit layout and high cost in related technologies, and achieving the effect of improving the integration of IO interface circuit functions and reducing costs. For example, electronic locks require multiple touch channels and LED light application scenarios, and the methods in related technologies require a large number of independent IO interfaces, which not only increases the complexity of hardware design, but also increases the manufacturing cost and controller size, achieving the purpose of reducing the size of the microcontroller and reducing the difficulty of circuit layout.

[0047] In this embodiment, by designing an IO interface circuit that integrates a timing control unit, a current driving unit, and a touch capacitance measurement unit, the functions of time-division multiplexing of touch capacitance measurement and LED light control on a single IO interface are realized, which significantly reduces the number of IO interfaces required. For example, the function that originally required 24 independent IO interfaces to achieve now only requires 12 such multifunctional IO interface circuits to achieve, thereby greatly simplifying the circuit design and reducing the hardware cost. The current driving unit can flexibly adjust the size of the output target drive current by performing pulse width modulation (PWM) on the basic clock pulse signal, thereby realizing dynamic control of the brightness of the LED light, which solves the problem of limited LED brightness adjustment in the traditional method and improves the user experience and system flexibility. The timing control unit can accurately control the timing of touch capacitance measurement and LED light control, avoids conflicts between the two, and ensures efficient operation and rapid response of the system; at the same time, the application of the channel selector enables the circuit to quickly switch between the measurement function and the light control function, thereby improving the overall performance of the system. Due to the reduction in the demand for IO interfaces, the layout of the entire circuit can be more compact, the wiring difficulty is reduced, and it is conducive to reducing the size of the controller and reducing the manufacturing cost. In addition, this integrated design also improves the reliability and maintainability of the system.

[0048] In an optional embodiment, the timing control unit is used to control the target IO interface to implement the measurement function and the light control function in the following manner: control the channel selector to enable the touch capacitance measurement unit in the first time window of the preset period, and the target IO interface is used to implement the measurement function within the first time window; control the channel selector to enable the current driving unit in the second time window of the preset period, and the target IO interface is used to implement the light control function within the second time window, wherein the sum of the duration corresponding to the first time window and the duration corresponding to the second time window is equal to the preset period.

[0049] In the above embodiment, the timing control unit can control the function switching of the target IO interface in time-sharing according to the preset cycle. Specifically, in the first time window, the touch capacitance measurement unit is selected to realize the measurement function of the touch button capacitance value; in the second time window, the current driving unit is selected to realize the light control function of the LED lamp. The sum of the time of the first time window and the second time window is equal to the preset cycle, thereby effectively realizing the efficient time-sharing multiplexing of the touch button measurement and LED lamp driving functions. How does the interface circuit realize two different functions: measurement function and light control function through the timing control unit? In the case of limited hardware resources, especially when the IO interface resources are tight, how to effectively reuse the same IO interface to realize multiple functions without increasing additional hardware costs. The practice in the related art may require the allocation of independent IO interfaces for each function, which will increase the complexity and cost of the hardware. The embodiment of the present application realizes the two functions of measurement and light control by time-sharing multiplexing of an IO interface, which significantly improves the utilization rate of hardware resources and reduces the system cost. The timing control unit can accurately control the channel selector to select different functional modules (touch capacitance measurement unit or current driving unit) in different time windows, thereby realizing flexible switching between functions and avoiding functional conflicts. Due to the precise timing control, each functional module works independently in its own time window without interfering with each other, thus improving the stability and reliability of the system. The reuse of hardware functions is achieved through software control (timing control unit), which simplifies the hardware design and makes the system more compact and easy to maintain.

[0050] In an optional embodiment, the current driving unit includes: a pulse width regulation circuit, a negative feedback amplifier circuit, and a current proportional amplifier circuit, wherein the input end of the pulse width regulation circuit is electrically connected to the timing control unit, and the pulse width regulation circuit is used to perform pulse width modulation on the basic clock pulse signal to obtain a target pulse signal; the output end of the pulse width regulation circuit is electrically connected to the input end of the negative feedback amplifier circuit, and the negative feedback amplifier circuit is used to generate a constant current output; the output end of the negative feedback amplifier circuit is electrically connected to the input end of the current proportional amplifier circuit, and the output end of the current proportional amplifier circuit is electrically connected to the target IO interface.

[0051] In the above embodiment, the pulse width modulation circuit performs pulse width modulation on the received basic clock pulse signal to generate a target pulse signal; the negative feedback amplifier circuit generates a constant current output based on the target pulse signal; the current ratio amplifier circuit further amplifies the constant current to ensure that the target IO interface outputs a stable and adjustable target drive current, thereby achieving the purpose of effectively driving the LED lamp. By performing pulse width modulation on the basic clock pulse signal through the pulse width modulation circuit, the duty cycle of the target pulse signal can be flexibly adjusted, and the fast response characteristics of the pulse width modulation circuit enable the current drive unit to quickly respond to changes in the control signal and achieve rapid adjustment of the current. The design of the negative feedback amplifier circuit enables the current drive unit to have good stability and reliability, and the negative feedback mechanism can automatically correct the deviation in the output current to ensure the stability of the current output, thereby generating an accurate constant current output through the negative feedback amplifier circuit. The design of the current ratio amplifier circuit enables the current drive unit to adjust the ratio of the output target drive current as needed, thereby adapting to the needs of different loads, and the output end of the current ratio amplifier circuit outputs the target drive current. Through the pulse width modulation circuit, negative feedback amplifier circuit, and current proportional amplifier circuit, the purpose of flexibly adjusting the target drive current is achieved. This flexibility enables the current drive unit to be widely used in various electronic devices and systems, and has a certain scalability to support future functional upgrades and expansions. This design enables the current drive unit to achieve precise control of the output target drive current to meet the needs of various application scenarios.

[0052] In an optional embodiment, the current driving unit further includes a filtering circuit, wherein the output end of the pulse width modulation circuit is electrically connected to the input end of the negative feedback amplifier circuit through the filtering circuit, and the filtering circuit is used to filter the target pulse signal.

[0053] In the above embodiment, the target pulse signal output by the pulse width modulation circuit may be interfered by noise from the power supply, ground or other circuits during transmission. These noise interferences may cause the negative feedback amplifier circuit to receive unstable signals, thereby affecting the stability and accuracy of the current output; if the noise signal is directly transmitted to the negative feedback amplifier circuit, it may damage the sensitive components (such as transistors, operational amplifiers, etc.) in the amplifier circuit, reducing the overall reliability and life of the circuit. The filter circuit can effectively filter out high-frequency noise and clutter in the target pulse signal, making the signal purer and more stable. This helps to ensure that the negative feedback amplifier circuit receives high-quality signals, thereby improving the accuracy and stability of the current output. By suppressing the noise signal, the filter circuit can protect the sensitive components in the negative feedback amplifier circuit from damage and extend the service life of the circuit. The application of the filter circuit enables the target pulse signal output by the pulse width modulation circuit to be effectively filtered before being transmitted to the negative feedback amplifier circuit, thereby improving the stability of the target drive current output by the current drive unit, ensuring that the brightness of the LED lamp is more uniform, and reducing electromagnetic interference.

[0054] In an optional embodiment, if Figure 4 As shown, the filtering circuit includes a first group of capacitors C_Group1, a first group of switches SW_Group1 and a first resistor R1, the negative feedback amplifier circuit includes a first operational amplifier A1, a first NMOS tube N1, a second resistor R2 and a third resistor R3, and the current proportional amplifier circuit includes a first PMOS tube P1, a second PMOS tube P2, a fourth resistor R4 and a fifth resistor R5, wherein the output end of the pulse width modulation circuit is electrically connected to the in-phase input end of the first operational amplifier A1 through the first resistor R1, and each capacitor in the first group of capacitors C_Group1 is connected in series with a switch and then connected between the in-phase input end of the first operational amplifier A1 and the ground end, wherein each capacitor in the first group of capacitors C_Group1 corresponds to a switch in the first group of switches SW_Group1; An output end of an operational amplifier A1 is electrically connected to a gate of a first NMOS transistor N1, a source of the first NMOS transistor N1 is electrically connected to a ground terminal through a second resistor R2, and a source of the first NMOS transistor N1 is also electrically connected to an inverting input terminal of the first operational amplifier A1 through a third resistor R3; a source of a first PMOS transistor P1 is electrically connected to a power supply terminal through a fourth resistor R4, a source of a second PMOS transistor P2 is electrically connected to a power supply terminal through a fifth resistor R5, a gate of the first PMOS transistor P1 is electrically connected to a gate of the second PMOS transistor P2, a drain of the second PMOS transistor P2 is electrically connected to a gate of the second PMOS transistor P2, a drain of the second PMOS transistor P2 is also electrically connected to a drain of the first NMOS transistor N1, and a drain of the first PMOS transistor P1 is electrically connected to a target IO interface.

[0055] In the above embodiment, the filter circuit includes a first group of capacitors C_Group1, a first group of switches SW_Group1 and a first resistor R1, the negative feedback amplifier circuit includes a first operational amplifier A1, a first NMOS tube N1, a second resistor R2 and a third resistor R3, and the current ratio amplifier circuit includes a first PMOS tube P1, a second PMOS tube P2, a fourth resistor R4 and a fifth resistor R5. The filter circuit can filter the target pulse signal generated by the pulse width modulation circuit, improve the purity of the signal, and thus improve the stability of the output current of the current drive unit. The negative feedback amplifier circuit realizes the output of a constant current through the first NMOS tube N1, the second resistor R2 and the third resistor R3, ensuring the accuracy and stability of the output current. The current ratio amplifier circuit adjusts the ratio of the output current through the first PMOS tube P1 and the second PMOS tube P2, thereby realizing precise control of the LED lamp. Through reasonable component selection and circuit design, such as using MOS tubes as current control elements and limiting the current size through resistors, the risks of circuit overload and component damage are effectively prevented, and the reliability and durability of the circuit are improved. The IO interface circuit solves technical problems such as signal filtering, current stability control and precise regulation by introducing filtering circuits, negative feedback amplifier circuits and current proportional amplifier circuits, and achieves positive effects such as improving signal quality, enhancing current control capability, and improving system stability and reliability.

[0056] In an optional embodiment, if Figure 5 As shown, the touch capacitance measuring unit includes: a sampling circuit, a conversion circuit, a first switch SW1 and a second switch SW2, wherein the target IO interface is electrically connected to the power supply end through the first switch SW1, and the sampling circuit is electrically connected to the target IO interface through the second switch SW2, wherein the sampling circuit is used to sample the charge amount at both ends of the capacitor corresponding to the touch key to obtain the target charge amount; the sampling circuit is electrically connected to the conversion circuit, and the sampling circuit is also used to convert the target charge amount into a target voltage value through the conversion circuit, and the conversion circuit is used to output the target voltage value, wherein the capacitance value of the touch key is calculated based on the target voltage value.

[0057] In the above embodiments, in a touch screen or an electronic device with a touch button, accurately measuring the capacitance value corresponding to the touch button is the key to achieving accurate touch detection and response. In order to improve the touch response speed and accuracy, it is necessary to efficiently and accurately collect the charge of the capacitance corresponding to the touch button and convert it into a voltage value that is easy to process. By using a sampling circuit to accurately sample the charge at both ends of the capacitance corresponding to the touch button, and using a conversion circuit to convert the sampled target charge into a target voltage value, this helps to improve the response speed and performance of the entire touch capacitance measurement unit, and can greatly improve the accuracy of capacitance value measurement. This method can effectively reduce the impact of environmental interference and circuit noise on the measurement results, thereby achieving more accurate touch detection. The touch capacitance measurement unit can efficiently sample the charge at both ends of the capacitance corresponding to the touch button and convert it into a target voltage value, thereby accurately calculating the capacitance value of the touch button. This technical solution improves the accuracy and response speed of touch button detection.

[0058] In an optional embodiment, if Figure 5 As shown, the touch capacitance measurement unit also includes: a parameter fine-tuning circuit module and a third switch SW3, wherein the parameter fine-tuning circuit module is electrically connected to the target IO interface through the third switch SW3, the parameter fine-tuning circuit module includes a second group of capacitors C_Group2 and a second group of switches SW_Group2, each capacitor in the second group of capacitors C_Group2 is connected in series with a corresponding switch in the second group of switches SW_Group2 and is connected between one end of the third switch SW3 and the ground terminal, and the other end of the third switch SW3 is electrically connected to the target IO interface, wherein each capacitor in the second group of capacitors C_Group2 corresponds to a switch in the second group of switches SW_Group2; the parameter fine-tuning circuit module adjusts the target charge by controlling whether each capacitor in the second group of capacitors C_Group2 is connected to the circuit.

[0059] In the above embodiments, in actual applications, due to the influence of factors such as manufacturing process, ambient temperature, humidity, etc., the capacitance value corresponding to the touch button may have a certain deviation or drift. This deviation or drift will directly affect the accuracy of the capacitance value measurement, and then affect the accuracy and stability of touch detection; the touch capacitance measurement amplifier in the related art often lacks a flexible adjustment mechanism, and cannot fine-tune the measurement parameters according to different application scenarios or requirements, which limits its applicability in different devices or environments. By introducing a parameter fine-tuning circuit module, the target charge amount can be accurately adjusted. The module controls whether each capacitor in the second group of capacitors C_Group2 is connected to the circuit, thereby changing the capacitance value distribution of the entire circuit, and then fine-tuning the measurement result. This fine-tuning mechanism helps to eliminate or reduce the measurement error caused by manufacturing deviations, environmental factors, etc., and improves the accuracy and stability of capacitance value measurement. The design of the parameter fine-tuning circuit module enables the touch capacitance measurement unit to be flexibly adjusted according to specific application scenarios or requirements. By adjusting the access status of the second group of capacitors C_Group2, the measurement range can be adjusted, the measurement accuracy can be optimized, etc., so as to meet the measurement requirements under different devices or environments. In addition, in practical applications, when multiple IO interfaces in a chip all use the IO interface circuit in the embodiment of the present application, the results of different IO interface detections may be different due to process reasons, resulting in poor consistency in the detection of different IO interfaces. By adjusting the parameter fine-tuning circuit module, the consistency of each IO interface can be improved. By improving the accuracy and stability of capacitance value measurement and enhancing the flexibility of measurement, the performance and reliability of touch detection can be significantly improved, which helps to improve the user experience and satisfaction when using electronic devices with touch buttons. The parameter fine-tuning circuit module adjusts the target charge by controlling whether each capacitor in the second group of capacitors C_Group2 is connected to the circuit, thereby improving the accuracy and flexibility of the touch button capacitance value measurement.

[0060] In an optional embodiment, if Figure 5As shown, the sampling circuit includes a first capacitor C1, a fourth switch SW4 and a fifth switch SW5, and the conversion circuit includes a second operational amplifier A2, a second capacitor C2 and a third capacitor C3, wherein the target IO interface is electrically connected to the first end of the first capacitor C1 through the second switch SW2, the second end of the first capacitor C1 is electrically connected to the ground terminal through the fourth switch SW4, and the second end of the first capacitor C1 is also connected to the reference voltage Vref through the fifth switch SW5; the first end of the first capacitor C1 is electrically connected to the inverting input terminal of the second operational amplifier A2 through the second capacitor C2, the non-inverting input terminal of the second operational amplifier A2 is electrically connected to the reference voltage Vref, and the The three capacitors C3 are connected between the inverting input terminal of the second operational amplifier A2 and the output terminal of the second operational amplifier A2, wherein the output terminal of the second operational amplifier A2 is used to output the target voltage value; the touch capacitance measurement unit also includes: a sixth switch SW6, a seventh switch SW7, an eighth switch SW8 and a ninth switch SW9, wherein the sixth switch SW6 is arranged between the target IO interface and the ground terminal, the seventh switch SW7 is arranged between the first terminal of the first capacitor C1 and the ground terminal, the eighth switch SW8 is arranged between the inverting input terminal of the second operational amplifier A2 and the ground terminal, and the ninth switch SW9 is arranged between the output terminal of the second operational amplifier A2 and the ground terminal.

[0061] In the above embodiment, the sampling circuit and the conversion circuit are used to accurately sample and convert the charge on the touch capacitor. The combination of the first capacitor C1, the fourth switch SW4 and the fifth switch SW5 allows the charge to be accurately collected during the sampling phase, and the charge is converted into a stable voltage value output through the conversion circuit composed of the second operational amplifier A2, the second capacitor C2 and the third capacitor C3; the sampling circuit can accurately sample the charge at both ends of the capacitor corresponding to the touch key, and convert the charge into a target voltage value, thereby improving the accuracy of the touch key capacitance value measurement. Specifically, the first capacitor C1 cooperates with the fourth switch SW4 and the fifth switch SW5 to store and release the charge under different working conditions, ensuring the accuracy of the sampling process. The second operational amplifier A2 and its related second capacitor C2 and third capacitor C3 play a voltage conversion role in the conversion circuit, while ensuring the stability of the output voltage. In addition, by introducing the sixth switch SW6 to the ninth switch SW9, the residual charge of the circuit can be quickly discharged, so that the circuit can quickly restore the initial state and prepare for the next measurement.

[0062] The present application also provides a control method for an IO interface circuit, which is applied to the IO interface circuit of any of the above embodiments. Figure 2 This is a flow chart of a control method of an IO interface circuit provided in an embodiment of the present application, and the process includes:

[0063] Step S201, obtaining a preset first time value and a preset second time value, wherein the first time value is used to indicate the duration of controlling the target IO interface to realize the measurement function, and the second time value is used to indicate the duration of controlling the target IO interface to realize the lighting control function;

[0064] Step S202, controlling the target IO interface to implement the measurement function and the light control function in the following manner: controlling the channel selector to select the touch capacitance measurement unit in the first time window of the preset period, and the target IO interface is used to implement the measurement function within the first time window; controlling the channel selector to select the current driving unit in the second time window of the preset period, and the target IO interface is used to implement the light control function within the second time window, wherein the sum of the duration corresponding to the first time window and the duration corresponding to the second time window is equal to the preset period.

[0065] In the above embodiment, by obtaining a first time value corresponding to the first time window duration of the touch capacitance measurement unit and a second time value corresponding to the second time window duration of the current driving unit, wherein the sum of the duration of the first time window and the duration of the second time window is equal to the preset period, the target IO interface is controlled to alternately implement the measurement function and the light control function in the first time window and the second time window within the preset period. The control method can effectively realize the IO interface circuit to perform the capacitance value measurement of the touch button and the drive control of the LED lamp in a time-sharing manner within the preset period, thereby efficiently switching different functions on the same IO interface, improving the utilization rate of the IO interface, and ensuring the accuracy of the touch button measurement and the stability of the LED lamp drive.

[0066] The present application also provides a chip, comprising any of the aforementioned IO interface circuits.

[0067] In this embodiment, the chip integrates an IO interface circuit, which can coordinate the capacitance measurement function of the touch button and the light control function of the LED lamp through the timing control unit, realize time-sharing multiplexing on the same IO interface, and improve the utilization rate of the IO interface. Specifically, the current driving unit realizes stable current output by pulse width modulation of the basic clock pulse signal, effectively driving the LED lamp; the touch capacitance measurement unit realizes accurate detection of touch operation by accurately measuring the capacitance value of the touch button, thereby improving the user experience and the interactive performance of the device. The chip in this embodiment may include one or more IO interface circuits in the aforementioned embodiments. For example, the chip may be an electronic lock chip or a chip in other electronic products. Each touch button corresponds to an IO interface (or IO pin), and the IO pin inside the chip corresponds to an IO interface circuit in the aforementioned embodiment.

[0068] It should be noted that the above-described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application will be described in detail below in conjunction with specific embodiments.

[0069] The embodiment of the present application provides a circuit implementation scheme of a novel LED light control and touch sensing interface unit. The circuit as a whole includes three components, namely, a current driving unit, a touch capacitance measuring unit and a timing control unit. Figure 3 shown.

[0070] Current drive unit:

[0071] The current driving unit generates a stable and continuous current and outputs it to the multiplexer MUX (corresponding to the aforementioned channel selector). The current driving unit performs pulse width modulation on the clock pulse signal from the timing control unit, and adjusts the output current by adjusting the pulse width, thereby achieving precise regulation of the output current.

[0072] Touch capacitance measurement unit:

[0073] It can realize accurate measurement of touch button capacitance. The unit also has the function of setting sensitivity level to meet the measurement requirements of different precision.

[0074] Timing control unit:

[0075] The basic pulse drive is generated according to the main frequency clock, and the channel gating of the port is allocated by the multiplexer under the timing control, so as to realize the multiplexing of the touch capacitance measurement function and the LED light control function.

[0076] This unit is also responsible for providing the basic clock pulse signal for pulse width modulation to the current drive unit;

[0077] In addition, the unit also provides measurement window timing logic for the touch capacitance measurement unit to achieve precise control of the measurement time window.

[0078] Figure 3 The PIN in the middle is an interface (or can be called a pin) that integrates the LED control function (corresponding to the aforementioned light control function) and the touch capacitance measurement function (corresponding to the aforementioned measurement function).

[0079] Each unit is described below.

[0080] 1. Current drive unit circuit implementation method

[0081] 1.1 Current drive unit circuit structure

[0082] The circuit structure of the current driving unit is as follows: Figure 4 shown.

[0083] 1.2 Functional principle of current drive unit

[0084] The first resistor R1, the first capacitor group C_Group1 and the first switch group SW_Group1 form a low-pass RC filter; the first capacitor group C_Group1 may include one or more capacitors, the first switch group SW_Group1 may include one or more switches, and each capacitor in the first capacitor group C_Group1 corresponds to each switch in the first switch group.

[0085] The first NMOS tube N1, the first operational amplifier A1, the second resistor R2, and the third resistor R3 form a negative feedback amplifier circuit for generating a constant current output; the second resistor R2 is used as a sampling resistor to feed back the feedback voltage to the negative terminal of the first operational amplifier A1, forming a negative feedback loop of the voltage. The third resistor R3 is connected in series to the negative feedback terminal of the first operational amplifier A1, playing the role of current suppression and buffering.

[0086] The first PMOS transistor P1, the second PMOS transistor P2, the fourth resistor R4, and the fifth resistor R5 form a current proportional amplifier circuit, which generates a constant driving current at the drain of the first PMOS transistor P1 and outputs it through the PIN pin (corresponding to the aforementioned target IO interface) to generate a constant current driving current for the external circuit. Figure 4 The medium system voltage Vsys is equivalent to the voltage of the aforementioned power supply terminal.

[0087] The specific principles and working process are as follows:

[0088] The input peak voltage Vin, which is pulse-width-modulated by the timing control unit, first passes through a low-pass filter formed by an RC network. After filtering, the input pulse signal is rectified into a DC voltage signal Vx, such as Figure 4 As shown. x With V in The proportional relationship is: V x =D·V in The proportional coefficient D is determined by the duty cycle of the pulse signal and the filter characteristics. The source current I S3 The approximate value is: S3 =V x / R2, that is, I S3 =D·V in / R2.

[0089] The first PMOS transistor P1, the second PMOS transistor P2, the fourth resistor R4, and the fifth resistor R5 form a current proportional amplifier circuit. Under the same process conditions, the process parameters of the two P-type MOS transistors are the same, that is, the same threshold voltage, mobility, and gate oxide capacitance. Then, under the condition of symmetrical layout design, , which is the ratio of the width to length of the two P-type MOS tubes. , then I d1 =N·I S3 .

[0090] In summary, the output drive current , where N and the second resistor R2 are constants determined by design and process, I d1 This is equivalent to the target drive current mentioned above. By adjusting D, that is, the duty cycle of the input pulse, the output current can be continuously adjusted.

[0091] In addition, the low-pass filter in this design is provided with 6 groups of independent capacitors that can be switched on by switches, corresponding to the aforementioned first group of capacitors C_Group1 including 6 independent capacitors and the first group of switches SW_Group1 including 6 independent switches. By selecting the number of capacitors connected to the circuit, the parameters of the filter can be changed, thereby achieving the purpose of adjusting the output current range within a certain range.

[0092] 2. Implementation method of touch capacitance measurement unit circuit

[0093] 2.1 Touch capacitance measurement unit circuit structure

[0094] The circuit structure of the touch capacitance measurement unit is as follows: Figure 5 shown.

[0095] 2.2 Functional principle of touch capacitance measurement unit

[0096] The measurement process of the touch button capacitance Cpad by the touch capacitance measurement unit circuit is divided into three stages, namely, the charging stage, the sampling stage and the conversion stage.

[0097] 2.2.1 Charging phase

[0098] The first switch SW1 and the second switch SW2 are closed; the third switch SW3, the fourth switch SW4, the fifth switch SW5, the sixth switch SW6, the seventh switch SW7, the eighth switch SW8 and the ninth switch SW9 are all opened, and the circuit is in a charging state.

[0099] At this time, the system voltage Vsys charges the touch button capacitor Cpad and the equivalent capacitor Ceff composed of multiple (such as 16, or other numbers) fine-tuning capacitors included in the second group of capacitors C_Group2. After charging, the total charge amount obtained by the touch button capacitor Cpad and the equivalent capacitor Ceff is Q charge =Q Cpad +Q Ceff =Cpad·Vsys+Ceff·Vsys.

[0100] 2.2.2 Sampling phase

[0101] The second switch SW2, the third switch SW3 and the fourth switch SW4 are closed; the first switch SW1, the fifth switch SW5, the sixth switch SW6, the seventh switch SW7, the eighth switch SW8 and the ninth switch SW9 are all opened, and the circuit is in a sampling state.

[0102] At this time, the touch key capacitor Cpad and the equivalent capacitor Ceff, which have just been charged by the system voltage Vsys to obtain a high potential, charge the first capacitor C1, which is equivalent to using the first capacitor C1 to sample the energy just obtained. When the sampling is completed, the charge amount obtained by the first capacitor C1 is .

[0103] 2.2.3 Conversion phase

[0104] The fifth switch SW5 is closed; the second switch SW2, the fourth switch SW4, the seventh switch SW7, the eighth switch SW8 and the ninth switch SW9 are all opened, and the circuit is in a switching state.

[0105] At this time, the charge of the first capacitor C1 is transferred to the third capacitor C3 (or can be called feedback capacitor) through the second capacitor C2 and accumulated, so that V out The voltage is generated at the end, thus completing the conversion from charge to voltage, that is, . Slight changes in the touch button capacitance Cpad will cause changes. It is sent to the subsequent analog-to-digital conversion unit to achieve accurate measurement of the touch button capacitance Cpad.

[0106] 2.2.4 Circuit recovery

[0107] The sixth switch SW6 , the seventh switch SW7 , the eighth switch SW8 and the ninth switch SW9 are closed, so that the residual charge of the circuit can be quickly discharged, so that the circuit can quickly return to the initial state and prepare for the next measurement.

[0108] 2.2.5 Parameter Difference Fine-tuning

[0109] Figure 5 The equivalent capacitance Ceff in the circuit is the equivalent capacitance of a group of capacitors (i.e., corresponding to the aforementioned second group of capacitors C_Group2) with the same process parameters and structure (e.g., 16). These 16 capacitors are selected by a group of switches (i.e., corresponding to the second group of switches SW_Group2) to determine whether to connect to the circuit. By this method, the parameters of the circuit can be changed within a certain range to improve the sensitivity of the measurement.

[0110] 3. Design of timing control unit function and control timing

[0111] 3.1 Pulse drive

[0112] The main function of the pulse drive part is to generate the basic synchronous clock required by the entire circuit. This clock signal is the basic clock signal of the timing control unit, and is also the basic clock signal of the current drive unit and the touch capacitance measurement unit.

[0113] 3.2 Measurement time window control

[0114] The measurement window control is achieved through the window interval register and the sampling number register to achieve precise control of the measurement time window. Figure 3 The window interval register and sampling times register in the touch measurement window define the interval time between two touch measurement time windows, and the sampling times register defines the number of sampling measurements required in each touch measurement time window.

[0115] 3.3 Control flow and control sequence of timing control circuit

[0116] The timing control circuit uniformly controls the working timing of the entire circuit, so as to achieve the purpose of using only one port to simultaneously complete the current driving LED and the touch capacitance value measurement. Specifically, the timing control circuit divides the entire working time slice into a current driving time window and a touch measurement time window in an equal time interval to achieve the above function.

[0117] In the current driving time window, the timing control circuit controls the multiplexer MUX to select the current driving unit. At this time, the function of the PIN pin is the current driving function, and the current driving unit drives the LED externally through the PIN pin;

[0118] In the touch measurement time window, the timing control circuit controls the multiplexer MUX to select the touch capacitance measurement unit. At this time, the function of the PIN pin is the touch measurement function, and the external PAD capacitance (corresponding to the aforementioned touch button capacitance Cpad) is introduced into the internal capacitance measurement unit through the PIN pin for precise measurement.

[0119] 3.4 Control Flow and Control Timing Implementation of Timing Control Unit

[0120] This embodiment takes each sampling time of 1ms (corresponding to the aforementioned first time window), the window interval register value of 500ms (corresponding to the aforementioned second time window), and the sampling number register value of 5 times as an example to provide the timing control process and timing.

[0121] Figure 6 This is a flow chart of a timing control provided by an embodiment of the present application, and the flow includes:

[0122] S601, read the window interval register, such as 500ms;

[0123] S602, read the sampling times register, for example, 5 times, that is, 1ms*5=5ms;

[0124] It should be noted that the above steps S601 and S602 are not sequentially performed and can be performed simultaneously.

[0125] S603, switching the MUX to select the touch capacitance measurement unit;

[0126] S604, initialize the sampling times counter, such as SampleTime=5;

[0127] S605, start measuring the touch button capacitance Cpad;

[0128] S606, the sampling times SampleTime is reduced by 1;

[0129] S607, determining whether the sampling number SampleTime is greater than or equal to 1;

[0130] S608, when the judgment result of the above step S607 is no, that is, the sampling number SampleTime is less than 1, that is, the sampling number SampleTime is equal to 0, it means that the preset sampling number has been completed;

[0131] When the determination result of step S607 is yes, the process returns to step S605 to continue measuring the touch button capacitance Cpad;

[0132] S609, switching the MUX to select the current driving unit;

[0133] S610, initializing the current driving time timer, such as CurrentTime=500ms;

[0134] S611, turning on the current driving unit;

[0135] S612, continuously output stable driving current to the outside;

[0136] S613, determining whether the current driving time CurrentTime is greater than 0;

[0137] S614, when the judgment result of the above step S613 is no, that is, CurrentTime is equal to 0, it means that the preset current driving time has been completed, and the current driving unit is turned off; then return to step S603 to continue execution;

[0138] When the judgment result of the above step S613 is yes, return to step S611.

[0139] Optionally, when the gating control signal of the MUX is at a high level, the touch capacitance measuring unit may be enabled, and when the gating control signal of the MUX is at a low level, the current driving unit may be enabled.

[0140] The aforementioned charging phase, sampling phase and conversion phase are completed within 1 ms of each sampling time.

[0141] Figure 7 is a timing control example diagram provided by an embodiment of the present application, such as Figure 7 As shown, Figure 7 The middle touch measurement time window is 5ms, and the current driving time window is 500ms. The embodiment of the present application is described by taking two time windows equal to 5ms and 500ms respectively as an example. In practical applications, time windows of different sizes can be set as needed.

[0142] The embodiment of the present application designs a special circuit interface with composite functions, which integrates the LED control function and the touch capacitance measurement function into one. The composite port can simultaneously complete the light control brightness adjustment function and the touch capacitance measurement function; thereby saving the number of ports, saving costs, reducing the size of the circuit board, and facilitating circuit layout and routing. The port uses a circuit structure with continuously adjustable current to control the LED light, and realizes the on, off, and brightness adjustment of the LED light by outputting, shutting down, and adjusting the size of a constant adjustable current. Thereby realizing the switch control of the LED light and conveniently adjusting the brightness of the LED light. In addition, the port uses a touch capacitance measurement unit with controllable measurement window to realize the precise controllability of the measurement window, so as to accurately measure the touch sensing capacitance of the port PAD under the set timing rules, thereby realizing the touch detection function.

[0143] Compared with the prior art, the embodiments of the present application have at least the following technical effects: 1) The touch function and the LED control function are reused, which saves the number of IOs, thereby saving costs, reducing the size of the circuit board, and facilitating circuit layout and routing; 2) The output current with continuous adjustable current is used to drive the LED lamp to realize the on / off and brightness adjustment functions of the LED lamp; avoiding the defect that the brightness of the ordinary IO-controlled LED lamp cannot be dynamically adjusted; 3) A touch capacitance measurement unit with a controllable measurement window is used to realize the precise control of the measurement window, so as to realize the integration of the LED light control function and the touch sensing function under certain timing rules.

[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0145] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0146] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0147] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0148] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.

[0149] This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field not recorded in the present disclosure.

Claims

1. An IO interface circuit, characterized in that: include: A timing control unit, a current driving unit, and a touch capacitance measuring unit, wherein: The current driving unit is electrically connected to the timing control unit, the timing control unit is used to provide a basic clock pulse signal to the current driving unit, the current driving unit is used to perform pulse width modulation on the basic clock pulse signal and obtain a target driving current, wherein the target driving current is used to drive an external LED lamp; The touch capacitance measuring unit is electrically connected to the timing control unit, the touch capacitance measuring unit is used to measure the capacitance value of the touch key, and the timing control unit is also used to control the measurement time of the touch capacitance measuring unit measuring the capacitance value of the touch key; The LED lamp is connected between the target IO interface and the ground terminal, the touch button is electrically connected to the target IO interface, the timing control unit includes a channel gate, the output end of the current driving unit is electrically connected to the channel gate, the channel gate is also electrically connected to the input end of the touch capacitance measuring unit, and the target IO interface is also electrically connected to the channel gate, wherein the timing control unit is also used to control the target IO interface through the channel gate to realize the measurement function of the capacitance value of the touch button and the light control function of the LED lamp in a time-sharing manner; Wherein, the timing control unit is used to control the target IO interface to implement the measurement function and the light control function in a time-sharing manner in the following manner: control the channel gate to enable the touch capacitance measurement unit in a first time window of a preset period, and the target IO interface is used to implement the measurement function within the first time window; control the channel gate to enable the current driving unit in a second time window of a preset period, and the target IO interface is used to implement the light control function within the second time window, wherein the sum of the duration corresponding to the first time window and the duration corresponding to the second time window is equal to the preset period; Wherein, the current driving unit includes: a pulse width modulation circuit, a negative feedback amplifier circuit, and a current proportional amplifier circuit, wherein the input end of the pulse width modulation circuit is electrically connected to the timing control unit, and the pulse width modulation circuit is used to perform pulse width modulation on the basic clock pulse signal to obtain a target pulse signal; the output end of the pulse width modulation circuit is electrically connected to the input end of the negative feedback amplifier circuit, and the negative feedback amplifier circuit is used to generate a constant current output; the output end of the negative feedback amplifier circuit is electrically connected to the input end of the current proportional amplifier circuit, and the output end of the current proportional amplifier circuit is electrically connected to the target IO interface; The touch capacitance measuring unit includes: a sampling circuit, a conversion circuit, a first switch and a second switch, wherein the target IO interface is electrically connected to the power supply end through the first switch, and the sampling circuit is electrically connected to the target IO interface through the second switch, wherein the sampling circuit is used to sample the charge amount at both ends of the capacitor corresponding to the touch button to obtain the target charge amount; the sampling circuit is electrically connected to the conversion circuit, and the sampling circuit is also used to convert the target charge amount into a target voltage value through the conversion circuit, and the conversion circuit is used to output the target voltage value, wherein the capacitance value of the touch button is calculated based on the target voltage value.

2. The IO interface circuit according to claim 1, characterized in that: The current driving unit further includes a filter circuit, wherein: The output end of the pulse width modulation circuit is electrically connected to the input end of the negative feedback amplifier circuit through the filter circuit, and the filter circuit is used to filter the target pulse signal.

3. The IO interface circuit according to claim 2, characterized in that: The filter circuit includes a first group of capacitors, a first group of switches and a first resistor, the negative feedback amplifier circuit includes a first operational amplifier, a first NMOS tube, a second resistor and a third resistor, and the current proportional amplifier circuit includes a first PMOS tube, a second PMOS tube, a fourth resistor and a fifth resistor, wherein: The output end of the pulse width modulation circuit is electrically connected to the non-inverting input end of the first operational amplifier through the first resistor, and each capacitor in the first group of capacitors is connected in series with a switch and connected between the non-inverting input end of the first operational amplifier and the ground end, wherein each capacitor in the first group of capacitors corresponds to a switch in the first group of switches; The output terminal of the first operational amplifier is electrically connected to the gate of the first NMOS transistor, the source of the first NMOS transistor is electrically connected to the ground terminal through the second resistor, and the source of the first NMOS transistor is also electrically connected to the inverting input terminal of the first operational amplifier through the third resistor; The source of the first PMOS tube is electrically connected to the power supply terminal through the fourth resistor, the source of the second PMOS tube is electrically connected to the power supply terminal through the fifth resistor, the gate of the first PMOS tube is electrically connected to the gate of the second PMOS tube, the drain of the second PMOS tube is electrically connected to the gate of the second PMOS tube, the drain of the second PMOS tube is also electrically connected to the drain of the first NMOS tube, and the drain of the first PMOS tube is electrically connected to the target IO interface.

4. The IO interface circuit according to claim 1, characterized in that: The touch capacitance measurement unit further includes: a parameter fine-tuning circuit module and a third switch, wherein: The parameter fine-tuning circuit module is electrically connected to the target IO interface through the third switch, and the parameter fine-tuning circuit module includes a second group of capacitors and a second group of switches, each capacitor in the second group of capacitors is connected in series with a corresponding switch in the second group of switches and connected between one end of the third switch and the ground terminal, and the other end of the third switch is electrically connected to the target IO interface, wherein each capacitor in the second group of capacitors corresponds to a switch in the second group of switches; The parameter fine-tuning circuit module adjusts the target charge amount by controlling whether each capacitor in the second group of capacitors is connected to the circuit.

5. The IO interface circuit according to claim 4, characterized in that: The sampling circuit includes a first capacitor, a fourth switch and a fifth switch, and the conversion circuit includes a second operational amplifier, a second capacitor and a third capacitor, wherein: The target IO interface is electrically connected to the first end of the first capacitor through the second switch, the second end of the first capacitor is electrically connected to the ground end through the fourth switch, and the second end of the first capacitor is also connected to the reference voltage through the fifth switch; The first end of the first capacitor is electrically connected to the inverting input terminal of the second operational amplifier through the second capacitor, the non-inverting input terminal of the second operational amplifier is electrically connected to the reference voltage, and the third capacitor is connected between the inverting input terminal of the second operational amplifier and the output terminal of the second operational amplifier, wherein the output terminal of the second operational amplifier is used to output the target voltage value; The touch capacitance measuring unit further includes: a sixth switch, a seventh switch, an eighth switch and a ninth switch, wherein the sixth switch is arranged between the target IO interface and the ground terminal, the seventh switch is arranged between the first end of the first capacitor and the ground terminal, the eighth switch is arranged between the inverting input terminal of the second operational amplifier and the ground terminal, and the ninth switch is arranged between the output terminal of the second operational amplifier and the ground terminal.

6. A control method for an IO interface circuit, characterized in that: The IO interface circuit according to any one of claims 1 to 5 comprises: Obtaining a preset first time value and a preset second time value, wherein the first time value is used to indicate the duration of controlling the target IO interface to implement the measurement function, and the second time value is used to indicate the duration of controlling the target IO interface to implement the lighting control function; The target IO interface is controlled to realize the measurement function and the light control function in the following manner: Control the channel selector to select the touch capacitance measurement unit in a first time window of the preset period, and the target IO interface is used to implement the measurement function in the first time window; The channel selector is controlled to select the current driving unit in the second time window of the preset period, and the target IO interface is used to implement the lighting control function in the second time window, wherein the sum of the duration corresponding to the first time window and the duration corresponding to the second time window is equal to the preset period.

7. A chip, characterized in that: The IO interface circuit comprises the IO interface circuit according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Touch display control apparatus and touch display control method

    CN106933369A

  • Capacitive touch key circuit multiplexing control pin with LED display device

    CN113054982A