CN112737549A - Signal output frequency adjusting method and device and electronic equipment - Google Patents

Signal output frequency adjusting method and device and electronic equipment Download PDF

Info

Publication number
CN112737549A
CN112737549A CN202011567632.8A CN202011567632A CN112737549A CN 112737549 A CN112737549 A CN 112737549A CN 202011567632 A CN202011567632 A CN 202011567632A CN 112737549 A CN112737549 A CN 112737549A
Authority
CN
China
Prior art keywords
frequency
output
pwm signal
output frequency
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011567632.8A
Other languages
Chinese (zh)
Inventor
李中武
徐明燕
敬仕林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202011567632.8A priority Critical patent/CN112737549A/en
Publication of CN112737549A publication Critical patent/CN112737549A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K7/00Modulating pulses with a continuously-variable modulating signal
    • H03K7/08Duration or width modulation ; Duty cycle modulation

Landscapes

  • Inverter Devices (AREA)

Abstract

The invention discloses a method and a device for adjusting signal output frequency and electronic equipment. Wherein, the method comprises the following steps: acquiring an output frequency value of an analog output Pulse Width Modulation (PWM) signal; judging whether the output frequency value is consistent with the frequency setting value or not to obtain a judgment result; and if the judgment result indicates that the output frequency value is inconsistent with the frequency setting value, adjusting the output frequency of the analog output PWM signal. The invention solves the technical problem of larger output frequency error when a timer-based analog output PWM signal is adopted in the related technology.

Description

