A clock calibration method for a touch chip, a touch chip, and a touch display device.
By using a hardware calibration method involving counters and registers, the problem of clock frequency deviation in touch chips was solved, enabling simple and efficient clock calibration that adapts to changes in the screen refresh cycle and improves calibration accuracy and speed.
Patent Information
- Application Number
- CN202210826783.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-14
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-07-14
AI Technical Summary
Existing touch chips lack hardware-based automatic clock detection and calibration functions, resulting in complex, slow, and low-accuracy calibration procedures when the clock frequency deviation is large.
Automatic clock detection and calibration in hardware form is achieved through counters and registers. The specific steps include obtaining the frame synchronization signal frequency of the display screen, calculating the actual number of clocks, comparing the deviation value, and calibrating the clock frequency through registers. By combining counters and frequency adaptive calibration methods, the clock frequency is ensured to be stable.
It achieves simple and efficient clock calibration, improves calibration accuracy and speed, adapts to changes in the display refresh cycle, and ensures the stability of touch performance.
Smart Images

Figure CN115097961B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of touch control, and in particular to a clock calibration method for a touch chip, a touch chip, and a touch display device. Background Technology
[0002] Currently, touch-screen display devices such as smartphones, tablets, and automotive electronics integrate touch functionality into the display screen, or the touchscreen and display screen work together. The touch chip scans the screen at a certain frequency to obtain touch signals. However, the screen refresh rate can cause radiation to the touch function, interfering with the touch effect. The screen refresh rate is determined by the frequency of Vsync (Vertical Synchronization, frame synchronization). Therefore, for the touch function to work better with the display screen, it is necessary to obtain accurate Vsync and achieve adaptive frame rate based on changes in Vsync. Furthermore, Vsync is used as the reference clock source for the touch chip, becoming the standard for the touch chip's calibration clock.
[0003] The current drawback of touch chips is that they do not have the function of automatic detection and calibration of the clock in hardware. This can only be achieved through software. When encountering a large clock frequency deviation, the calibration process is complicated, slow, and has low accuracy. Summary of the Invention
[0004] The purpose of this invention is to provide a clock calibration method for a touch chip, a touch chip, and a touch display device, which can realize automatic clock detection and calibration in hardware through counters and registers. The calibration method is simple and the calibration accuracy is high.
[0005] To address the aforementioned technical problems, this invention provides a clock calibration method for a touch chip, wherein the touch chip includes a counter and a register;
[0006] The clock calibration method for the touch chip includes the following steps:
[0007] S1: Obtain the current frame synchronization signal frequency of the display screen connected to the touch chip, wherein the clock period corresponding to the current frame synchronization signal frequency is the frequency period, and the frequency period is used as the reference clock period of the touch chip.
[0008] S2: Calculate the actual number of clock cycles of the touch chip within the reference clock cycle using the counter;
[0009] S3: Compare the actual number of clocks with the theoretical number of clocks corresponding to the frequency period to obtain the first clock deviation value;
[0010] S4: When the first clock deviation value exceeds the first threshold, the counter feeds back the first clock deviation value to the register, calibrates the clock frequency of the touch chip through the register, and uses the calibration result as the clock frequency for the next operation of the touch chip;
[0011] S5: Calculate the first clock deviation value within M consecutive reference clock cycles. If the first clock deviation value is less than the first threshold for N consecutive cycles, it is determined that the clock frequency of the touch chip has been calibrated and stabilized. M and N are both positive integers, and M is greater than or equal to N.
[0012] Preferably, after step S5, the following steps are performed:
[0013] S6: Compare the actual number of clocks after the clock frequency calibration and stabilization described in step S5 with the theoretical number of clocks corresponding to the frequency period to obtain the second clock deviation value;
[0014] S7: Based on the second clock deviation value and the preset threshold, determine whether the current clock frequency of the touch chip is accurate; if the current clock frequency is inaccurate, further select a calibration method, the calibration method including frequency adaptive calibration and counter calibration; if the current clock frequency is accurate, no calibration is required.
[0015] Preferably, in step S4, calibrating the clock frequency of the touch chip through a register specifically involves:
[0016] When the actual number of clock cycles is greater than the theoretical number of clock cycles corresponding to the frequency period, the register reduces the output value, thereby reducing the current input to the oscillation circuit connected to the output terminal of the register, and thus reducing the clock frequency of the touch chip.
[0017] When the actual number of clock cycles is less than the theoretical number of clock cycles corresponding to the frequency period, the register increases its output value, thereby increasing the current input to the oscillation circuit connected to the output terminal of the register, and thus increasing the clock frequency of the touch chip.
[0018] Preferably, the preset threshold includes a second threshold and a fourth threshold whose quantity values decrease sequentially;
[0019] When the second clock deviation value is greater than the second threshold, the frequency adaptive calibration method is executed;
[0020] When the second clock deviation value is greater than the fourth threshold and less than the second threshold, the counter calibration method is executed.
[0021] Preferably, the frequency adaptive calibration method is specifically performed as follows:
[0022] Iterate through the theoretical clock counts corresponding to each pre-stored frequency period, search for the theoretical clock count with the smallest deviation from the actual clock count corresponding to the stable clock frequency calibration in step S5, take the deviation between the two clock counts as the third deviation value, and define the frequency corresponding to the theoretical clock count with the smallest deviation from the actual clock count corresponding to the stable clock frequency calibration in step S5 as the adaptive frequency.
[0023] When the third deviation value is less than the fifth threshold, the reference clock cycle of the touch chip is switched to the frequency cycle corresponding to the theoretical clock number with the smallest deviation from the actual clock number corresponding to the stable clock frequency calibration in step S5.
[0024] Preferably, the method of performing the frequency adaptive calibration further includes:
[0025] After switching the reference clock cycle of the touch chip to the frequency cycle corresponding to the theoretical clock number that has the smallest deviation from the actual clock number when the clock frequency calibration is stable in step S5,
[0026] Calculate the first clock deviation value within P consecutive reference clock cycles. If the first clock deviation value is less than the first threshold for Q consecutive cycles, it is determined that the clock frequency of the touch chip has been calibrated and stabilized. P and Q are both positive integers, and P is greater than or equal to Q.
[0027] Preferably, the calibration method in step S7 further includes performing software calibration, and the preset threshold further includes a third threshold whose value is between the second threshold and the fourth threshold;
[0028] When the second clock deviation value is greater than the third threshold and less than the second threshold, the software calibration method is executed. The software calibration method is to modify the output value of the register through software program, so that the current input of the oscillation circuit connected to the output terminal of the register changes, thereby adjusting the clock frequency of the touch chip.
[0029] When the second clock deviation value is greater than the fourth threshold and less than the third threshold, the counter calibration method is executed.
[0030] To solve the above-mentioned technical problems, the present invention also provides a touch chip, including a first control module and an adjustment module;
[0031] The first control module includes a counter, which is used to obtain the actual number of clocks generated by the touch chip within a reference clock cycle through the counter, and to trigger the adjustment module when the first clock deviation value between the actual number of clocks and the theoretical number of clocks preset in the corresponding frequency cycle exceeds a first threshold.
[0032] The adjustment module includes a register. When the actual number of clock cycles is greater than the theoretical number of clock cycles, the adjustment module controls the register to decrease its output value, thereby reducing the current input to the oscillation circuit connected to the output terminal of the register and thus lowering the oscillation frequency of the oscillation circuit. When the actual number of clock cycles is less than the theoretical number of clock cycles, the adjustment module controls the register to increase its output value, thereby increasing the current input to the oscillation circuit connected to the output terminal of the register and thus increasing the oscillation frequency of the oscillation circuit.
[0033] Preferably, the first control module is further configured to:
[0034] After the adjustment module completes the adjustment, the current actual number of clock cycles of the touch chip within the reference clock cycle is obtained;
[0035] Based on the second clock deviation value between the current actual clock count and the theoretical clock count, it is determined whether the frequency period of the reference clock cycle of the touch chip has changed, wherein the frequency period is the clock period corresponding to the frequency of the frame synchronization signal of the display screen connected to the touch chip;
[0036] When the second clock deviation value is greater than the second preset threshold, it is determined that the frequency period has changed, and the theoretical clock count of the counter is switched to the frequency corresponding to the current actual clock count.
[0037] Preferably, switching the theoretical number of clock cycles of the counter to a frequency corresponding to the current actual number of clock cycles includes:
[0038] Based on the corresponding list of the current actual clock count and the theoretical clock count for each frequency period, the frequency after the frame synchronization signal is switched is obtained, and the frequency after the frame synchronization signal is switched is defined as the adaptive frequency.
[0039] Update the theoretical clock count configuration value of the counter to the theoretical clock count configuration value corresponding to the adaptive frequency.
[0040] Preferably, the adjustment module further includes a first MOSFET, a current mirror module, and X adjustment sub-modules, wherein the adjustment sub-modules include a second MOSFET and a third MOSFET, and X is a positive integer;
[0041] The input terminal of the register is the first input terminal of the adjustment module. The output terminal of the register is connected to the first control terminals of X adjustment sub-modules. The input terminal of the first MOSFET is the second input terminal of the adjustment module. The output terminal of the first MOSFET is grounded. The control terminal of the first MOSFET is connected to the input terminal of the first MOSFET, and the common terminal of the connection is connected to the second control terminals of X adjustment sub-modules one by one. The second terminals of X adjustment sub-modules are all grounded. The first terminals of X adjustment sub-modules are interconnected, and the common terminal of the connection is connected to the input terminal of the current mirror module. The output terminal of the current mirror module is the output terminal of the current adjustment module.
[0042] The output terminal of the second MOS transistor is the first terminal of the adjustment submodule, the control terminal of the second MOS transistor is the first control terminal of the adjustment submodule, the input terminal of the second MOS transistor is connected to the input terminal of the third MOS transistor, the control terminal of the third MOS transistor is the second control terminal of the adjustment submodule, and the output terminal of the third MOS transistor is the second terminal of the adjustment submodule.
[0043] Preferably, the first control module is further configured to:
[0044] When the second clock deviation value is between the second threshold and the fourth threshold, the output value of the register is adjusted by the counter so that each of the adjustment sub-modules outputs the target current output value;
[0045] If the actual number of clock cycles is greater than the theoretical number of clock cycles, the current adjustment value output by the register is reduced by a unit adjustment value; if the actual number of clock cycles is less than the theoretical number of clock cycles, the current adjustment value output by the register is increased by a unit adjustment value.
[0046] When the second clock deviation value is less than the fourth threshold, the clock of the touch chip is determined to be accurate;
[0047] The second threshold and the fourth threshold decrease sequentially.
[0048] Preferably, the preset threshold further includes a third threshold whose quantity value is between the second threshold and the fourth threshold;
[0049] The first control module is used for:
[0050] When the second clock deviation value is between the second threshold and the third threshold, the output value of the register is adjusted by software so that each of the adjustment sub-modules outputs the target current output value;
[0051] When the second clock deviation value is between the third threshold and the fourth threshold, the output value of the register is adjusted by the counter so that each of the adjustment submodules outputs the target current output value.
[0052] Preferably, the width-to-length ratios of the first MOS transistor and the third MOS transistors in each of the regulation submodules are different from each other.
[0053] Preferably, the oscillation circuit includes a first inverter, a second inverter, and M oscillation sub-circuits, wherein the oscillation sub-circuits include a fourth MOS transistor and a fifth MOS transistor, and M is a positive integer;
[0054] The input terminal of the oscillator sub-circuit is the input terminal of the oscillator circuit, the output terminal of the oscillator sub-circuit is connected to the input terminal of the first inverter, the output terminal of the first inverter is connected to the input terminal of the second inverter, and the output terminal of the second inverter is the output terminal of the oscillator circuit.
[0055] The input terminals of the fifth MOS transistors in the M oscillator sub-circuits are interconnected, and the common terminal of the interconnection is the input terminal of the oscillator sub-circuit. The control terminal of the fourth MOS transistor is connected to the control terminal of the fifth MOS transistor, and the common terminal of the interconnection is the first terminal of the oscillator sub-circuit. The drain of the fourth MOS transistor is connected to the drain of the fifth MOS transistor, and the common terminal of the interconnection is the second terminal of the oscillator sub-circuit. The first and second terminals of the M oscillator sub-circuits are connected in series. The two ends of the series circuit are connected, and the common terminal of the interconnection is the output terminal of the oscillator sub-circuit.
[0056] To solve the above-mentioned technical problems, the present invention also provides a touch display device, including the above-mentioned touch chip, and a display screen connected to the touch chip.
[0057] In summary, this invention provides a clock calibration method for a touch chip, a touch chip, and a touch display device. First, the current frame synchronization signal frequency of the display screen connected to the touch chip is obtained, and the clock period corresponding to the current frame synchronization signal frequency is used as the reference clock period for the touch chip, making the touch chip clock calibration more compliant with standards. Then, a counter calculates the actual number of clock cycles within the reference clock period; the actual number of clock cycles is compared with the theoretical number of clock cycles to obtain a first clock deviation value; when the first clock deviation value exceeds a first threshold, it indicates that the touch chip's clock is inaccurate. At this time, the counter feeds back the first clock deviation value to a register, and the clock frequency of the touch chip is calibrated through the register. Finally, the first clock deviation value within M consecutive reference clock cycles is calculated. If N consecutive first clock deviation values are all less than the first threshold, it is determined that the clock frequency of the touch chip has been calibrated and stabilized. In summary, automatic clock detection and calibration can be achieved in hardware through a counter and register, with a simple calibration method, fast calibration speed, and high calibration accuracy. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 A flowchart of a clock calibration method for a touch chip provided by the present invention;
[0060] Figure 2 A flowchart of another clock calibration method for a touch chip provided by the present invention;
[0061] Figure 3 A schematic diagram of the structure of a clock calibration device for a touch chip provided by the present invention;
[0062] Figure 4 A partial circuit diagram of an adjustment module provided by the present invention;
[0063] Figure 5 A circuit diagram of an adjustment module provided by the present invention. Detailed Implementation
[0064] The core of this invention is to provide a clock calibration method for a touch chip, a touch chip, and a touch display device, which can realize automatic clock detection and calibration in hardware through counters and registers. The calibration method is simple, fast, and accurate.
[0065] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0066] Please refer to Figure 1 , Figure 1 A flowchart of a clock calibration method for a touch chip provided by the present invention, wherein the touch chip includes a counter and a register;
[0067] The clock calibration method for touch chips includes the following steps:
[0068] S1: Obtain the current frame synchronization signal frequency of the display screen connected to the touch chip. The clock period corresponding to the current frame synchronization signal frequency is the frequency period. Use the frequency period as the reference clock period of the touch chip.
[0069] Touch chips are susceptible to clock inaccuracies due to temperature drift during operation, and the display screen used in conjunction with the touch chip also affects the touch chip's clock during refreshes. To address these technical issues, this application utilizes a counter and registers to calibrate the touch chip's clock. Firstly, to verify the accuracy of the touch chip's clock, a reference clock period needs to be set to obtain the number of clock cycles within that period and perform subsequent clock verification steps. In this application, considering that the frequency of the display screen's frame synchronization signal is closely related to the touch chip's performance, the clock period corresponding to the frame synchronization signal frequency is used as the touch chip's reference clock period.
[0070] S2: Calculate the actual number of clock cycles of the touch chip within the reference clock cycle using a counter;
[0071] This application calculates the actual number of clocks using a counter, that is, it uses hardware to calculate the actual number of clocks, which makes the calculation more accurate and faster, and further ensures the accuracy of clock calibration.
[0072] S3: Compare the actual number of clocks with the theoretical number of clocks corresponding to the frequency period to obtain the first clock deviation value;
[0073] Before clock calibration, a theoretical number of clock cycles generated by the touch chip's oscillation circuit within a reference clock period is preset to facilitate subsequent clock calibration. After obtaining the actual number of clock cycles, the difference between the actual number and the theoretical number is used to obtain the first clock deviation value. The magnitude of the first clock deviation value reflects the degree of deviation of the clock actually generated by the oscillation circuit in the touch chip.
[0074] S4: When the first clock deviation value exceeds the first threshold, the counter feeds back the first clock deviation value to the register, calibrates the clock frequency of the touch chip through the register, and uses the calibration result as the clock frequency for the next operation of the touch chip.
[0075] The magnitude of the first clock deviation value reflects the degree of deviation of the actual clock generated by the oscillation circuit in the touch chip. In this application, a first threshold is preset based on actual conditions. When the absolute value of the first clock deviation value exceeds the first threshold, it indicates that the oscillation circuit in the touch chip needs clock calibration. Therefore, the counter feeds back the first clock deviation value to the register, and the clock frequency of the touch chip is calibrated through the register. Specifically, the calibration method can be to change the input current value of the oscillation circuit in the touch chip by modifying the output value of the register. When the input current of the oscillation circuit increases or decreases, the number of clock cycles generated by the oscillation circuit within the reference clock cycle will also increase or decrease accordingly, thus achieving the purpose of clock calibration. Using the calibration result as the clock frequency for the next operation of the touch chip ensures that the output value of the register remains at the output value that makes the number of clock cycles generated by the oscillation circuit meet the standard.
[0076] In addition, when implementing the input value of the oscillation circuit of the register calibration touch chip, an adjustment circuit can be set between the output terminal of the register and the circuit input terminal of the oscillation circuit. The adjustment circuit can output the standard current corresponding to the output value of the register. Therefore, when the output value of the register is different, the current output by the adjustment circuit is also different, thereby achieving the purpose of adjusting the input current of the oscillation circuit.
[0077] S5: Calculate the first clock deviation value within M consecutive reference clock cycles. If the first clock deviation values are all less than the first threshold for N consecutive cycles, it is determined that the clock frequency of the touch chip has been calibrated and stabilized. M and N are both positive integers, and M is greater than or equal to N.
[0078] To further ensure the accuracy and stability of the touch chip's clock, after calibrating the touch chip's clock frequency through registers, the first clock deviation value within M consecutive reference clock cycles is calculated. If N consecutive first clock deviation values are all less than a first threshold, the touch chip's clock frequency is determined to be calibrated and stable. In summary, this application uses the clock cycle corresponding to the current frame synchronization signal frequency, i.e., the frequency cycle, as the reference clock cycle for the touch chip, ensuring the accuracy of clock calibration. Furthermore, a counter is used to obtain the actual number of clock cycles within the reference clock cycle. When the first clock deviation value exceeds the first threshold, indicating that the touch chip's clock is inaccurate, the clock frequency of the touch chip is adjusted by modifying the register's output value. This hardware-based clock calibration of the touch chip is simple and highly accurate.
[0079] Based on the above embodiments:
[0080] In a preferred embodiment, the following steps are performed after step S5:
[0081] S6: Compare the actual number of clocks after the clock frequency calibration is stabilized in step S5 with the theoretical number of clocks corresponding to the frequency period to obtain the second clock deviation value;
[0082] S7: Based on the second clock deviation value and the preset threshold, determine whether the current clock frequency of the touch chip is accurate; if the current clock frequency is inaccurate, further select a calibration method, which includes frequency adaptive calibration and counter calibration; if the current clock frequency is accurate, no calibration is required.
[0083] In this embodiment, considering that the touch chip is affected not only by factors such as temperature drift but also by the refresh rate of the display screen connected to the touch chip, and that the impact of changes in the frame synchronization signal frequency is more severe than that of temperature drift, it is not feasible to determine the accuracy of the touch chip's clock based on the original theoretical clock count when the frame synchronization signal frequency changes. Therefore, in this embodiment, after clock frequency calibration, it is necessary to further determine the accuracy of the touch chip's current clock frequency. If the current clock frequency of the touch chip is still inaccurate, it is necessary to consider whether it has been affected by changes in the display screen refresh rate.
[0084] Before determining the accuracy of the touch chip's current clock frequency, a preset threshold is set based on the actual performance of the touch chip. The accuracy of the touch chip's current clock frequency can be determined by comparing the magnitude of the second clock deviation value with the magnitude of the preset threshold. Please refer to... Figure 2 , Figure 2 The flowchart illustrates another clock calibration method for a touch chip provided by this invention. If the current clock frequency is inaccurate, a further calibration method is selected. The calibration method includes frequency adaptive calibration and counter calibration. For example, if the current clock frequency is very inaccurate, it is determined that the refresh rate of the display screen connected to the touch chip may have changed. In this case, it may be necessary to modify the reference clock cycle of the touch chip to achieve clock calibration. If the current clock frequency is only slightly inaccurate, it indicates that the clock of the touch chip may still be inaccurate due to factors such as temperature drift. In this case, clock calibration can continue to be performed using a counter and register. If the current clock frequency is accurate, calibration is not required.
[0085] In a preferred embodiment, step S4 involves calibrating the clock frequency of the touch chip using a register, specifically as follows:
[0086] When the actual number of clock cycles is greater than the theoretical number of clock cycles corresponding to the frequency period, the register reduces the output value, which reduces the current input to the oscillation circuit connected to the output of the register, thereby reducing the clock frequency of the touch chip.
[0087] When the actual number of clock cycles is less than the theoretical number of clock cycles corresponding to the frequency period, the register increases the output value, which increases the current input to the oscillation circuit connected to the output of the register, thereby increasing the clock frequency of the touch chip.
[0088] In this embodiment, when the actual number of clocks is greater than the theoretical number of clocks, it indicates that the clock generated by the oscillation circuit is too fast. Therefore, the output value of the register is reduced to reduce the input current of the oscillation circuit, thereby slowing down the clock generated by the oscillation circuit to achieve the purpose of clock calibration.
[0089] When the actual number of clock cycles is less than the theoretical number of clock cycles, it indicates that the clock generated by the oscillator circuit is too slow. Therefore, the output value of the register is increased to increase the input current of the oscillator circuit, thereby speeding up the clock generated by the oscillator circuit to achieve the purpose of clock calibration.
[0090] In a preferred embodiment, the preset threshold includes a second threshold and a fourth threshold whose values decrease sequentially.
[0091] When the second clock deviation value is greater than the second threshold, the frequency adaptive calibration method is executed.
[0092] When the second clock deviation value is greater than the fourth threshold but less than the second threshold, the counter calibration method is executed.
[0093] In this embodiment, a second threshold and a fourth threshold are set with successively decreasing values. When the second clock deviation value is greater than the second threshold, it indicates that the clock of the touch chip is inaccurate to a large extent, and the clock needs to be calibrated by frequency adaptive calibration. The frequency adaptive calibration method here is to reset the number of reference clocks for the touch chip based on the current frame synchronization signal frequency of the display screen.
[0094] When the second clock deviation value is greater than the fourth threshold but less than the second threshold, it indicates that the clock inaccuracy of the touch chip is relatively low. At this time, the counter calibration method needs to be performed, that is, the counter and register can continue to be used for clock calibration.
[0095] For example, if the frequency of the frame synchronization signal changes while the frequency of the oscillation circuit remains constant, the actual number of clock cycles within the preset time period will change. For the same frame synchronization signal frequency, the theoretical number of clock cycles is fixed. For instance, currently used frame synchronization signal frequencies are 60Hz, 90Hz, 120Hz, and 144Hz, with theoretical clock cycles of 1,600,000, 1,066,666, 800,000, and 666,666 respectively.
[0096] If the frequency of the frame synchronization signal changes from 120Hz to 144Hz, the change in the actual number of clocks is ((144-120) / 120) = 16.7%. However, the change in the actual number of clocks caused by temperature drift is very small, usually within 2%. Therefore, when the second deviation between the current actual number of clocks and the theoretical number of clocks changes significantly, it can be determined that the frequency of the frame synchronization signal of the display screen has changed. In other words, the reference clock cycle of the touch chip needs to be modified, which means that frequency adaptive calibration is required.
[0097] In this embodiment, different calibration methods are selected based on the magnitude of the second clock deviation value, making the clock calibration process faster and more accurate.
[0098] As a preferred embodiment, the frequency adaptive calibration method is specifically as follows:
[0099] Iterate through the theoretical clock counts corresponding to each pre-stored frequency period, search for the theoretical clock count with the smallest deviation from the actual clock count corresponding to the stable clock frequency calibration in step S5, take the deviation between the two clock counts as the third deviation value, and define the frequency corresponding to the theoretical clock count with the smallest deviation from the actual clock count corresponding to the stable clock frequency calibration in step S5 as the adaptive frequency.
[0100] When the third deviation value is less than the fifth threshold, the reference clock cycle of the touch chip is switched to the frequency cycle corresponding to the theoretical clock number with the smallest deviation from the actual number of clocks when the clock frequency calibration is stable in step S5.
[0101] In this embodiment, the frequency adaptive calibration method includes first traversing the pre-stored theoretical clock counts corresponding to each frequency period, searching for the theoretical clock count with the smallest deviation from the actual clock count corresponding to the stable clock frequency calibration in step S5, and obtaining a third deviation value between the actual clock count corresponding to the stable clock frequency calibration and the theoretical clock count with the smallest deviation among the pre-stored theoretical clock counts. If the third deviation value is less than a fifth threshold, the reference clock period of the touch chip is switched to the frequency period corresponding to the theoretical clock count with the smallest deviation from the actual clock count corresponding to the stable clock frequency calibration in step S5, so as to continue to check whether the clock of the touch chip is accurate.
[0102] For example, if the actual clock count for five consecutive tests is very close to the actual clock count corresponding to the frequency of a certain frame synchronization signal, it indicates that the frame synchronization signal has switched to that frequency and has stabilized. For instance, if the actual clock count detected five times consecutively changes from 1599950 to 799950, 1599950 is very close to the theoretical value of 1600000, indicating that the previous frame synchronization signal frequency was 60Hz. 799950 is very close to the theoretical value of 800000, indicating that the current frame synchronization signal frequency is 120Hz. That is, the frame synchronization signal has switched from 60Hz to 120Hz, and the theoretical clock count needs to be set to the number of clock cycles corresponding to 120Hz.
[0103] As a preferred embodiment, the frequency adaptive calibration method further includes:
[0104] After switching the reference clock cycle of the touch chip to the frequency cycle corresponding to the theoretical clock number with the smallest deviation from the actual clock number when the clock frequency calibration is stable in step S5, the first clock deviation value within P consecutive reference clock cycles is calculated. If the first clock deviation values of Q consecutive times are all less than the first threshold, it is determined that the clock frequency of the touch chip has been calibrated and stabilized. P and Q are both positive integers, and P is greater than or equal to Q.
[0105] In this embodiment, in order to further ensure the accuracy of clock calibration, after switching the reference clock period of the touch chip to the frequency period corresponding to the theoretical clock number with the smallest deviation from the actual number of clocks when the clock frequency calibration is stable in step S5, the first clock deviation value is calculated continuously P times. If Q first clock deviation values are all less than the first threshold, it means that the clock of the current touch chip has been calibrated, which further ensures the accuracy of clock calibration.
[0106] Furthermore, this application does not impose any special restrictions on the specific values of P and Q, which can be set according to the actual situation.
[0107] In a preferred embodiment, the calibration method in step S7 further includes performing a software calibration method, and the preset threshold further includes a third threshold whose value is between the second threshold and the fourth threshold;
[0108] When the second clock deviation value is greater than the third threshold but less than the second threshold, a software calibration method is executed. The software calibration method involves modifying the output value of the register through a software program, thereby changing the current input to the oscillation circuit connected to the output terminal of the register, and thus adjusting the clock frequency of the touch chip.
[0109] When the second clock deviation value is greater than the fourth threshold but less than the third threshold, the counter calibration method is executed.
[0110] In this embodiment, considering that the accuracy of counter calibration is higher than that of direct software register writing calibration, but the calibration speed is slower, software calibration is used when the error is large, as it is faster; counter calibration is used when the error is small, as it is more accurate.
[0111] Specifically, a third threshold is preset, falling between the second and fourth thresholds. When the second clock deviation is greater than the third threshold but less than the second threshold, it indicates a significant degree of inaccuracy in the touch chip's current clock. Therefore, software calibration is performed. This involves modifying the register's output value via software, causing a change in the current input to the oscillation circuit connected to the register's output, thereby adjusting the touch chip's clock frequency. When the second clock deviation is greater than the fourth threshold but less than the third threshold, it indicates a lesser degree of inaccuracy in the touch chip's current clock. In this case, a counter calibration method is performed, resulting in high calibration accuracy.
[0112] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a clock calibration device for a touch chip provided by the present invention. The touch chip includes a control module 1 and an adjustment module 2.
[0113] Control module 1 includes a counter. Control module 1 is used to obtain the actual number of clocks generated by the touch chip within a reference clock cycle through the counter. When the first clock deviation value between the actual number of clocks and the theoretical number of clocks preset in the corresponding frequency cycle exceeds a first threshold, the adjustment module 2 is triggered.
[0114] The adjustment module 2 includes a register. When the actual number of clock cycles is greater than the theoretical number of clock cycles, the adjustment module 2 controls the register to decrease the output value, thereby reducing the current input to the oscillation circuit connected to the output terminal of the register and thus reducing the oscillation frequency of the oscillation circuit. When the actual number of clock cycles is less than the theoretical number of clock cycles, the adjustment module 2 controls the register to increase the output value, thereby increasing the current input to the oscillation circuit connected to the output terminal of the register and thus increasing the oscillation frequency of the oscillation circuit.
[0115] In this embodiment, the touch chip includes a control module 1 and an adjustment module 2. First, the control module 1 uses a counter to obtain the actual number of clock cycles generated by the oscillation circuit in the touch chip within a reference clock period. Before clock calibration, a theoretical number of clock cycles and a first threshold are set based on the actual situation of the touch chip. After obtaining the actual number of clock cycles, the difference between the actual number of clock cycles and the theoretical number of clock cycles is used to obtain a first clock deviation value. If the first clock deviation value exceeds the first threshold, it indicates that the clock generated by the oscillation circuit is inaccurate and clock calibration is required. Therefore, the control module 1 will trigger the adjustment module 2.
[0116] When the actual number of clocks is greater than the theoretical number of clocks, it indicates that the clock generated by the oscillation circuit is too fast. Therefore, the adjustment module 2 reduces the input current of the oscillation circuit through the register, thereby slowing down the clock generated by the oscillation circuit to achieve the purpose of clock calibration.
[0117] When the actual number of clocks is less than the theoretical number of clocks, it means that the clock generated by the oscillation circuit is too slow. Therefore, the adjustment module 2 increases the input current of the oscillation circuit through the register, thereby speeding up the clock generated by the oscillation circuit to achieve the purpose of clock calibration.
[0118] The specific adjustment value of the input current of the oscillation circuit by the adjustment module 2 can be a preset unit adjustment value, that is, each time the adjustment module 2 is triggered, the input current of the oscillation circuit will be reduced by one level or increased by one level. After multiple adjustments by the adjustment module 2, the first difference is kept within the preset error range. Alternatively, the specific adjustment value can be set according to the first difference between the actual number of clocks and the theoretical number of clocks, so that the first difference is kept within the preset error range as long as the adjustment module 2 is triggered once.
[0119] Furthermore, this application does not impose any specific limitations on the number of theoretical clocks and the preset error range; these can be set according to the actual situation.
[0120] In a preferred embodiment, the control module 1 is further configured to:
[0121] After the adjustment module 2 completes the adjustment, the current actual number of clock cycles of the touch chip within the reference clock cycle is obtained;
[0122] Based on the second clock deviation value between the current actual clock count and the theoretical clock count, it is determined whether the frequency period of the reference clock cycle for the touch chip has changed, where the frequency period is the clock period corresponding to the frequency of the frame synchronization signal of the display screen connected to the touch chip.
[0123] When the second clock deviation value is greater than the second preset threshold, it is determined that the frequency period has changed, and the theoretical clock count of the counter is switched to the frequency corresponding to the current actual clock count.
[0124] Considering that the clock of the touch chip is also affected when the display screen connected to the touch chip refreshes, and that the refresh cycle of the display screen is related to the frequency of the frame synchronization signal, and that the impact of the change in the frequency of the frame synchronization signal is more severe than that of temperature drift, the clock inaccuracy caused by the change in the frequency of the frame synchronization signal is more obvious, and the reference clock cycle of the touch chip in this application is also a frequency cycle, it is necessary to determine whether the frequency cycle used as the reference clock cycle of the touch chip has changed in this embodiment to avoid adverse effects on normal clock calibration.
[0125] Before determining whether the frequency period of the reference clock cycle for the touch chip has changed, a theoretical number of clocks and a second clock deviation value are pre-set according to the actual performance of the touch chip. The frequency period of the reference clock cycle for the touch chip can be determined based on the magnitude of the second clock deviation value. When the second clock deviation value is greater than the second threshold, it is determined that the frequency period has changed, and the oscillation circuit is switched to the frequency corresponding to the theoretical number of clocks and the current actual number of clocks.
[0126] In addition, the stability of the actual clock count can be determined by judging whether the adjustment module 2 has completed the adjustment. For example, the actual clock count is obtained within 5 consecutive preset time periods, and the difference between each actual clock count and the theoretical clock count is calculated. Only when all 5 differences are less than the preset value can it be determined that the adjustment module 2 has completed the adjustment.
[0127] As a preferred embodiment, switching the theoretical number of clock cycles of the counter to a frequency corresponding to the current actual number of clock cycles includes:
[0128] Based on the current actual number of clocks and the corresponding theoretical number of clocks for each frequency period, the frequency after the frame synchronization signal is switched is obtained, and the frequency after the frame synchronization signal is switched is defined as the adaptive frequency.
[0129] Update the theoretical clock count configuration value of the counter to the theoretical clock count configuration value corresponding to the adaptive frequency.
[0130] In this embodiment, a theoretical clock count correspondence list is pre-set, which includes the correspondence between clock counts and frame synchronization signal frequencies. After obtaining the actual clock count, the actual clock count is compared with each clock count in the theoretical clock count correspondence list to determine the frequency after the frame synchronization signal switch. The frequency after the frame synchronization signal switch is defined as the adaptive frequency, and the theoretical clock count of the counter is switched to the theoretical clock count corresponding to the adaptive frequency. This is to recalibrate the touch chip's clock to ensure stable operation of the touch chip.
[0131] In a preferred embodiment, the adjustment module 2 further includes a first MOSFET, a current mirror module, and X adjustment sub-modules, wherein the adjustment sub-modules include a second MOSFET and a third MOSFET, and X is a positive integer;
[0132] The input terminal of the register is the first input terminal of the adjustment module 2. The output terminal of the register is connected to the first control terminal of the X adjustment sub-modules. The input terminal of the first MOSFET is the second input terminal of the adjustment module 2. The output terminal of the first MOSFET is grounded. The control terminal of the first MOSFET is connected to the input terminal of the first MOSFET, and the common terminal of the connection is connected to the second control terminal of the X adjustment sub-modules one by one. The second terminals of the X adjustment sub-modules are all grounded. The first terminals of the X adjustment sub-modules are interconnected, and the common terminal of the connection is connected to the input terminal of the current mirror module. The output terminal of the current mirror module is the output terminal of the current adjustment module 2.
[0133] The output terminal of the second MOSFET is the first terminal of the adjustment submodule, the control terminal of the second MOSFET is the first control terminal of the adjustment submodule, the input terminal of the second MOSFET is connected to the input terminal of the third MOSFET, the control terminal of the third MOSFET is the second control terminal of the adjustment submodule, and the output terminal of the third MOSFET is the second terminal of the adjustment submodule.
[0134] In this embodiment, the register outputs a current adjustment value of X bits, and each bit of the current adjustment value corresponds to controlling whether an adjustment submodule outputs current. The sum of the output currents of each adjustment submodule is the current input to the oscillation circuit by the adjustment module 2. Therefore, when the current value output by the register decreases, the current output to the oscillation circuit by the adjustment module 2 will decrease, thereby reducing the actual number of clock cycles generated by the oscillation circuit within the reference clock period.
[0135] Specifically, the input terminal of the first MOSFET is used to input the reference current, and the third MOSFET in each regulation submodule forms a common-gate common-source current mirror. Therefore, the output current of each regulation submodule is proportional to the reference current. Finally, the current mirror module outputs the sum of the output currents of N regulation submodules to the oscillation circuit in order to calibrate the clock generated by the oscillation circuit.
[0136] Please refer to Figure 4 , Figure 4 This is a partial circuit diagram of an adjustment module provided by the present invention. Figure 4 In this configuration, MN4 is the first MOSFET, IREF is the reference current, and MN9 and MN5, MN10 and MN6, MN11 and MN7, and MN12 and MN8 constitute four regulation submodules. MN9, MN10, MN11, and MN12 are the second MOSFETs, and MN5, MN6, MN7, and MN8 are the third MOSFETs. TRIM is a 4-bit current regulation value output from the register. <0> To TRIM <3> The first to fourth bits of TRIM represent the first to fourth bits, and IOUT is the sum of the output currents of the four regulation submodules.
[0137] Please refer to Figure 5 , Figure 5 A circuit diagram of an adjustment module provided by the present invention. Figure 5 The output module in is Figure 4 The circuit shown uses MP4 and MP5 to form a current mirror module.
[0138] In a preferred embodiment, the control module 1 is further configured to:
[0139] When the second clock deviation value is between the second threshold and the fourth threshold, the output value of the register is adjusted by the counter so that each adjustment submodule outputs the target current output value;
[0140] If the actual number of clock cycles is greater than the theoretical number of clock cycles, the current adjustment value output by the control register decreases by one unit adjustment value; if the actual number of clock cycles is less than the theoretical number of clock cycles, the current adjustment value output by the control register increases by one unit adjustment value.
[0141] When the second clock deviation value is less than the fourth threshold, the clock of the touch chip is determined to be accurate;
[0142] The second and fourth thresholds decrease sequentially. In this embodiment, if the second clock deviation value is between the second and fourth thresholds, it indicates that the clock is inaccurate. The output value of the register needs to be adjusted by the counter so that each adjustment submodule outputs the target current output value. Specifically, if the actual number of clocks is greater than the theoretical number of clocks, the current adjustment value output by the control register is reduced by a unit adjustment value, thereby reducing the number of clocks generated by the oscillation circuit; if the actual number of clocks is less than the theoretical number of clocks, the current adjustment value output by the control register is increased by a unit adjustment value, thereby increasing the number of clocks generated by the oscillation circuit.
[0143] If the second clock deviation value is less than the fourth threshold, it means that the actual number of clocks and the theoretical number of clocks are not much different, and the clock of the touch chip is determined to be accurate.
[0144] In summary, this embodiment determines the accuracy of the touch chip's clock based on the specific magnitude of the second clock deviation value and selects the corresponding clock calibration method, thus ensuring the accuracy of the clock calibration.
[0145] In a preferred embodiment, the preset threshold further includes a third threshold whose quantity value is between the second threshold and the fourth threshold;
[0146] Control module 1 is used for:
[0147] When the second clock deviation value is between the second threshold and the third threshold, the output value of the register is adjusted by software so that each adjustment submodule outputs the target current output value;
[0148] When the second clock deviation value is between the third and fourth thresholds, the output value of the register is adjusted by the counter so that each adjustment submodule outputs the target current output value.
[0149] In this embodiment, considering that the clock is inaccurate, the most suitable calibration method can be selected according to the degree of clock inaccuracy. Considering that the accuracy of counter calibration is higher than that of direct software register writing calibration, but the speed is slower, software calibration can be used when the error is large, and counter calibration can be used when the error is small.
[0150] Specifically, when the second clock deviation value is between the second threshold and the third threshold, it indicates that the clock inaccuracy is relatively large. The output value of the register is adjusted by software so that each adjustment submodule outputs the target current output value. When the second clock deviation value is between the third threshold and the fourth threshold, it indicates that the clock deviation is small. The output value of the register is adjusted by the counter so that each adjustment submodule outputs the target current output value.
[0151] In a preferred embodiment, the width-to-length ratios of the first MOS transistor and the third MOS transistors in each regulation submodule are different from each other.
[0152] The first MOSFET and the third MOSFET form a common-gate, common-source current mirror. The ratio between the output current of the first MOSFET and the output current of the third MOSFET is determined by their width-to-length ratio. In this embodiment, the width-to-length ratios of the first MOSFET and the third MOSFET in each adjustment submodule are different. Therefore, by changing the current adjustment value output by the second control module, the input current of the oscillation circuit can be adjusted to different degrees, making the adjustment method more flexible and the adjustment range wider.
[0153] In a preferred embodiment, the oscillation circuit includes a first inverter, a second inverter, and M oscillation sub-circuits, each of which includes a fourth MOSFET and a fifth MOSFET, where M is a positive integer.
[0154] The input terminal of the oscillator circuit is the input terminal of the oscillator circuit. The output terminal of the oscillator circuit is connected to the input terminal of the first inverter. The output terminal of the first inverter is connected to the input terminal of the second inverter. The output terminal of the second inverter is the output terminal of the oscillator circuit.
[0155] The input terminals of the fifth MOSFETs in the M oscillator circuits are interconnected, and the common terminal of the connection is the input terminal of the oscillator circuit. The control terminals of the fourth and fifth MOSFETs are connected, and the common terminal of the connection is the first terminal of the oscillator circuit. The drains of the fourth and fifth MOSFETs are connected, and the common terminal of the connection is the second terminal of the oscillator circuit. The first and second terminals of the M oscillator circuits are connected in series. The two ends of the series circuit are connected, and the common terminal of the connection is the output terminal of the oscillator circuit.
[0156] Please refer to Figure 5 , Figure 5 A circuit diagram of an adjustment module provided by the present invention. Figure 5 MP1 and MN1, MP2 and MN2, and MP3 and MN3 respectively constitute three oscillator circuits. Among them, MP1, MP2 and MP3 are the fourth MOS transistors, MN1, MN2 and MN3 are the fifth MOS transistors, INV1 is the first inverter, and INV2 is the second inverter.
[0157] The present invention also provides a touch display device, including the above-mentioned touch chip, and a display screen connected to the touch chip.
[0158] For a detailed description of the touch display device provided by this invention, please refer to the embodiments of the touch chip and the control method of the touch chip described above, which will not be repeated here.
[0159] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0160] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A clock calibration method for a touch chip, characterized in that, The touch chip includes a counter and a register; The clock calibration method for the touch chip includes the following steps: S1: Obtain the current frame synchronization signal frequency of the display screen connected to the touch chip, wherein the clock period corresponding to the current frame synchronization signal frequency is the frequency period, and the frequency period is used as the reference clock period of the touch chip. S2: Calculate the actual number of clock cycles of the touch chip within the reference clock cycle using the counter; S3: Compare the actual number of clocks with the theoretical number of clocks corresponding to the frequency period to obtain the first clock deviation value; S4: When the first clock deviation value exceeds the first threshold, the counter feeds back the first clock deviation value to the register, calibrates the clock frequency of the touch chip through the register, and uses the calibration result as the clock frequency for the next operation of the touch chip; wherein, the clock frequency is calibrated by changing the input current value of the oscillation circuit in the touch chip by modifying the output value of the register. S5: Calculate the first clock deviation value within M consecutive reference clock cycles. If the first clock deviation value is less than the first threshold for N consecutive cycles, it is determined that the clock frequency of the touch chip has been calibrated and stabilized. M and N are both positive integers, and M is greater than or equal to N. Once the clock frequency of the touch chip has been calibrated and stabilized, it is determined whether the current clock frequency of the touch chip is accurate. A preset threshold is set in advance based on the actual performance of the touch chip. The preset threshold includes a second threshold and a fourth threshold whose values decrease sequentially. When the second clock deviation value is greater than the second threshold, a frequency adaptive calibration method is executed. When the second clock deviation value is greater than the fourth threshold but less than the second threshold, a counter calibration method is executed. The second clock deviation value is the difference between the actual number of clock cycles after the clock frequency has been calibrated and stabilized and the theoretical number of clock cycles corresponding to the frequency period.
2. The clock calibration method for a touch chip according to claim 1, characterized in that, After step S5, the following steps are performed: S6: Compare the actual number of clocks after the clock frequency calibration and stabilization described in step S5 with the theoretical number of clocks corresponding to the frequency period to obtain the second clock deviation value; S7: Based on the second clock deviation value and the preset threshold, determine whether the current clock frequency of the touch chip is accurate; if the current clock frequency is inaccurate, further select a calibration method, the calibration method including frequency adaptive calibration and counter calibration; if the current clock frequency is accurate, no calibration is required.
3. The clock calibration method for a touch chip according to claim 1 or 2, characterized in that, In step S4, the clock frequency of the touch chip is calibrated through the register, specifically as follows: When the actual number of clock cycles is greater than the theoretical number of clock cycles corresponding to the frequency period, the register reduces the output value, thereby reducing the current input to the oscillation circuit connected to the output terminal of the register, and thus reducing the clock frequency of the touch chip. When the actual number of clock cycles is less than the theoretical number of clock cycles corresponding to the frequency period, the register increases its output value, thereby increasing the current input to the oscillation circuit connected to the output terminal of the register, and thus increasing the clock frequency of the touch chip.
4. The clock calibration method for a touch chip according to claim 1, characterized in that, The specific method for performing the frequency adaptive calibration is as follows: Iterate through the theoretical clock counts corresponding to each pre-stored frequency period, search for the theoretical clock count with the smallest deviation from the actual clock count corresponding to the stable clock frequency calibration in step S5, take the deviation between the two clock counts as the third deviation value, and define the frequency corresponding to the theoretical clock count with the smallest deviation from the actual clock count corresponding to the stable clock frequency calibration in step S5 as the adaptive frequency. When the third deviation value is less than the fifth threshold, the reference clock cycle of the touch chip is switched to the frequency cycle corresponding to the theoretical clock number with the smallest deviation from the actual clock number corresponding to the stable clock frequency calibration in step S5.
5. The clock calibration method for a touch chip according to claim 4, characterized in that, The method for performing the frequency adaptive calibration also includes: After switching the reference clock cycle of the touch chip to the frequency cycle corresponding to the theoretical clock number that has the smallest deviation from the actual clock number when the clock frequency calibration is stable in step S5, Calculate the first clock deviation value within P consecutive reference clock cycles. If the first clock deviation value is less than the first threshold for Q consecutive cycles, it is determined that the clock frequency of the touch chip has been calibrated and stabilized. P and Q are both positive integers, and P is greater than or equal to Q.
6. The clock calibration method for a touch chip according to claim 1, characterized in that, The calibration method in step S7 also includes performing software calibration, and the preset threshold also includes a third threshold whose value is between the second threshold and the fourth threshold; When the second clock deviation value is greater than the third threshold and less than the second threshold, the software calibration method is executed. The software calibration method is to modify the output value of the register through software program, so that the current input of the oscillation circuit connected to the output terminal of the register changes, thereby adjusting the clock frequency of the touch chip. When the second clock deviation value is greater than the fourth threshold and less than the third threshold, the counter calibration method is executed.
7. A touch chip, characterized in that, The touch chip includes a clock calibration device for implementing the clock calibration method of the touch chip according to any one of claims 1 to 6, and further includes a first control module and an adjustment module; The first control module includes a counter, which is used to obtain the actual number of clocks generated by the touch chip within a reference clock cycle through the counter, and to trigger the adjustment module when the first clock deviation value between the actual number of clocks and the theoretical number of clocks preset in the corresponding frequency cycle exceeds a first threshold. The adjustment module includes a register. When the actual number of clock cycles is greater than the theoretical number of clock cycles, the adjustment module controls the register to decrease its output value, thereby reducing the current input to the oscillation circuit connected to the output terminal of the register and thus lowering the oscillation frequency of the oscillation circuit. When the actual number of clock cycles is less than the theoretical number of clock cycles, the adjustment module controls the register to increase its output value, thereby increasing the current input to the oscillation circuit connected to the output terminal of the register and thus increasing the oscillation frequency of the oscillation circuit.
8. The touch chip as described in claim 7, characterized in that, The first control module is also used for: After the adjustment module completes the adjustment, the current actual number of clock cycles of the touch chip within the reference clock cycle is obtained; Based on the second clock deviation value between the current actual clock count and the theoretical clock count, it is determined whether the frequency period of the reference clock cycle of the touch chip has changed, wherein the frequency period is the clock period corresponding to the frequency of the frame synchronization signal of the display screen connected to the touch chip; When the second clock deviation value is greater than the second threshold, it is determined that the frequency period has changed, and the frequency corresponding to the theoretical number of clocks of the counter is switched to the frequency corresponding to the current actual number of clocks.
9. The touch chip as described in claim 8, characterized in that, Switching the frequency corresponding to the theoretical number of clock cycles of the counter to the frequency corresponding to the current actual number of clock cycles includes: Based on the corresponding list of the current actual clock count and the theoretical clock count for each frequency period, the frequency after the frame synchronization signal is switched is obtained, and the frequency after the frame synchronization signal is switched is defined as the adaptive frequency. Update the theoretical clock count configuration value of the counter to the theoretical clock count configuration value corresponding to the adaptive frequency.
10. The touch chip according to any one of claims 7 to 9, characterized in that, The adjustment module further includes a first MOSFET, a current mirror module, and X adjustment sub-modules. The adjustment sub-modules include a second MOSFET and a third MOSFET, where X is a positive integer. The input terminal of the register is the first input terminal of the adjustment module. The output terminal of the register is connected to the first control terminals of the X adjustment sub-modules. The input terminal of the first MOSFET is the second input terminal of the adjustment module. The output terminal of the first MOSFET is grounded. The control terminal of the first MOSFET is connected to the input terminal of the first MOSFET, and the common terminal of the connection is connected to the second control terminals of the X adjustment sub-modules one by one. The second terminals of the X adjustment sub-modules are all grounded. The first terminals of the X adjustment sub-modules are interconnected, and the common terminal of the connection is the input terminal of the current mirror module. The output terminal of the current mirror module is the output terminal of the current adjustment module. The output terminal of the second MOS transistor is the first terminal of the adjustment submodule, the control terminal of the second MOS transistor is the first control terminal of the adjustment submodule, the input terminal of the second MOS transistor is connected to the input terminal of the third MOS transistor, the control terminal of the third MOS transistor is the second control terminal of the adjustment submodule, and the output terminal of the third MOS transistor is the second terminal of the adjustment submodule.
11. The touch chip as described in claim 10, characterized in that, The first control module is also used for: When the second clock deviation value is between the second threshold and the fourth threshold, the output value of the register is adjusted by the counter so that each of the adjustment submodules outputs the target current output value; If the actual number of clocks is greater than the theoretical number of clocks, then the current adjustment value output by the register is reduced by a unit adjustment value; If the actual number of clock cycles is less than the theoretical number of clock cycles, the current adjustment value output by the control register is increased by the unit adjustment value; When the second clock deviation value is less than the fourth threshold, the clock of the touch chip is determined to be accurate; The second threshold and the fourth threshold decrease sequentially.
12. The touch chip as described in claim 11, characterized in that, The preset threshold also includes a third threshold whose quantity value is between the second threshold and the fourth threshold; The first control module is used for: When the second clock deviation value is between the second threshold and the third threshold, the output value of the register is adjusted by software so that each of the adjustment sub-modules outputs the target current output value; When the second clock deviation value is between the third threshold and the fourth threshold, the output value of the register is adjusted by the counter so that each of the adjustment submodules outputs the target current output value.
13. The touch chip as described in claim 12, characterized in that, The width-to-length ratios of the first MOS transistor and the third MOS transistors in each of the aforementioned adjustment submodules are different for each pair.
14. The touch chip as described in claim 10, characterized in that, The oscillation circuit includes a first inverter, a second inverter, and M oscillation sub-circuits, each of which includes a fourth MOS transistor and a fifth MOS transistor, where M is a positive integer. The input terminal of the oscillator sub-circuit is the input terminal of the oscillator circuit, the output terminal of the oscillator sub-circuit is connected to the input terminal of the first inverter, the output terminal of the first inverter is connected to the input terminal of the second inverter, and the output terminal of the second inverter is the output terminal of the oscillator circuit. The input terminals of the fifth MOS transistors in the M oscillator sub-circuits are interconnected, and the common terminal of the interconnection is the input terminal of the oscillator sub-circuit. The control terminal of the fourth MOS transistor is connected to the control terminal of the fifth MOS transistor, and the common terminal of the interconnection is the first terminal of the oscillator sub-circuit. The drain of the fourth MOS transistor is connected to the drain of the fifth MOS transistor, and the common terminal of the interconnection is the second terminal of the oscillator sub-circuit. The first and second terminals of the M oscillator sub-circuits are connected in series. The two ends of the series circuit are connected, and the common terminal of the interconnection is the output terminal of the oscillator sub-circuit.
15. A touch display device, characterized in that, It includes the touch chip according to any one of claims 7 to 14, and further includes a display screen connected to the touch chip.
Citation Information
Patent Citations
Display driver IC
CN104143321A
Clock compensation method applied to externally-mounted touch control chip
CN113721702A