Disclosure of Invention
In view of this, embodiments of the present disclosure provide an OSC frequency calibration method, apparatus, electronic device, and storage medium, which use an MIPI clock of an AP to calibrate an OSC frequency in real time, so as to avoid driving IC failure and screen flicker.
In a first aspect, the present application provides an OSC frequency calibration method, including:
obtaining the frequency value of an OSC clock and the frequency value of an MIPI clock;
comparing the frequency value of the OSC clock with the frequency value of the MIPI clock to adjust the value of a fine tuning register;
and calibrating the frequency value of the OSC clock according to the adjusted value of the fine tuning register.
Optionally, the comparing the frequency value of the OSC clock with the frequency value of the MIPI clock to adjust the value of the trim register includes:
comparing the frequency value of the OSC clock with the frequency value of the MIPI clock;
if the frequency value of the OSC clock is larger than the frequency value of the MIPI clock, finely adjusting the value of a register to be + 1;
if the frequency value of the OSC clock is smaller than the frequency value of the MIPI clock, finely adjusting the value of a register to be-1;
and if the frequency value of the OSC clock is equal to the frequency value of the MIPI clock, the value of the fine tuning register is unchanged.
Optionally, before calibrating the frequency value of the OSC clock according to the adjusted value of the trim register, the method further includes:
it is determined whether OSC frequency calibration is performed.
Optionally, the determining whether to perform OSC frequency calibration includes:
it is detected whether the voltage or temperature of the driving IC changes.
In a second aspect, an embodiment of the present application provides an OSC frequency calibration apparatus, including:
the obtaining module is used for obtaining the frequency value of the OSC clock and the frequency value of the MIPI clock;
the comparison module is used for comparing the frequency value of the OSC clock with the frequency value of the MIPI clock so as to adjust the value of the fine tuning register;
and the calibration module is used for calibrating the frequency value of the OSC clock according to the adjusted value of the fine tuning register.
Optionally, the comparison module comprises:
a sub-comparison module for comparing the frequency value of the OSC clock with the frequency value of the MIPI clock;
a first adjusting module, configured to trim a value of a register by +1 if the frequency value of the OSC clock is greater than the frequency value of the MIPI clock;
a second adjusting module, configured to trim a value of a register by-1 if the frequency value of the OSC clock is smaller than the frequency value of the MIPI clock;
and a third adjusting module, configured to, if the frequency value of the OSC clock is equal to the frequency value of the MIPI clock, keep the value of the trimming register unchanged.
Optionally, the OSC frequency calibration apparatus further comprises:
and the determining module is used for determining whether OSC frequency calibration is carried out.
Optionally, the determining module includes:
and the detection module is used for detecting whether the voltage or the temperature of the drive IC changes.
In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes: the OSC frequency calibration method may further include a memory and a processor, wherein the memory stores an OSC frequency calibration program, and the OSC frequency calibration program implements the steps of the OSC frequency calibration method according to the first aspect when executed by the processor.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which an OSC frequency calibration program is stored, and when the OSC frequency calibration program is executed by a processor, the method according to the first aspect is implemented.
The OSC frequency calibration method of the present application calibrates the OSC frequency in real time by comparing the frequency value of the OSC clock that is sensitive to the change of the external environment (temperature or voltage change) in real time with the frequency value of the MIPI clock that is not sensitive to the change of the external environment, and adding the comparison result to the existing trimming register or subtracting the comparison result from the existing trimming register. That is, the OSC frequency, which is sensitive to the external environmental change in real time, is calibrated in real time using the MIPI clock, which is insensitive to the external environmental change, and in this way, the OSC frequency distribution can be improved, thereby preventing screen flicker and driving IC malfunction.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the embodiments and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments and not all embodiments. The following embodiments and their technical features may be combined with each other without conflict.
In the related art, an oscillator (hereinafter abbreviated as OSC) inside the display driver IC is a system clock of the driver IC for controlling signals required to drive the LCD and OLED screens. If the distribution range of the OSC frequency is too large, a drive IC malfunction and screen flicker may occur. In addition, the OSC frequency when driving a screen varies with the voltage of the driving IC according to display data (white/black/RGB, etc.) and the temperature of the driving IC. Therefore, it is desirable to improve the OSC frequency distribution in real time by increasing or decreasing the trimming bit to reduce the range of the OSC frequency distribution. However, in the actual situation, the trimming bit of the trimming register inside the driver IC is a fixed value, and when the temperature or voltage of the driver IC changes, the OSC frequency cannot be calibrated in real time.
Based on the above, the present application provides an OSC frequency calibration method, apparatus, electronic device, and storage medium, which calibrate the OSC frequency in real time by comparing the frequency value of the OSC clock that is sensitive to the external environmental change (temperature or voltage change) in real time with the frequency value of the MIPI clock that is not sensitive to the external environmental change, and adding the comparison result to the existing trimming register or subtracting the comparison result from the existing trimming register. That is, the OSC frequency, which is sensitive to the external environmental change in real time, is calibrated in real time using the MIPI clock, which is insensitive to the external environmental change, and in this way, the OSC frequency distribution can be improved, thereby preventing screen flicker and driving IC malfunction.
In a first aspect, an embodiment of the present application provides a method for calibrating an OSC frequency. The OSC frequency refers to a frequency value of an oscillator clock (OSC clock) inside the drive IC.
As shown in fig. 1, the OSC frequency calibration method may include:
step S100: obtaining the frequency value of an OSC clock and the frequency value of an MIPI clock;
step S200: comparing the frequency value of the OSC clock with the frequency value of the MIPI clock to adjust the value of the fine tuning register;
step S300: and calibrating the frequency value of the OSC clock according to the adjusted value of the trimming register.
In some embodiments, the main execution body of the OSC frequency calibration method may be an electronic device, or may be a data processing apparatus disposed in the electronic device. Alternatively, the data processing means may be implemented by software (e.g. a processor), or by a combination of software and hardware.
In some embodiments, the frequency value of the OSC clock and the frequency value of the MIPI clock are first obtained. The MIPI clock is a Mobile Industry Processor Interface (Mobile Industry Processor Interface) clock, that is, an Application Processor (AP) MIPI clock. It should be noted that the OSC clock is sensitive to external environment changes (temperature or voltage changes) in real time, and the MIPI clock is not sensitive to external environment changes.
The OSC frequency is calibrated in real time by comparing the frequency value of the OSC clock which is sensitive to the external environment variation in real time with the frequency value of the MIPI clock which is not sensitive to the external environment variation, and adding the comparison result to the existing trimming register or subtracting the comparison result from the existing trimming register. That is, the OSC frequency, which is sensitive to the external environmental change in real time, is calibrated in real time using the MIPI clock, which is insensitive to the external environmental change, and in this way, the OSC frequency distribution can be improved, thereby preventing screen flicker and driving IC malfunction.
In some embodiments, as shown in fig. 2, comparing the frequency value of the OSC clock and the frequency value of the MIPI clock in step S200 to adjust the value of the trim register specifically includes:
step S210: comparing the frequency value of the OSC clock with the frequency value of the MIPI clock;
step S220: if the frequency value of the OSC clock is larger than the frequency value of the MIPI clock, the value of the register is finely adjusted to be + 1;
step S230: if the frequency value of the OSC clock is smaller than the frequency value of the MIPI clock, finely adjusting the value of the register to be-1;
step S240: if the frequency value of the OSC clock is equal to the frequency value of the MIPI clock, the value of the trimming register is unchanged.
In some embodiments, a counter may be used to compare the frequency value of the OSC clock to the frequency value of the MIPI clock and add or subtract the value of the counter to or from the trim register. Specifically, if the frequency value of the OSC clock is greater than the frequency value of the MIPI clock, the value of the counter +1 is added to the value of the trim register, which is equivalent to the value of the trim register + 1. If the frequency value of the OSC clock is less than the frequency value of the MIPI clock, the value-1 of the counter is added to the value of the fine tuning register, which is equivalent to the value-1 of the fine tuning register. If the frequency value of the OSC clock is equal to the frequency value of the MIPI clock, the value of the trimming register is unchanged. And then calibrating the frequency value of the OSC clock according to the adjusted value of the fine tuning register.
In the prior art, the trimming bit of the trimming register inside the driver IC is a fixed value, and when the temperature or voltage of the driver IC changes, the OSC frequency cannot be calibrated in real time. In the embodiment of the present application, the value of the trimming register may be adjusted, so that the OSC frequency may be calibrated in real time even if the temperature or voltage of the driving IC changes.
In some embodiments, as shown in fig. 3, before step S300, the OSC frequency calibration method may further include:
step S400: it is determined whether OSC frequency calibration is performed.
In some embodiments, before calibrating the frequency value of the OSC clock, it is determined whether to perform OSC frequency calibration. The frequency value of the OSC clock is calibrated only when the OSC frequency calibration is determined to be needed, and system consumption is reduced.
In some embodiments, the manner of determining whether to perform OSC frequency calibration includes:
it is detected whether the voltage or temperature of the driving IC changes.
As described above, when the voltage or temperature of the driving IC varies, the OSC frequency varies with the variation of the voltage or temperature of the driving IC. When the voltage or temperature of the driving IC is detected to change, the OSC frequency is calibrated through the value of the trimming register which changes similarly, so that the distribution range of the OSC frequency is reduced, and the faults of the driving IC and screen flicker are avoided.
In some embodiments, it may also be determined that the OSC frequency calibration needs to be performed after detecting that the voltage or temperature of the driver IC changes for more than a predetermined time or a predetermined number of times, so as to avoid occasional false detection.
Fig. 4 is a flowchart illustrating a method for calibrating the OSC frequency according to an embodiment of the present invention. In the figure, 101 refers to the prior art method for calibrating the OSC frequency by the trim register. 102 refers to calibrating the OSC frequency using the MIPI clock in this application. 102, obtaining a frequency value of the OSC clock and a frequency value of the MIPI clock, and comparing the frequency values of the OSC clock and the MIPI clock. If the frequency value of the OSC clock is greater than the frequency value of the MIPI clock, the value of the register is finely adjusted to be + 1. If the frequency value of the OSC clock is less than the frequency value of the MIPI clock, the value of the register is finely adjusted to be-1. If the frequency value of the OSC clock is equal to the frequency value of the MIPI clock, the value of the trimming register is unchanged. Then, it is determined that OSC frequency calibration is required, and the frequency value of the ISC clock inside the driver IC is calibrated. For a specific implementation process, please refer to the above description, which is not repeated herein.
FIG. 5-1 is a timing diagram illustrating real-time calibration of OSC frequency according to an embodiment of the present invention. The real-time OSC trimming algorithm uses the exact frequency value of the MIPI clock to fine tune the OSC frequency value. This real-time OSC trimming method updates the OSC trimming register in the case of transmitting long packets through the high-speed clock of the MIPI clock.
When MIPI _ HS _ EN Mode (Enable signal in MIPI HS Mode, start signal in MIPI high speed Mode) is enabled and the OSC clock counter (OSC _ CLK _ CNT) is started, the operation of fig. 5-1 is synchronized with the MIPI BYTE clock counter (MIPI _ BYTE _ CNT) consisting of HS clock signals.
The n-bit counters of the MIPI and OSC clocks are determined by the MIPI Speed & OSC frequency and the 1-Hsync time.
a)1-Hsync=1/(60)/(2520+16)=6.57us
60=frame rate&2520=display column line and 16=porch
b)MIPI clock counter=10bit counter
6.57us/8.89ns=739,MIPI Speed=900Mhz
c)OSC clock counter=10bit counter
6.57us/11.24ns=585,OSC frequency=89Mhz
Since the MIPI clock transmitted from the AP is accurate, the byte clock count value "739" during 1-Hsync does not always change. However, the OSC clock always changes the count value according to the voltage and temperature.
Based on the MIPI count value "739", the measured OSC count value (OSC _ MES _ CNT) is "584". This value, in contrast to "585", is a difference in the OSC error Range (OSC _ ERR _ RANGE) count value, which is the OSC reference count value (OSC _ CNT _ REF) that does not change during 1-Hsync.
The decision whether to update the OSC adjustment value of the next column for the difference between the reference count value and the meter value is based on the absolute value of the OSC adjustment reference (OSC _ TRIM _ REF).
The OSC _ TRIM _ REF value is determined by the tolerance of the OSC frequency variation.
a) OSC count value based on 1-Hsync when OSC frequency changes + -0.5%
11.24ns x 1.005=11.30ns,6.57us/11.30ns=582
11.24ns x 0.995=11.18ns,6.57us/11.30ns=588
Since the 1-count value in FIG. 5-1 is within + -0.5% of the OSC _ TRIM _ REF variation (+ -3-count), the OSC TRIM register value of the next column does not change.
OSC _ NEXT _ TRIM in FIG. 5-1 refers to the NEXT TRIM value application.
Fig. 5-2 is a timing diagram of the OSC frequency of one embodiment of the present application being 3% slower than the standard frequency.
Since the OSC _ ERR _ RANGE value is less than + -3-count of OSC _ TRIM _ REF, the OSC adjustment value in the next column is updated in the direction of increasing the OSC frequency.
At this point, the number of bits to be added may be adjusted according to the 1-bit resolution of the OSC trim register.
When the OSC trimming register changes by 0.25% every 1 bit, the OSC frequency can be accurately calibrated by repeating the execution 12 times.
Fig. 5-3 are timing diagrams of the OSC frequency of one embodiment of the present application being 2% faster than the standard frequency.
Since the OSC _ ERR _ RANGE value is greater than + -3-count of OSC _ TRIM _ REF, the OSC adjustment value in the next column is updated in the direction of decreasing the OSC frequency.
At this point, the number of bits to be added may be adjusted according to the 1-bit resolution of the OSC trim register.
When the OSC trimming register changes by 0.25% every 1 bit, the OSC frequency can be accurately calibrated by repeating the execution 8 times.
In a second aspect, an embodiment of the present application provides an OSC frequency calibration apparatus, including:
the obtaining module is used for obtaining the frequency value of the OSC clock and the frequency value of the MIPI clock;
the comparison module is used for comparing the frequency value of the OSC clock with the frequency value of the MIPI clock so as to adjust the value of the fine tuning register;
and the calibration module is used for calibrating the frequency value of the OSC clock according to the adjusted value of the fine tuning register.
For the implementation of each module of the OSC frequency calibration apparatus, please refer to the above description, which is not repeated herein.
In some embodiments, the comparison module comprises:
a sub-comparison module for comparing the frequency value of the OSC clock with the frequency value of the MIPI clock;
a first adjusting module, configured to trim a value of a register by +1 if the frequency value of the OSC clock is greater than the frequency value of the MIPI clock;
a second adjusting module, configured to trim a value of a register by-1 if the frequency value of the OSC clock is smaller than the frequency value of the MIPI clock;
and a third adjusting module, configured to, if the frequency value of the OSC clock is equal to the frequency value of the MIPI clock, keep the value of the trimming register unchanged.
In some embodiments, the OSC frequency calibration apparatus further comprises:
and the determining module is used for determining whether OSC frequency calibration is carried out.
In some embodiments, the determining module comprises:
and the detection module is used for detecting whether the voltage or the temperature of the drive IC changes.
In a third aspect, an embodiment of the present application provides an electronic device, including: the OSC frequency calibration method according to the first aspect of the present invention includes a memory and a processor, where the memory stores an OSC frequency calibration program thereon, and the OSC frequency calibration program implements the steps of the OSC frequency calibration method according to the first aspect when executed by the processor.
In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which an OSC frequency calibration program is stored, and when the OSC frequency calibration program is executed by a processor, the method according to the first aspect is implemented.
One of ordinary skill in the art will appreciate that the functional modules/units in the systems, devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
Although the application has been shown and described with respect to one or more implementations, equivalent alterations and modifications will occur to others skilled in the art based upon a reading and understanding of this specification and the annexed drawings. This application is intended to embrace all such modifications and variations and is limited only by the scope of the appended claims. In particular regard to the various functions performed by the above described components, the terms used to describe such components are intended to correspond, unless otherwise indicated, to any component which performs the specified function of the described component (e.g., that is functionally equivalent), even though not structurally equivalent to the disclosed structure which performs the function in the herein illustrated exemplary implementations of the specification.
That is, the above-mentioned embodiments are only some embodiments of the present application, and not intended to limit the scope of the present application, and all equivalent structures or equivalent flow transformations made by the contents of the specification and the drawings, such as the combination of technical features between the embodiments, or the direct or indirect application to other related technical fields, are included in the scope of the present application.
Without further limitation, reference to an element identified by the phrase "comprising an … …" does not exclude the presence of additional like elements in the process, article, or apparatus that comprises the element, and that elements, features, or elements having the same designation in different embodiments may or may not have the same meaning as that of the particular embodiment described herein, or that particular meaning should be determined from its interpretation in the particular embodiment or from its context in the particular embodiment.
In addition, although the terms "first, second, third, etc. are used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well. The terms "or" and/or "are to be construed as inclusive or meaning any one or any combination. An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some way.
In this application, the word "in some embodiments" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "in some embodiments" is not necessarily to be construed as preferred or advantageous over other embodiments. The previous description is provided to enable any person skilled in the art to make and use the present application. In the foregoing description, various details have been set forth for the purpose of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes are not shown in detail to avoid obscuring the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.