Signal output frequency adjusting method and device and electronic equipment
Technical Field
The invention relates to the technical field of signal adjustment, in particular to a method and a device for adjusting signal output frequency and electronic equipment.
Background
In the related art, the PWM signal is widely used as a common industrial control signal. In the application process, a PWM signal output control module integrated by a singlechip is generally utilized, and PWM signals with different frequencies are output by changing the duty ratio and the period set value of the PWM signal output module. However, because the PWM signal output control module is limited by the performance of the single chip (including the input clock frequency, the duty ratio register, and the space size of the period register of the PWM signal output control module), the broadband output of the PWM signal cannot be realized, i.e., the minimum and maximum frequencies of the output PWM signal are limited. In order to solve the problem that a single chip microcomputer cannot output a PWM signal with a wider frequency due to performance limitation of the single chip microcomputer, the single chip microcomputer timer is often used for simulating and outputting the PWM signal through a level inversion method, but due to the influences of factors such as reloading operation of a timer counting value, error of an input clock of the timer and the like, the output frequency of the PWM signal based on the simulation output of the timer has errors, and the single chip microcomputer timer is not suitable for being used in occasions requiring higher precision of the output frequency.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for adjusting signal output frequency and electronic equipment, which are used for at least solving the technical problem of larger output frequency error when a timer-based analog output PWM signal is adopted in the related art.
According to an aspect of an embodiment of the present invention, there is provided a method for adjusting a signal output frequency, including: acquiring an output frequency value of an analog output Pulse Width Modulation (PWM) signal; judging whether the output frequency value is consistent with a frequency setting value or not to obtain a judgment result; and if the judgment result indicates that the output frequency value is inconsistent with the frequency setting value, adjusting the output frequency of the analog output PWM signal.
Optionally, before acquiring the output frequency value of the analog output PWM signal, the adjusting method further comprises: acquiring a frequency setting value of a PWM signal to be output; and controlling the timer to output a PWM signal to a preset singlechip in an analog mode, wherein the preset singlechip is provided with a control port with an input capturing function.
Optionally, the step of acquiring an output frequency value of the analog output PWM signal includes: adopting an edge triggering mode to acquire the duration of high and low levels of an analog output PWM signal; and calculating to obtain the output frequency of the current analog output PWM signal by adopting a preset frequency calculation formula based on the duration.
Optionally, after determining whether the output frequency value is consistent with the frequency setting value to obtain a determination result, the adjusting method further includes: and if the judgment result indicates that the output frequency value is consistent with the frequency setting value, maintaining the current output frequency of the analog output PWM signal.
Optionally, the step of adjusting the output frequency of the analog output PWM signal comprises: and if the judgment result indicates that the output frequency value is greater than the frequency setting value, increasing the counting reload value of the timer by adopting a first unit numerical value so as to prolong the interrupt triggering period of the timer and reduce the output frequency of the PWM signal.
Optionally, the step of adjusting the output frequency of the analog output PWM signal further includes: and if the judgment result indicates that the output frequency value is lower than the frequency setting value, reducing the counting reload value of the timer by adopting a second unit numerical value so as to shorten the interrupt triggering period of the timer and improve the output frequency of the PWM signal.
Optionally, after adjusting the output frequency of the analog output PWM signal, the adjusting method further comprises: acquiring frequency demand precision; judging whether the frequency after the output frequency of the analog output PWM signal is adjusted meets the frequency precision requirement or not to obtain a judgment result; and if the judgment result indicates that the frequency of the output PWM signal does not meet the frequency precision requirement, continuously adjusting the output frequency of the analog output PWM signal.
According to another aspect of the embodiments of the present invention, there is also provided a device for adjusting a signal output frequency, including: the acquisition unit is used for acquiring the output frequency value of the analog output Pulse Width Modulation (PWM) signal; the judging unit is used for judging whether the output frequency value is consistent with a frequency setting value or not to obtain a judging result; and the adjusting unit is used for adjusting the output frequency of the analog output PWM signal when the judgment result indicates that the output frequency value is inconsistent with the frequency setting value.
Optionally, the device for adjusting the signal output frequency further comprises: the acquisition unit is used for acquiring a frequency setting value of the PWM signal to be output before acquiring an output frequency value of the analog output PWM signal; and the control unit is used for controlling the timer to simulate and output the PWM signal to a preset singlechip, wherein the preset singlechip is provided with a control port with an input capturing function.
Optionally, the acquisition unit comprises: the first acquisition module is used for acquiring the duration of high and low levels of an analog output PWM signal in an edge triggering mode; and the first calculation module is used for calculating the output frequency of the current analog output PWM signal by adopting a preset frequency calculation formula based on the duration.
Optionally, the device for adjusting the signal output frequency further comprises: and the maintaining unit is used for maintaining the current output frequency of the analog output PWM signal if the judging result indicates that the output frequency value is consistent with the frequency setting value after judging whether the output frequency value is consistent with the frequency setting value or not and obtaining a judging result.
Optionally, the adjusting unit includes: and the increasing module is used for increasing the counting reloading value of the timer by adopting a first unit numerical value when the judging result indicates that the output frequency value is greater than the frequency setting value, so that the interrupted triggering period of the timer is prolonged, and the output frequency of the PWM signal is reduced.
Optionally, the adjusting unit further includes: and the reducing module is used for reducing the counting reloading value of the timer by adopting a second unit numerical value if the judging result indicates that the output frequency value is lower than the frequency setting value, so that the interrupted triggering period of the timer is shortened, and the output frequency of the PWM signal is improved.
Optionally, the device for adjusting the signal output frequency further comprises: the first acquisition module is used for acquiring the frequency demand precision after adjusting the output frequency of the analog output PWM signal; the first judgment module is used for judging whether the frequency after the output frequency of the analog output PWM signal is adjusted meets the frequency precision requirement or not to obtain a judgment result; and the adjusting module is used for indicating that the frequency of the output PWM signal does not meet the frequency precision requirement according to the judgment result, and continuously adjusting the output frequency of the analog output PWM signal.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a single chip microcomputer; the memory is used for storing the executable instruction of the single chip microcomputer; wherein the single chip microcomputer is configured to execute any one of the signal output frequency adjusting methods described above via execution of the executable instructions.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program runs, the apparatus where the computer-readable storage medium is located is controlled to execute any one of the above methods for adjusting the signal output frequency.
In the embodiment of the invention, the output frequency value of the analog output pulse width modulation PWM signal is acquired, then whether the output frequency value is consistent with the frequency setting value or not is judged, a judgment result is obtained, and if the judgment result indicates that the output frequency value is inconsistent with the frequency setting value, the output frequency of the analog output PWM signal is adjusted. In this embodiment, when the PWM signal output module cannot achieve broadband output of the PWM signal, self-feedback acquisition may be performed on the PWM signal that is output based on the timer simulation, and then the output frequency of the analog output PWM signal is automatically adjusted to adjust the accuracy of the signal output frequency, thereby solving the technical problem of a large error in the output frequency when the PWM signal is output based on the timer simulation in the related art.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of an alternative method of adjusting the output frequency of a signal in accordance with an embodiment of the present invention;
fig. 2 is a schematic diagram of an alternative signal output frequency adjustment arrangement according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The PWM signal output control module is integrated by the singlechip, and the PWM signals with different frequencies are output by changing the duty ratio and the period setting value of the PWM signal output module. However, in the related art, because of the limitation of the performance of the single chip microcomputer (including the space size of an input clock frequency, a duty ratio register and a period register of a PWM signal output control module), the broadband output of the PWM signal cannot be realized, in order to solve the problem that the PWM signal with wider frequency cannot be output due to the limitation of the performance of the single chip microcomputer, the single chip microcomputer timer is used in the related art, the PWM signal is output in a simulation mode through level inversion, and aiming at the condition that the error of the output frequency of the PWM signal output based on the simulation of the timer is larger, the self-feedback acquisition of the PWM signal output based on the simulation of the timer can be carried out by adopting a software control method, then the output frequency of the PWM signal output in the simulation mode is automatically adjusted. The present invention will be described in detail with reference to examples.
Example one
In accordance with an embodiment of the present invention, there is provided an embodiment of a method for adjusting a signal output frequency, it is noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than that presented herein.
Fig. 1 is a flow chart of an alternative method of adjusting the output frequency of a signal according to an embodiment of the present invention, as shown in fig. 1, the method comprising the steps of:
step S102, collecting an output frequency value of an analog output Pulse Width Modulation (PWM) signal;
step S104, judging whether the output frequency value is consistent with the frequency setting value or not to obtain a judgment result;
and step S106, if the judgment result indicates that the output frequency value is inconsistent with the frequency setting value, adjusting the output frequency of the analog output PWM signal.
Through the steps, the output frequency value of the analog output pulse width modulation PWM signal can be collected; judging whether the output frequency value is consistent with the frequency setting value or not to obtain a judgment result; and if the judgment result indicates that the output frequency value is inconsistent with the frequency setting value, adjusting the output frequency of the analog output PWM signal. In this embodiment, when the PWM signal output module cannot achieve broadband output of the PWM signal, self-feedback acquisition may be performed on the PWM signal that is output based on the timer simulation, and then the output frequency of the analog output PWM signal is automatically adjusted to adjust the accuracy of the signal output frequency, thereby solving the technical problem of a large error in the output frequency when the PWM signal is output based on the timer simulation in the related art.
In the embodiment of the invention, when the PWM module is limited by an input clock and cannot realize wide-frequency output (the frequency of the input clock is too high, low-frequency output cannot be realized, otherwise, high-frequency output cannot be realized), a frequency-variable square wave signal (the duty ratio can be adjusted, for example, is 50%) is output by adopting a mode of simulating and outputting a PWM signal (the level of an output I/O port is turned over in a timer interrupt service function) by a timer, the interrupt trigger frequency of the timer is changed by changing the reloading value of the timer, and then the frequency of the PWM square wave signal is simulated and output by the timer is changed.
The present invention will be described in detail below with reference to the above-described embodiments.
Optionally, before acquiring the output frequency value of the analog output PWM signal, a frequency setting value of the PWM signal to be output may be acquired; the control timer simulates and outputs a PWM signal to a preset single chip microcomputer, wherein the preset single chip microcomputer is provided with a control port with an input capturing function.
The frequency setting value may be a frequency value set by a worker or an equipment control worker, and the output frequency value for controlling the analog output PWM signal needs to be consistent with the frequency setting value as a reference.
When the timer is controlled to output the PWM signal in an analog mode, the output level can be turned in a timed interrupt service function, and therefore the PWM signal can be output in an analog mode. In the embodiment of the invention, the high-low level inversion of the output signal can be realized in the timer interrupt service function by changing the size of the counting reload value of the timer, and the PWM signal with adjustable output frequency is simulated.
Step S102, collecting an output frequency value of the analog output Pulse Width Modulation (PWM) signal.
Optionally, the step of acquiring an output frequency value of the analog output PWM signal includes: adopting an edge triggering mode to acquire the duration of high and low levels of an analog output PWM signal; and calculating to obtain the output frequency of the current analog output PWM signal by adopting a preset frequency calculation formula based on the duration.
According to the embodiment of the invention, self-feedback acquisition can be carried out on the PWM signal based on the analog output of the timer, and the frequency precision adjustment of the analog output PWM signal is realized.
As an optional embodiment of the present invention, the analog output PWM signal is input to a control port of the single chip with an input capture function, and the analog PWM signal is self-fed and collected by using the input capture function of the single chip.
The method comprises the steps of acquiring duration t of high and low levels of an analog PWM signal in an edge triggering mode, and calculating the output frequency of the current analog output PWM signal through a preset frequency calculation formula f which is 1/2t, wherein f is used for indicating the frequency of the analog output PWM signal.
And step S104, judging whether the output frequency value is consistent with the frequency setting value or not to obtain a judgment result.
The acquired signal frequency is compared with a preset frequency setting value (i.e., the output frequency required to be set).
Optionally, after determining whether the output frequency value is consistent with the frequency setting value and obtaining a determination result, the adjusting method further includes: and if the judgment result indicates that the output frequency value is consistent with the frequency setting value, maintaining the current output frequency of the analog output PWM signal.
And step S106, if the judgment result indicates that the output frequency value is inconsistent with the frequency setting value, adjusting the output frequency of the analog output PWM signal.
Optionally, the step of adjusting the output frequency of the analog output PWM signal includes: and if the judgment result indicates that the output frequency value is greater than the frequency setting value, increasing the counting reload value of the timer by adopting the first unit numerical value so as to prolong the interrupted triggering period of the timer and reduce the output frequency of the PWM signal.
When the frequency of the collected signal is higher than the frequency setting value, the triggering period of timer interruption is prolonged by increasing the size of the counting reload value of the timer, so as to achieve the purpose of reducing the PWM output frequency.
Alternatively, the step of adjusting the output frequency of the analog output PWM signal further includes: and if the judgment result indicates that the output frequency value is lower than the frequency setting value, reducing the counting reloading value of the timer by adopting a second unit numerical value so as to shorten the interrupt triggering period of the timer and improve the output frequency of the PWM signal.
When the frequency of the collected signal is lower than the frequency setting value, the size of the counting reloading value of the timer is reduced, so that the interruption triggering period of the timer is shortened, and the purpose of improving the PWM output frequency is achieved.
In the embodiment of the invention, the interrupt trigger frequency of the timer is changed by changing the reloading value of the timer, so that the frequency of the timer for simulating and outputting the PWM square wave signal is changed; when the timer adopts manual loading to reload the value, because the assignment code occupies a certain execution time, the frequency of the analog output PWM signal has an error (the error is more obvious when the system clock frequency is lower).
In the embodiment of the present invention, when adjusting the magnitude of the reload value of the timer, the first unit value and the second unit value may be set to increase or decrease the reload value of the timer in units of arabic numbers (e.g., 1, 2, 3, 5, etc.), so that the sensitivity to the frequency accuracy adjustment of the analog output PWM signal is higher.
Optionally, after adjusting the output frequency of the analog output PWM signal, the adjusting method further includes: acquiring frequency demand precision; judging whether the frequency after the output frequency of the analog output PWM signal is adjusted meets the frequency precision requirement or not to obtain a judgment result; and if the judgment result indicates that the frequency of the output PWM signal does not meet the frequency precision requirement, continuously adjusting the output frequency of the analog output PWM signal.
According to the embodiment of the invention, the frequency of the analog output PWM signal meets the requirement on the output frequency by continuously repeating the self-feedback regulation action, so that the frequency precision requirement on the PWM output signal in the application process is met.
Through the embodiment, when the PWM signal output module cannot output a broadband PWM signal meeting the requirement due to the limitation of the performance of a single chip microcomputer and the like, the broadband PWM signal is output in an analog mode by adopting a mode of outputting the PWM signal based on a timer in an analog mode, self-feedback acquisition (signal output frequency acquisition) is carried out on the PWM signal output in the analog mode, and the frequency precision of the analog output PWM signal is improved in a self-feedback adjusting mode so as to meet the frequency precision requirement of the PWM output signal in the application process.
The invention is described below in connection with an alternative embodiment.
Example two
The embodiments of the present invention relate to an adjusting apparatus for signal output frequency, and each implementation unit involved in the adjusting apparatus corresponds to each implementation step in the first embodiment.
Fig. 2 is a schematic diagram of an alternative signal output frequency adjusting apparatus according to an embodiment of the present invention, and as shown in fig. 2, the adjusting apparatus may include: an acquisition unit 21, a judgment unit 23, an adjustment unit 25, wherein,
the acquisition unit 21 is used for acquiring an output frequency value of the analog output Pulse Width Modulation (PWM) signal;
the judging unit 23 is configured to judge whether the output frequency value is consistent with the frequency setting value, and obtain a judgment result;
and an adjusting unit 25, configured to adjust the output frequency of the analog output PWM signal when the determination result indicates that the output frequency value is inconsistent with the frequency setting value.
The signal output frequency adjusting device can acquire the output frequency value of the analog output Pulse Width Modulation (PWM) signal through the acquisition unit 21, judge whether the output frequency value is consistent with the frequency setting value through the judgment unit 23 to obtain a judgment result, and adjust the output frequency of the analog output PWM signal through the adjustment unit 25 when the judgment result indicates that the output frequency value is inconsistent with the frequency setting value. In this embodiment, when the PWM signal output module cannot achieve broadband output of the PWM signal, self-feedback acquisition may be performed on the PWM signal that is output based on the timer simulation, and then the output frequency of the analog output PWM signal is automatically adjusted to adjust the accuracy of the signal output frequency, thereby solving the technical problem of a large error in the output frequency when the PWM signal is output based on the timer simulation in the related art.
Optionally, the device for adjusting the signal output frequency further includes: the acquisition unit is used for acquiring a frequency setting value of the PWM signal to be output before acquiring an output frequency value of the analog output PWM signal; and the control unit is used for controlling the timer to simulate and output the PWM signal to a preset singlechip, wherein the preset singlechip is provided with a control port with an input capturing function.
Another optional, the acquisition unit comprises: the first acquisition module is used for acquiring the duration of high and low levels of an analog output PWM signal in an edge triggering mode; and the first calculation module is used for calculating the output frequency of the current analog output PWM signal by adopting a preset frequency calculation formula based on the duration.
Optionally, the device for adjusting the signal output frequency further includes: and the maintaining unit is used for maintaining the current output frequency of the analog output PWM signal if the judging result indicates that the output frequency value is consistent with the frequency setting value after judging whether the output frequency value is consistent with the frequency setting value or not and obtaining the judging result.
Optionally, the adjusting unit includes: and the increasing module is used for increasing the counting reloading value of the timer by adopting the first unit numerical value when the judgment result indicates that the output frequency value is greater than the frequency setting value, so that the interrupt triggering period of the timer is prolonged, and the output frequency of the PWM signal is reduced.
Optionally, the adjusting unit further includes: and the reducing module is used for reducing the counting reloading value of the timer by adopting a second unit numerical value if the judging result indicates that the output frequency value is lower than the frequency setting value, so that the interrupt triggering period of the timer is shortened, and the output frequency of the PWM signal is improved.
Alternatively, the device for adjusting the signal output frequency further includes: the first acquisition module is used for acquiring the frequency demand precision after adjusting the output frequency of the analog output PWM signal; the first judgment module is used for judging whether the frequency after the output frequency of the analog output PWM signal is adjusted meets the frequency precision requirement or not to obtain a judgment result; and the adjusting module is used for indicating that the frequency of the output PWM signal does not meet the frequency precision requirement according to the judgment result, and continuously adjusting the output frequency of the analog output PWM signal.
The above-mentioned adjusting device for signal output frequency may further include a processor and a memory, the above-mentioned acquisition unit 21, the judgment unit 23, the adjustment unit 25, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls a corresponding program unit from the memory. The kernel can be set to be one or more, and the output frequency of the analog output PWM signal is adjusted by adjusting the kernel parameter when the judgment result indicates that the output frequency value is inconsistent with the frequency setting value.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a single chip microcomputer; the memory is used for storing the executable instruction of the singlechip; wherein the single chip microcomputer is configured to execute the signal output frequency adjusting method of any one of the above items via executing the executable instructions.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, which includes a stored computer program, wherein when the computer program runs, the apparatus where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned signal output frequency adjusting methods.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: acquiring an output frequency value of an analog output Pulse Width Modulation (PWM) signal; judging whether the output frequency value is consistent with the frequency setting value or not to obtain a judgment result; and if the judgment result indicates that the output frequency value is inconsistent with the frequency setting value, adjusting the output frequency of the analog output PWM signal.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method of adjusting a signal output frequency, comprising:
acquiring an output frequency value of an analog output Pulse Width Modulation (PWM) signal;
judging whether the output frequency value is consistent with a frequency setting value or not to obtain a judgment result;
and if the judgment result indicates that the output frequency value is inconsistent with the frequency setting value, adjusting the output frequency of the analog output PWM signal.
2. The conditioning method of claim 1, wherein prior to collecting the output frequency value of the analog output PWM signal, the conditioning method further comprises:
acquiring a frequency setting value of a PWM signal to be output;
and controlling the timer to output a PWM signal to a preset singlechip in an analog mode, wherein the preset singlechip is provided with a control port with an input capturing function.
3. The method of adjusting of claim 2, wherein the step of collecting an output frequency value of the analog output PWM signal comprises:
adopting an edge triggering mode to acquire the duration of high and low levels of an analog output PWM signal;
and calculating to obtain the output frequency of the current analog output PWM signal by adopting a preset frequency calculation formula based on the duration.
4. The adjustment method according to claim 1, wherein after determining whether the output frequency value coincides with a frequency setting value, the adjustment method further comprises:
and if the judgment result indicates that the output frequency value is consistent with the frequency setting value, maintaining the current output frequency of the analog output PWM signal.
5. The method of adjusting of claim 1, wherein the step of adjusting the output frequency of the analog output PWM signal comprises:
and if the judgment result indicates that the output frequency value is greater than the frequency setting value, increasing the counting reload value of the timer by adopting a first unit numerical value so as to prolong the interrupt triggering period of the timer and reduce the output frequency of the PWM signal.
6. The method of adjusting of claim 5, wherein the step of adjusting the output frequency of the analog output PWM signal further comprises:
and if the judgment result indicates that the output frequency value is lower than the frequency setting value, reducing the counting reload value of the timer by adopting a second unit numerical value so as to shorten the interrupt triggering period of the timer and improve the output frequency of the PWM signal.
7. The regulation method of claim 1, wherein after adjusting the output frequency of the analog output PWM signal, the regulation method further comprises:
acquiring frequency demand precision;
judging whether the frequency after the output frequency of the analog output PWM signal is adjusted meets the frequency precision requirement or not to obtain a judgment result;
and if the judgment result indicates that the frequency of the output PWM signal does not meet the frequency precision requirement, continuously adjusting the output frequency of the analog output PWM signal.
8. An apparatus for adjusting a signal output frequency, comprising:
the acquisition unit is used for acquiring the output frequency value of the analog output Pulse Width Modulation (PWM) signal;
the judging unit is used for judging whether the output frequency value is consistent with a frequency setting value or not to obtain a judging result;
and the adjusting unit is used for adjusting the output frequency of the analog output PWM signal when the judgment result indicates that the output frequency value is inconsistent with the frequency setting value.
9. An electronic device, comprising:
a single chip microcomputer; and
the memory is used for storing the executable instruction of the single chip microcomputer;
wherein the single chip microcomputer is configured to execute the signal output frequency adjusting method of any one of claims 1 to 7 via execution of the executable instructions.
10. A computer-readable storage medium, comprising a stored computer program, wherein when the computer program runs, the computer-readable storage medium controls an apparatus to execute the method for adjusting the signal output frequency according to any one of claims 1 to 7.
CN202011567632.8A 2020-12-25 2020-12-25 Signal output frequency adjusting method and device and electronic equipment Pending CN112737549A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011567632.8A CN112737549A (en) 2020-12-25 2020-12-25 Signal output frequency adjusting method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011567632.8A CN112737549A (en) 2020-12-25 2020-12-25 Signal output frequency adjusting method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN112737549A true CN112737549A (en) 2021-04-30

Family

ID=75616720

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011567632.8A Pending CN112737549A (en) 2020-12-25 2020-12-25 Signal output frequency adjusting method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112737549A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114221642A (en) * 2022-02-22 2022-03-22 浙江地芯引力科技有限公司 PWM wave generation and duty ratio control method, device, timer and equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0746094A (en) * 1993-07-30 1995-02-14 Sony Corp Pulse width modulation circuit
US20100090775A1 (en) * 2008-10-09 2010-04-15 Muzahid Bin Huda Method and Apparatus for Dynamic Modulation
CN102082511A (en) * 2009-11-27 2011-06-01 立锜科技股份有限公司 Fixed frequency control circuit for pulse width modulation and method thereof
CN102307044A (en) * 2011-09-14 2012-01-04 深圳航天科技创新研究院 Switching power supply PWM (pulse width modulation) controller with variable frequencies
CN105915070A (en) * 2016-05-10 2016-08-31 东华大学 Ultrasonic frequency induction heating power supply device and digital control method thereof
CN111531892A (en) * 2020-05-28 2020-08-14 杭州电子科技大学 Non-contact ultrasonic phased array suspension 3D printing device and printing method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0746094A (en) * 1993-07-30 1995-02-14 Sony Corp Pulse width modulation circuit
US20100090775A1 (en) * 2008-10-09 2010-04-15 Muzahid Bin Huda Method and Apparatus for Dynamic Modulation
CN102082511A (en) * 2009-11-27 2011-06-01 立锜科技股份有限公司 Fixed frequency control circuit for pulse width modulation and method thereof
CN102307044A (en) * 2011-09-14 2012-01-04 深圳航天科技创新研究院 Switching power supply PWM (pulse width modulation) controller with variable frequencies
CN105915070A (en) * 2016-05-10 2016-08-31 东华大学 Ultrasonic frequency induction heating power supply device and digital control method thereof
CN111531892A (en) * 2020-05-28 2020-08-14 杭州电子科技大学 Non-contact ultrasonic phased array suspension 3D printing device and printing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114221642A (en) * 2022-02-22 2022-03-22 浙江地芯引力科技有限公司 PWM wave generation and duty ratio control method, device, timer and equipment

Similar Documents

Publication Publication Date Title
WO2005066868A3 (en) Sleep and environment control method and system
CN108875013B (en) Method and device for processing map data
CN111681125B (en) Top plate pressure calculation method, storage medium, and electronic apparatus
CN109974059B (en) Range hood wind pressure detection control method, device, equipment and storage medium
US20180231943A1 (en) Control device
CN112379764B (en) Chip working voltage control method and device, processing chip and server
CN105022686B (en) The CPU usage of process determines method and apparatus on Android platform
CN112737549A (en) Signal output frequency adjusting method and device and electronic equipment
CN110737587B (en) Test method and device based on test case, storage medium and server
CN111199146B (en) Test report generation method, device, computer equipment and storage medium
CN110008049A (en) A kind of data correcting method based on internet platform, terminal device and medium
EP3557187A1 (en) Automatic filtering method and device
JP4452722B2 (en) Method and apparatus for generating a delay using a counter
CN107506067B (en) Method and device for debugging working frequency of touch screen and terminal equipment
CN109379479B (en) Performance test method and device for built-in sensor of mobile terminal
CN111036314A (en) Temperature and humidity test chamber control method and device, medium and temperature and humidity test chamber
CN111812445B (en) Intelligent capacitor error correction method and device, computer equipment and storage medium
CN108870489A (en) Push-rod electric machine adaptively stalls method, apparatus and storage medium, equipment
EP1378998A1 (en) Method of operating a microcontroller chip having an internal RC oscillator, and microcontroller chip embodying the method
JP6493904B2 (en) Parameter selection method, parameter selection program, and parameter selection device
CN107562266B (en) Capacitive screen calibration method and device and terminal equipment
CN110932622A (en) Method for overcoming motor shake
CN110855759A (en) Method and system for dynamically adjusting game downloading
JP6879203B2 (en) Data processing equipment, data processing methods, and programs
CN110188491B (en) Processing method and device for improving calculation efficiency in simulation calculation process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination