A pulse width modulation signal generation device, chip and method
By designing a pulse width modulation signal generation device and utilizing a pre-configured variable parameter and signal parameter determination module, the period length and duty cycle of the PWM signal are automatically adjusted, solving the problem of high system power consumption and achieving flexible adjustment and low power consumption without processor intervention.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CIX TECH (SHANGHAI) CO LTD
- Filing Date
- 2026-06-09
- Publication Date
- 2026-07-10
AI Technical Summary
In existing technologies, after the period and duty cycle of the PWM signal are configured, the processor needs to communicate again to modify them before they can be adjusted, resulting in high system power consumption and the inability to enter the shutdown state or be woken up.
A pulse width modulation (PWM) signal generation device is designed, including a signal generation module, a variable parameter configuration module, a signal parameter determination module, and a variable parameter update module. Through the pre-configured variable parameters and the signal parameter determination module, the period length and duty cycle of the PWM signal are automatically adjusted, achieving flexible adjustment without processor intervention.
It enables flexible adjustment of the PWM signal period length and duty cycle without processor intervention, reducing system power consumption and supporting the processor to enter shutdown or sleep mode, thereby reducing unnecessary power consumption.
Smart Images

Figure CN122371946A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of integrated circuit technology, and in particular to a pulse width modulation signal generation device, chip, and method. Background Technology
[0002] Currently, programmable duty cycle PWM (Pulse Width Modulation) signals are widely used in various control circuits, such as motor speed control, audio signal processing, fan speed control, temperature control, battery charging, and sensor signal conditioning.
[0003] The processor can communicate with a PWM signal generator to configure the period and duty cycle of the PWM signal. However, once the period and duty cycle of the PWM signal are configured, the PWM signal generator can only generate the PWM signal according to the configured period and duty cycle. If the period and / or duty cycle of the PWM signal needs to be adjusted, the processor needs to communicate with the PWM signal generator again to modify the configured values of the period and / or duty cycle. This results in the processor being unable to enter a shutdown state, or even if it does enter a shutdown state, it will be woken up again, thus leading to high system power consumption. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a pulse width modulation signal generation apparatus, chip, and method to facilitate the reduction of system power consumption.
[0005] In a first aspect, embodiments of the present invention provide a pulse width modulation (PWM) signal generation apparatus, comprising: a signal generation module, a variation parameter configuration module, and a signal parameter determination module; the variation parameter configuration module is coupled to the signal generation module and the signal parameter determination module respectively, and is configured to send pre-configured variation parameters to the signal parameter determination module in response to the end of each cycle of the PWM signal generated by the signal generation module, the variation parameters including a cycle length variation parameter and / or a duty cycle variation indication parameter of the PWM signal; the variation parameter configuration module includes a register for storing the variation parameters, the variation parameters being pre-configured by a processor; the variation parameters are selected from a plurality of pre-configured and stored alternative parameters; the signal parameter determination module is coupled to the variation parameter configuration module and is configured to receive the variation parameters and determine the signal parameters of the next cycle of the PWM signal based on the variation parameters; the signal parameters include a cycle length and / or a duty cycle indication parameter; the signal generation module is coupled to the signal parameter determination module and is configured to determine the signal parameters of the next cycle of the PWM signal based on the variation parameters. A signal parameter for one cycle generates a pulse width modulation (PWM) signal for the next cycle. The changing parameter includes a changing mode indicator bit and a changing feature indicator bit under the changing mode. The PWM signal generation device further includes a changing parameter update module, coupled to the signal generation module, configured to record the duration of the PWM signal generated by the signal generation module corresponding to the changing parameter, and update the changing parameter if the duration exceeds a preset duration threshold to obtain the updated changing parameter. Updating the changing parameter includes: selecting a new changing parameter from a plurality of candidate parameters, or updating the changing mode indicator bit and / or the changing feature indicator bit under the changing mode in the changing parameter to obtain the updated changing parameter. Updating the changing mode indicator bit includes increasing or decreasing the changing mode indicator bit by a preset value. The changing parameter configuration module is further configured to send the updated changing parameter to the signal parameter determination module in response to the end of each cycle of the PWM signal generated by the signal generation module.
[0006] In one embodiment, the variable parameter configuration module includes at least one of the following: a period length variation configuration submodule, configured to send a pre-configured period length variation parameter to the signal parameter determination module in response to the end of each period of the pulse width modulation signal generated by the signal generation module; and a duty cycle variation configuration submodule, configured to send a pre-configured duty cycle variation indication parameter to the signal parameter determination module in response to the end of each period of the pulse width modulation signal generated by the signal generation module.
[0007] In one embodiment, the variable parameter configuration module includes a period length variable configuration submodule; the signal parameter includes the period length; the signal parameter determination module includes a period length determination submodule, the period length determination submodule being coupled to the period length variable configuration submodule and configured to determine the period length of the next period of the pulse width modulation signal based on the period length variable parameter sent by the period length variable configuration submodule.
[0008] In one embodiment, the cycle length determination submodule is configured to determine the cycle length of the next cycle of the pulse width modulation signal based on the cycle length variation parameter and the cycle length of the most recently ended cycle of the pulse width modulation signal, thereby obtaining a target length.
[0009] In one embodiment, the signal generation module is coupled to the period length determination submodule and is configured to receive the target length sent by the period length determination submodule, and generate a pulse width modulation signal for the next period based on the target length, such that the period length of the pulse width modulation signal for the next period is equal to the target length.
[0010] In one embodiment, the duty cycle change indication parameter is used to represent the change in the duration of the high level in one cycle of the pulse width modulation signal; the duty cycle indication parameter is used to represent the duration of the high level in one cycle of the pulse width modulation signal; the change parameter configuration module includes a duty cycle change configuration submodule; the signal parameter includes the duty cycle indication parameter; the signal parameter determination module includes a duty cycle determination submodule, the duty cycle determination submodule is coupled to the duty cycle change configuration submodule, and is configured to determine the duty cycle indication parameter for the next cycle of the pulse width modulation signal based on the duty cycle change indication parameter sent by the duty cycle change configuration submodule.
[0011] In one implementation, the duty cycle determination submodule is configured to determine the duty cycle indication parameter for the next period of the pulse width modulation signal based on the duty cycle change indication parameter and the duty cycle indication parameter for the most recently ended period of the pulse width modulation signal, thereby obtaining a target duty cycle indication parameter.
[0012] In one embodiment, the signal generation module is coupled to the duty cycle determination submodule and configured to receive the target duty cycle indication parameter and generate the pulse width modulation signal for the next cycle based on the target duty cycle indication parameter.
[0013] In one embodiment, the duty cycle change indication parameter is used to represent the change in the duration of the high level in one cycle of the pulse width modulation signal; the duty cycle indication parameter is used to represent the duration of the high level in one cycle of the pulse width modulation signal; the signal generation module includes a counting submodule and a comparison submodule; the cycle length determined by the signal parameter determination module is represented as the counting cycle value of the counting submodule; the duty cycle indication parameter determined by the signal parameter determination module is represented as a first count value indication of the counting submodule; wherein, the first count value is greater than or equal to the initial count value of the counting submodule and less than the initial count value and the counting cycle value. The counting submodule, coupled to the signal parameter determination module, is configured to perform a counting operation based on the counting period value of the next period; the comparison submodule, coupled to both the signal parameter determination module and the counting submodule, is configured to compare the current count value of the counting submodule with the first count value, and output a first level if the current count value is less than the first count value, or output a second level if the current count value is greater than or equal to the first count value, wherein the first level and the second level form the pulse width modulation signal of the next period, and the first level is the logical inversion of the second level.
[0014] In one embodiment, the variation parameter includes a variation mode indicator bit of the signal parameter and a variation feature indicator bit of the variation mode.
[0015] In one embodiment, the variation mode includes any one of the following: a first variation mode, used to indicate that the signal parameter, within a preset range, increases by a first preset value in each cycle compared to the previous cycle; or used to indicate that, when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; wherein, the first variation mode is indicated by the variation mode indicator bit, and the first preset value is indicated by the variation feature indicator bit; a second variation mode, used to indicate that the signal parameter, within the preset range, decreases by a second preset value in each cycle compared to the previous cycle; or used to indicate that, when the signal parameter is outside the preset range... The signal parameter is set to a specified value within the preset range; wherein the second change mode is indicated by the change mode indicator bit, and the second preset value is indicated by the change feature indicator bit; a third change mode is used to indicate that the signal parameter is within the preset range, and each cycle is k times the previous cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein the third change mode is indicated by the change mode indicator bit, and k is indicated by the change feature indicator bit, where k is a positive integer; a fourth change mode is used to indicate that the signal parameter is within the preset range, and each cycle is k times the previous cycle. The period is one-nth of the previous period; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; wherein, the fourth change mode is indicated by the change mode indicator bit, and n is indicated by the change feature indicator bit, where n is a positive integer; the fifth change mode is used to indicate the increase in the length of each period relative to the length of the previous period for the signal parameter within the preset range, starting from a preset initial value, and increasing by a fifth preset value each period; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; In the above, the fifth change mode is indicated by the change mode indicator bit, and the preset initial value of the increase and the fifth preset value are indicated by the change feature indicator bit; the sixth change mode is used to indicate the reduction of the signal parameter in each cycle length relative to the cycle length of the previous cycle within the preset range, starting from the preset initial value of the reduction, and decreasing by the sixth preset value in each cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; wherein, the sixth change mode is indicated by the change mode indicator bit, and the preset initial value of the reduction and the sixth preset value are indicated by the change feature indicator bit.
[0016] Secondly, embodiments of the present invention also provide a chip, including any of the pulse width modulation signal generation devices provided in embodiments of the present invention.
[0017] Thirdly, embodiments of the present invention also provide a method for generating a pulse width modulation (PWM) signal, comprising: responding to the end of each cycle of the generated PWM signal, providing pre-configured variation parameters, the variation parameters including a cycle length variation parameter and / or a duty cycle variation indication parameter of the PWM signal; the variation parameters being pre-configured by a processor and stored in a register; the variation parameters being selected from a plurality of pre-configured and stored alternative parameters; determining signal parameters for the next cycle of the PWM signal based on the variation parameters; the signal parameters including a cycle length and / or a duty cycle indication parameter; generating a PWM signal for the next cycle based on the signal parameters of the next cycle; and recording the PWM signal corresponding to the variation parameters. If the duration of the pulse width modulation signal exceeds a preset duration threshold, the change parameters are updated to obtain updated change parameters. The change parameters include a change mode indicator bit and a change feature indicator bit under the change mode. Updating the change parameters includes: selecting a new parameter from a plurality of candidate parameters as the updated change parameter, or updating the change mode indicator bit and / or the change feature indicator bit under the change mode in the change parameters to obtain updated change parameters. Updating the change mode indicator bit includes increasing or decreasing the change mode indicator bit by a preset value. The updated change parameters are provided in response to the end of each cycle of the pulse width modulation signal.
[0018] In one embodiment, providing a pre-configured variation parameter in response to the end of each cycle of the generated pulse width modulation signal includes: providing a pre-configured cycle length variation parameter in response to the end of each cycle of the generated pulse width modulation signal; determining the signal parameter of the next cycle of the pulse width modulation signal based on the variation parameter includes: determining the cycle length of the next cycle of the pulse width modulation signal based on the cycle length variation parameter.
[0019] In one embodiment, determining the period length of the next period of the pulse width modulation signal based on the period length variation parameter includes: determining the period length of the next period of the pulse width modulation signal based on the period length variation parameter and the period length of the most recently ended period of the pulse width modulation signal, thereby obtaining a target length.
[0020] In one embodiment, generating the pulse width modulation signal of the next period based on the signal parameters of the next period includes: generating the pulse width modulation signal of the next period based on the target length, such that the period length of the pulse width modulation signal of the next period is equal to the target length.
[0021] In one embodiment, the duty cycle change indication parameter is used to represent the change in the duration of the high level in one cycle of the pulse width modulation signal; the duty cycle indication parameter is used to represent the duration of the high level in one cycle of the pulse width modulation signal; providing a pre-configured change parameter in response to the end of each cycle of the generated pulse width modulation signal includes: providing the pre-configured duty cycle change indication parameter in response to the end of each cycle of the generated pulse width modulation signal; determining the signal parameter of the next cycle of the pulse width modulation signal based on the change parameter includes: determining the duty cycle indication parameter of the next cycle of the pulse width modulation signal based on the duty cycle change indication parameter.
[0022] In one embodiment, determining the duty cycle indication parameter for the next period of the pulse width modulation signal based on the duty cycle change indication parameter includes: determining the duty cycle indication parameter for the next period of the pulse width modulation signal based on the duty cycle change indication parameter and the duty cycle indication parameter for the most recently ended period of the pulse width modulation signal, thereby obtaining a target duty cycle indication parameter.
[0023] In one embodiment, generating the pulse width modulation signal for the next period based on the signal parameters of the next period includes: generating the pulse width modulation signal for the next period based on the target duty cycle indication parameter.
[0024] In one embodiment, the duty cycle change indicator parameter is used to indicate the change in the duration of the high level in one cycle of the pulse width modulation signal; the duty cycle indicator parameter is used to indicate the duration of the high level in one cycle of the pulse width modulation signal; the cycle length is represented as the counting cycle value of the counter; the duty cycle indicator parameter is represented as a first count value indicator of the counter; wherein, the first count value is greater than or equal to the initial count value of the counting submodule and less than the sum of the initial count value and the counting cycle value; generating the pulse width modulation signal of the next cycle according to the signal parameters of the next cycle includes: performing a counting operation according to the counting cycle value of the counter in the next cycle; comparing the current count value of the counter with the first count value, outputting a first level when the current count value is less than the first count value, or outputting a second level when the current count value is greater than or equal to the first count value, the first level and the second level forming the pulse width modulation signal of the next cycle, wherein the first level is the logical inversion of the second level.
[0025] In one embodiment, the variation mode includes any one of the following: a first variation mode, used to indicate that the signal parameter, within a preset range, increases by a first preset value in each cycle compared to the previous cycle; or used to indicate that, when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; wherein, the first variation mode is indicated by the variation mode indicator bit, and the first preset value is indicated by the variation feature indicator bit; a second variation mode, used to indicate that the signal parameter, within the preset range, decreases by a second preset value in each cycle compared to the previous cycle; or used to indicate that, when the signal parameter is outside the preset range... The signal parameter is set to a specified value within the preset range; wherein the second change mode is indicated by the change mode indicator bit, and the second preset value is indicated by the change feature indicator bit; a third change mode is used to indicate that the signal parameter is within the preset range, and each cycle is k times the previous cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein the third change mode is indicated by the change mode indicator bit, and k is indicated by the change feature indicator bit, where k is a positive integer; a fourth change mode is used to indicate that the signal parameter is within the preset range, and each cycle is k times the previous cycle. The period is one-nth of the previous period; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; wherein, the fourth change mode is indicated by the change mode indicator bit, and n is indicated by the change feature indicator bit, where n is a positive integer; the fifth change mode is used to indicate the increase in the length of each period relative to the length of the previous period for the signal parameter within the preset range, starting from a preset initial value, and increasing by a fifth preset value each period; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; In the above, the fifth change mode is indicated by the change mode indicator bit, and the preset initial value of the increase and the fifth preset value are indicated by the change feature indicator bit; the sixth change mode is used to indicate the reduction of the signal parameter in each cycle length relative to the cycle length of the previous cycle within the preset range, starting from the preset initial value of the reduction, and decreasing by the sixth preset value in each cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; wherein, the sixth change mode is indicated by the change mode indicator bit, and the preset initial value of the reduction and the sixth preset value are indicated by the change feature indicator bit.
[0026] The pulse width modulation (PWM) signal generation apparatus, chip, and method provided in the embodiments of the present invention are capable of sending pre-configured variation parameters to a signal parameter determination module in response to the end of each cycle of the PWM signal generated by the signal generation module. The signal parameter determination module can receive the variation parameters and determine the signal parameters for the next cycle of the PWM signal based on the variation parameters. The signal generation module can then generate the PWM signal for the next cycle based on the signal parameters for the next cycle. In this way, signal parameters such as the cycle length and / or duty cycle indication parameters of the next cycle of the PWM signal can be determined based on the pre-configured cycle length variation parameters and / or duty cycle variation indication parameters. That is, the cycle length and / or duty cycle indication parameters of the next cycle of the PWM signal are variable. Correspondingly, the cycle length and / or duty cycle indication parameters of the PWM signal generated based on the signal parameters for the next cycle are also variable. This allows the cycle length and / or duty cycle of the PWM signal to be changed without processor intervention, thereby facilitating the processor to enter a shutdown or sleep state and reducing system power consumption. Furthermore, the parameter update module can also record the duration of the pulse width modulation signal corresponding to the parameter change generated by the signal generation module. If the duration exceeds a preset duration threshold, the parameter change is updated to obtain the updated parameter change. Updating the parameter change includes: selecting a new parameter from a plurality of candidate parameters as the updated parameter change, or updating the change mode indicator bit and / or the change feature indicator bit under the change mode in the parameter change to obtain the updated parameter change. Updating the change mode indicator bit includes increasing or decreasing the change mode indicator bit by a preset value. In this way, the pulse width modulation signal generation device can automatically update the parameter change without the participation of external devices, thereby improving the flexibility of signal generation and facilitating further reduction of system power consumption. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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.
[0028] Figure 1 A schematic diagram of a pulse width modulation signal generation apparatus provided for an embodiment of the present invention; Figure 2A schematic diagram of a variable parameter configuration submodule in a pulse width modulation signal generation device provided in an embodiment of the present invention; Figure 3 Another schematic diagram of the pulse width modulation signal generation device provided for an embodiment of the present invention; Figure 4 A schematic diagram of another structure of a pulse width modulation signal generation device provided for an embodiment of the present invention; Figure 5 A schematic diagram of another structure of the pulse width modulation signal generation apparatus provided in an embodiment of the present invention; Figure 6 A schematic diagram of a chip structure provided for an embodiment of the present invention; Figure 7 A flowchart illustrating a method for generating a pulse width modulation signal according to an embodiment of the present invention. Detailed Implementation
[0029] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0030] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0031] In a first aspect, embodiments of the present invention provide a pulse width modulation signal generation apparatus, which facilitates effective reduction of system power consumption.
[0032] like Figure 1 As shown, the pulse width modulation signal generation device provided in the embodiment of the present invention may include: a signal generation module 11, a variable parameter configuration module 12, and a signal parameter determination module 13; The variable parameter configuration module 12, coupled to the signal generation module 11 and the signal parameter determination module 13 respectively, is configured to send pre-configured variable parameters to the signal parameter determination module 13 in response to the end of each cycle of the pulse width modulation signal generated by the signal generation module 11. The variable parameters include a cycle length variation parameter and / or a duty cycle variation indication parameter of the pulse width modulation signal. The variable parameter configuration module 12 includes a register for storing the variable parameters, which are pre-configured by the processor. The variable parameters are selected from a plurality of pre-configured and stored alternative parameters. The signal parameter determination module 13, coupled to the variable parameter configuration module 12, is configured to receive the variable parameters and determine the signal parameters of the next period of the pulse width modulation signal based on the variable parameters; the signal parameters include period length and / or duty cycle indication parameters. The signal generation module 11, coupled to the signal parameter determination module 13, is configured to generate a pulse width modulation signal for the next cycle based on the signal parameters of the next cycle.
[0033] The change parameters include a change mode indicator bit for the signal parameters and a change feature indicator bit for the change mode; The pulse width modulation signal generation device further includes: a variable parameter update module 14, coupled to the signal generation module 11, configured to record the duration of the pulse width modulation signal corresponding to the variable parameter generated by the signal generation module, and update the variable parameter when the duration exceeds a preset duration threshold to obtain an updated variable parameter; wherein updating the variable parameter includes: reselecting one from a plurality of candidate parameters as the updated variable parameter, or updating the change mode indicator bit and / or the change feature indicator bit under the change mode in the variable parameter to obtain an updated variable parameter; wherein updating the change mode indicator bit includes increasing or decreasing the change mode indicator bit by a preset value; The variable parameter configuration module 12 is further configured to send the updated variable parameters to the signal parameter determination module 13 in response to the end of each cycle of the pulse width modulation signal generated by the signal generation module.
[0034] The pulse width modulation (PWM) signal generation apparatus provided in the embodiments of the present invention has a parameter configuration module 12 that, in response to the end of each cycle of the PWM signal generated by the signal generation module 11, sends pre-configured variable parameters to a signal parameter determination module 13. The signal parameter determination module 13 receives the variable parameters and determines the signal parameters for the next cycle of the PWM signal based on these parameters. The signal generation module 11 then generates the PWM signal for the next cycle based on these signal parameters. In this way, signal parameters such as the cycle length and / or duty cycle indication parameter of the next cycle of the PWM signal can be determined based on the pre-configured cycle length variable parameters and / or duty cycle variable parameters. That is, the cycle length and / or duty cycle indication parameter of the next cycle of the PWM signal can be varied. Correspondingly, the cycle length and / or duty cycle indication parameter of the PWM signal generated based on the signal parameters for the next cycle can also be varied. This allows the cycle length and / or duty cycle of the PWM signal to be changed without processor intervention, thereby facilitating the processor to enter a shutdown or sleep state and reducing system power consumption. Furthermore, the parameter update module 14 can also record the duration of the pulse width modulation signal corresponding to the parameter change generated by the signal generation module 11. If the duration exceeds a preset duration threshold, the parameter change is updated to obtain the updated parameter change. Updating the parameter change includes: selecting a new parameter from a plurality of candidate parameters as the updated parameter change, or updating the change mode indicator bit and / or the change feature indicator bit under the change mode in the parameter change to obtain the updated parameter change. Updating the change mode indicator bit includes increasing or decreasing the change mode indicator bit by a preset value. In this way, the pulse width modulation signal generation device can automatically update the parameter change without the participation of external devices, thereby improving the flexibility of signal generation and facilitating further reduction of system power consumption.
[0035] In embodiments of the present invention, the pulse width modulation (PWM) signal generation device can generate PWM signals with varying period lengths and / or duty cycles. Specifically, the signal generation module 11 can be used to generate PWM signals, where each period's PWM signal can consist of a high-level segment and a low-level segment. Depending on the duty cycle, the proportion of time occupied by the high and low levels within a period varies. Here, the duty cycle refers to the proportion of time the signal is at a high level within a period. Correspondingly, a change in the duty cycle refers to a change in this proportion.
[0036] For convenience, in one implementation, a duty cycle change indicator parameter can be used to indicate the change in duty cycle. Specifically, the duty cycle change indicator parameter can represent the change in the duration of the high level within one cycle of the pulse width modulation signal. This transforms the proportional parameter of duty cycle into a parameter that is easier to control and calculate: the duration of the high level and its change.
[0037] For example, in one instance, if the duty cycle change indicator parameter is increased by 20 nanoseconds, it means that the duration of the high level after the duty cycle change is 20 nanoseconds longer than before the change. In another instance, if the duty cycle indicator parameter is 50 nanoseconds, it means that the duration of the high level at the current duty cycle is 50 nanoseconds.
[0038] In one embodiment of the present invention, the period length of the pulse width modulation signal can be expressed as an integer multiple of a basic time unit. Based on this, the duty cycle can be calculated as the ratio of the number of basic time units contained in the high level within one period length to the total number of basic time units contained in one period length. Correspondingly, the duty cycle change indication parameter can be represented by the change in the number of basic time units contained in the high level within one period of the pulse width modulation signal. For example, if the basic time unit is 10 nanoseconds, a duty cycle change indication parameter indicating a 20 nanosecond increase in the high level duration can be represented as an increase of 5 basic time units. Similarly, the duty cycle indication parameter can be represented by the number of basic time units contained in the high level within one period of the pulse width modulation signal. For example, if the basic time unit is 10 nanoseconds, a duty cycle indication parameter indicating a 40 nanosecond high level duration can be represented as 4 basic time units.
[0039] Here, the basic time unit can refer to the smallest unit of time adjustment for a pulse width modulation (PWM) signal. The PWM signal and any adjustments thereof are integer multiples of this basic time unit. Understandably, since a high-level signal is part of a single-cycle PWM signal, the number of basic time units corresponding to the duty cycle is less than or equal to the number of basic time units corresponding to the cycle length.
[0040] In one embodiment of the present invention, the change parameter update module 14 may update only the change mode indicator bit in the change parameters, only the change feature indicator bit under the change mode, or both; the embodiments of the present invention do not limit this. Updating the change mode indicator bit includes increasing or decreasing the change mode indicator bit by a preset value, such as 1, 2, or 3. Each change mode may include one or more change feature indicator bits; when updating the change feature indicator bit, one or more of these bits may be updated.
[0041] In embodiments of the present invention, the variable parameter configuration module 12 can be used to store variable parameters of the pulse width modulation signal. In one example, the variable parameter configuration module 12 may include one or more registers, thereby storing the aforementioned variable parameters through these registers. The variable parameters in the variable parameter configuration module 12 can be pre-configured by the processor. After configuration, the pulse width modulation signal generation device can generate a pulse width modulation signal with variable period length and / or duty cycle according to the pre-configured variable parameters without further processor intervention.
[0042] Specifically, the aforementioned pre-configured variation parameters can be used to describe the variation characteristics of the pulse width modulation signal. These variation characteristics can be, for example, uniform change, accelerated change, decelerated change, etc. Optionally, in embodiments of the present invention, the variation parameters can be used to describe the variation characteristics of the period length, the variation characteristics of the duty cycle, or both the variation characteristics of the period length and the duty cycle. The embodiments of the present invention do not limit this.
[0043] like Figure 2 As shown, in one embodiment of the present invention, the variable parameter configuration module 12 may include one or more of the following: a period length variation configuration submodule 121 and a duty cycle variation configuration submodule 122. The period length variation configuration submodule 121 is configured to send a pre-configured period length variation parameter to the signal parameter determination module 13 in response to the end of each period of the pulse width modulation signal generated by the signal generation module 11; the duty cycle variation configuration submodule 122 is configured to send a pre-configured duty cycle variation indication parameter to the signal parameter determination module 13 in response to the end of each period of the pulse width modulation signal generated by the signal generation module 11.
[0044] The following description addresses the cases where the variable parameter configuration module 12 includes either the cycle length variation configuration submodule 121 or the duty cycle variation configuration submodule 122.
[0045] First, we will explain the case where the variable parameter configuration module 12 includes a period length variable configuration submodule 121.
[0046] like Figure 3 As shown, in one embodiment of the present invention, the variable parameter configuration module 12 includes a period length variation configuration submodule 121; correspondingly, the signal parameters include the period length. Based on this, the signal parameter determination module 13 includes a period length determination submodule 131, which is coupled to the period length variation configuration submodule 121 and configured to determine the period length of the next period of the pulse width modulation signal based on the period length variation parameters sent by the period length variation configuration submodule 121. That is, the period length of the next period of the pulse width modulation signal is related to the period length variation parameters provided by the period length variation configuration submodule 121.
[0047] Specifically, in one implementation, the period length determination submodule 131 is configured to determine the period length of the next period of the pulse width modulation signal based on the period length change parameter and the period length of the most recently ended period of the pulse width modulation signal, thereby obtaining a target length. For example, in one instance, the period length determination submodule 131 can interact with the signal generation module 11 to obtain the period length of the most recently ended period, and then determine the period length of the next period based on the period length of the most recently ended period and the period length change parameter, thus obtaining the target length. For instance, if the period length change parameter is an increase of 5 basic time units, and the period length of the most recently ended period of the pulse width modulation signal is 100 basic time units, then the period length of the next period of the pulse width modulation signal is 100 + 5 = 105 basic time units, i.e., the target length is 105 basic time units.
[0048] Based on this, in one embodiment of the present invention, the signal generation module 11 can be coupled to the period length determination submodule 131 and configured to receive the target length sent by the period length determination submodule 131, and generate a pulse width modulation signal for the next period according to the target length, so that the period length of the pulse width modulation signal for the next period is equal to the target length. For example, if the target length is 105 basic time units, then the period length of the pulse width modulation signal for the next period generated by the signal generation module 11 is also 105 basic time units.
[0049] The above describes the configuration module 12 for varying parameters, including the period length variation configuration submodule 121. The following describes the configuration module 12 for varying parameters, including the duty cycle variation configuration submodule 122.
[0050] like Figure 4As shown, in one embodiment, the variable parameter configuration module 12 includes a duty cycle change configuration submodule 122; correspondingly, the signal parameters include a duty cycle indication parameter. In an embodiment of the present invention, the duty cycle change configuration submodule 122 may be configured to send a pre-configured duty cycle change indication parameter to the signal parameter determination module 13 in response to the end of each cycle of the pulse width modulation signal generated by the signal generation module 11. The signal parameter determination module 13 is configured to receive the change parameter and determine the signal parameters of the next cycle of the pulse width modulation signal based on the change parameter. Here, the duty cycle change indication parameter may be used to represent the change in the duration of the high level in one cycle of the pulse width modulation signal; the duty cycle indication parameter may be used to represent the duration of the high level in one cycle of the pulse width modulation signal. Based on this, in one embodiment of the present invention, the signal parameter determination module 13 may include a duty cycle determination submodule 132, which may be coupled to the duty cycle change configuration submodule 122 and configured to determine the duty cycle indication parameter of the next period of the pulse width modulation signal based on the duty cycle change indication parameter sent by the duty cycle change configuration submodule 122. That is, in this embodiment of the present invention, the duty cycle indication parameter of the next period of the pulse width modulation signal is related to the duty cycle change indication parameter provided by the duty cycle change configuration submodule 122.
[0051] Specifically, in one implementation, the duty cycle determination submodule 132 is configured to determine the duty cycle indication parameter for the next cycle of the pulse width modulation signal based on the duty cycle change indication parameter and the duty cycle indication parameter of the most recently ended cycle of the pulse width modulation signal, thereby obtaining a target duty cycle indication parameter. For example, if the duty cycle change indication parameter is an increase of 10 time units, and the duty cycle indication parameter of the most recently ended cycle of the pulse width modulation signal is a high level containing 50 basic time units, then the duty cycle indication parameter for the next cycle of the pulse width modulation signal is a high level containing 50 + 10 = 60 basic time units, i.e., the target duty cycle indication parameter is 60 basic time units.
[0052] Based on this, in one embodiment of the present invention, the signal generation module 11 is coupled to the duty cycle determination submodule 132 and configured to receive the target duty cycle indication parameter, and generate a pulse width modulation signal for the next cycle based on the target duty cycle indication parameter, so that the duty cycle indication parameter of the pulse width modulation signal for the next cycle is equal to the target duty cycle indication parameter. For example, if the target duty cycle indication parameter is 60 basic time units, then the duty cycle indication parameter of the pulse width modulation signal for the next cycle generated by the signal generation module 11 is 60 basic time units.
[0053] The foregoing embodiments have provided a detailed description of the case where the variable parameter configuration module 12 includes a period length variation configuration submodule 121 or a duty cycle variation configuration submodule 122. It should be noted that, in the embodiments of the present invention, the pulse width modulation signal generated by the pulse width modulation signal generation device can adjust only the period length, only the duty cycle, or both. The embodiments of the present invention do not limit this.
[0054] Specifically, in embodiments of the present invention, the variation parameter configuration module 12 can indicate different variation parameters for signal parameters such as the period length and duty cycle indication parameter of the pulse width modulation signal. For example, in one implementation, the variation parameter may include a variation mode indication bit and a variation feature indication bit under the variation mode. For instance, in one example, the variation parameter includes 32 bits, where the highest two bits are the variation mode indication bits, and the remaining 30 bits are the variation feature indication bits. The variation mode indication bits are mainly used to distinguish different variation modes, while the variation feature indication bits are used to define the specific variation characteristics under that variation mode.
[0055] For example, in one embodiment of the present invention, the variation mode may include any of the following: A first change mode is used to indicate that the signal parameter is within a preset range, and each cycle increases by a first preset value compared to the previous cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; wherein, the first change mode is indicated by the change mode indicator bit, and the first preset value is indicated by the change feature indicator bit.
[0056] For example, in one scenario, the preset range is 0 to 99, and the first preset value is 20. If the signal parameter for the first cycle is 10, then the signal parameter for the second cycle is 10 + 20 = 30, the signal parameter for the third cycle is 30 + 20 = 50, and so on. When the signal parameter increases to 110, since 110 exceeds the preset range of 0 to 99, the signal parameter can be set to a specified value within the range of 0 to 99, such as 0. This allows the generation of a pulse width modulation (PWM) signal to continue based on the signal parameter, and the signal parameter for the next cycle of the PWM signal is determined by the variable parameter configuration module 12. This effectively prevents the signal parameter from increasing or decreasing indefinitely, thus confining the PWM signal within a certain range.
[0057] The second change mode is used to indicate that the signal parameter is within the preset range, and each cycle decreases by a second preset value compared to the previous cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is made equal to a specified value within the preset range; wherein, the second change mode is indicated by the change mode indicator bit, and the second preset value is indicated by the change feature indicator bit; The second variation mode is similar to the first variation mode, except that the signal parameters decrease by a second preset value in each cycle, which will not be elaborated here.
[0058] A third change mode is used to indicate that the signal parameter is within the preset range, and each cycle is k times the previous cycle; or to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein, the third change mode is indicated by the change mode indicator bit, and k is indicated by the change feature indicator bit, where k is a positive integer; For example, in one scenario, the preset range is 0 to 99, and k is 2. If the signal parameter for the first cycle is 10, then the signal parameter for the second cycle will also be 10. 2=20, the signal parameter for the third cycle is 20. 2=40...and so on. When the signal parameter increases to 160, since 160 exceeds the preset range of 0 to 99, the signal parameter can be set to a specified value within the range of 0 to 99, for example, 10. This allows the generation of a pulse width modulation (PWM) signal to continue based on the signal parameter, and the signal parameter for the next cycle of the PWM signal is determined by the changing parameter configuration module 12. This effectively prevents the signal parameter from increasing or decreasing indefinitely, thus confining the PWM signal within a certain range.
[0059] The fourth change mode is used to indicate that the signal parameter is within the preset range, and each cycle is one-nth of the previous cycle; or to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein the fourth change mode is indicated by the change mode indicator bit, and n is indicated by the change feature indicator bit, where n is a positive integer; The fourth variation mode is similar to the third variation mode, except that the signal parameters will change to one-nth of the previous cycle in each cycle, which will not be elaborated here.
[0060] The fifth change mode is used to indicate the increase in the length of each cycle relative to the length of the previous cycle of the signal parameter within the preset range, starting from a preset initial value of the increase and increasing by a fifth preset value in each cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein, the fifth change mode is indicated by the change mode indicator bit, and the preset initial value of the increase and the fifth preset value are indicated by the change feature indicator bit; For example, in one scenario, the preset range is 0 to 120, the initial preset increment is 30, and the fifth preset value is 2. If the signal parameter for the first cycle is 10, then the signal parameter for the second cycle is 10 + 30 = 40, the signal parameter for the third cycle is 40 + (30 + 2) = 72, the signal parameter for the fourth cycle is 72 + (30 + 2 + 2) = 106, the signal parameter for the fifth cycle is 106 + (30 + 2 + 2 + 2) = 142, and so on. When the signal parameter increases to 142, since 142 exceeds the preset range of 0 to 120, the signal parameter can be set to a specified value within the range of 0 to 120, such as 10. This allows the generation of a pulse width modulation (PWM) signal based on the signal parameter, and the signal parameter for the next cycle of the PWM signal is determined by the parameter configuration module 12. This effectively prevents the signal parameter from increasing or decreasing indefinitely, thus confining the PWM signal within a certain range.
[0061] The sixth change mode is used to indicate the reduction in the length of each cycle relative to the length of the previous cycle of the signal parameter within the preset range, starting from a preset initial value of reduction and decreasing by a sixth preset value in each cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein, the sixth change mode is indicated by the change mode indicator bit, and the preset initial value of reduction and the sixth preset value are indicated by the change feature indicator bit.
[0062] The sixth variation mode is similar to the fifth variation mode, except that the length of each cycle is reduced by a certain amount relative to the length of the previous cycle. Starting from the initial value of the preset reduction, the sixth preset value is reduced each cycle. This will not be elaborated here.
[0063] Through the aforementioned change mode indicator bit and change feature indicator bit, the change parameters can indicate various change characteristics of the signal parameters. These change parameters may include period length change parameters, duty cycle change indicator parameters, or both; embodiments of the present invention do not limit this.
[0064] After the variable parameter configuration module 12 sends the pre-configured variable parameters to the signal parameter determination module 13, the signal parameter determination module 13 can receive the variable parameters and determine the signal parameters of the next period of the pulse width modulation signal based on the variable parameters. The signal parameters include the period length and / or duty cycle indication parameters. The signal generation module 11 can then generate the pulse width modulation signal of the next period based on the signal parameters of the next period.
[0065] The principle of pulse width modulation signal generation by signal generation module 11 in the embodiments of the present invention will be described in detail below.
[0066] like Figure 5 As shown, in one embodiment of the present invention, the duty cycle change indicator parameter is used to represent the change in the duration of the high level in one cycle of the pulse width modulation signal; the duty cycle indicator parameter is used to represent the duration of the high level in one cycle of the pulse width modulation signal; the signal generation module 11 includes a counting submodule 111 and a comparison submodule 112; the cycle length determined by the signal parameter determination module 13 can be represented as the counting cycle value of the counting submodule 111, and the duty cycle indicator parameter determined by the signal parameter determination module 13 can be represented as the first count value of the counting submodule 111; wherein, the first count value is greater than or equal to the initial count value of the counting submodule 111 and less than the sum of the initial count value and the counting cycle value. For example, the initial count value can be 0.
[0067] Specifically, the counting submodule 111 is coupled to the signal parameter determination module 13 and is configured to perform a counting operation based on the counting cycle value of the next cycle. The comparison submodule 112 is coupled to both the signal parameter determination module 13 and the counting submodule 111 and is configured to compare the current count value of the counting submodule 111 with the first count value. If the current count value is less than the first count value, a first level is output; or, if the current count value is greater than or equal to the first count value, a second level is output. The first level and the second level form the pulse width modulation signal of the next cycle, wherein the first level is the logical inversion of the second level.
[0068] For example, in one instance, the counting submodule 111 may include a counter. The counting period value of the counting submodule is configurable. The counting submodule 111 can count according to the configured counting period value. After each counting time interval, the count value is incremented by 1. After each counting cycle is completed, the counter can start counting again from the initial count value, thus entering the next counting cycle. Here, the counting time interval of the counting submodule 111 can be equal to a basic time unit, and any count value of the counting submodule 111 is an integer multiple of the basic time unit.
[0069] Optionally, the counting time interval of the counting submodule 111 can be a fixed value or configurable. The duration of one counting cycle of the counting submodule 111 is equal to the product of the counting time interval and the counting cycle value. For example, in one example, if the counting time interval of the counting submodule 111 is 50 nanoseconds and the counting cycle value is 100, then the duration of one counting cycle of the counting submodule 111 is equal to 50 nanoseconds. 100 = 5000 nanoseconds.
[0070] In the embodiments of the present invention, since the comparison submodule 112 determines whether to output a first level or a second level based on the magnitude of the current count value of the counting submodule 111 and the first count value, thereby forming a pulse width modulation signal, on the one hand, the period of the pulse width modulation signal output by the comparison submodule 112 is consistent with the counting period of the counting submodule 111, and on the other hand, the duty cycle of the pulse width modulation signal is related to the first count value.
[0071] For example, in one instance, if the current count value of the counting submodule 111 is the count for the first cycle, then the first or second level output by the comparison submodule 112 is also the pulse width modulation signal for the first cycle. If the current count value of the counting submodule 111 is the count for the second cycle, then the first or second level output by the comparison submodule 112 is also the pulse width modulation signal for the second cycle, and so on.
[0072] For example, in another example, the counting period of the counting submodule 111 is 200, the initial counting value is 0, and the first counting value is 50. When the current counting value is less than 50, the comparison submodule 112 will output a high level. When the current counting value is between 50 and 200, the comparison submodule 112 will output a low level, thus forming a pulse width modulation signal with a high level: low level = 1:3.
[0073] Secondly, such as Figure 6 As shown, embodiments of the present invention also provide a chip 4, which is provided with a pulse width modulation signal generation device 5 provided in the foregoing embodiments. Therefore, it can also achieve the corresponding beneficial technical effects, which have been described in detail above and will not be repeated here.
[0074] Thirdly, embodiments of the present invention provide a method for generating pulse width modulation signals, which facilitates effective reduction of system power consumption.
[0075] like Figure 7 As shown, the method for generating a pulse width modulation signal provided in the embodiments of the present invention includes: S61. In response to the end of each cycle of the generated pulse width modulation signal, a pre-configured variation parameter is provided, the variation parameter including a cycle length variation parameter and / or a duty cycle variation indication parameter of the pulse width modulation signal; The variable parameters are pre-configured by the processor and stored in registers; the variable parameters are selected from a plurality of pre-configured and stored alternative parameters. S62. Determine the signal parameters for the next period of the pulse width modulation signal based on the changing parameters; the signal parameters include the period length and / or duty cycle indication parameters; S63. Generate the pulse width modulation signal for the next cycle based on the signal parameters for the next cycle; S64. Record the duration of the pulse width modulation signal corresponding to the changed parameter. If the duration is greater than a preset duration threshold, update the changed parameter to obtain the updated changed parameter. The change parameter includes a change mode indicator bit and a change feature indicator bit under the change mode of the signal parameter; updating the change parameter includes: selecting a new change parameter from a plurality of candidate parameters as the updated change parameter, or updating the change mode indicator bit and / or the change feature indicator bit under the change mode of the change parameter to obtain the updated change parameter; wherein updating the change mode indicator bit includes increasing or decreasing the change mode indicator bit by a preset value; S65. In response to the end of each cycle of the pulse width modulation signal, provide the updated variation parameters.
[0076] The pulse width modulation (PWM) signal generation method provided in the embodiments of the present invention can provide pre-configured variation parameters in response to the end of each cycle of the generated PWM signal. These variation parameters include a cycle length variation parameter and / or a duty cycle variation indicator parameter of the PWM signal. The signal parameters for the next cycle of the PWM signal are determined based on these variation parameters. The signal parameters include the cycle length and / or duty cycle indicator parameter. The PWM signal for the next cycle is generated based on the signal parameters of the next cycle. Thus, the cycle length and / or duty cycle indicator parameter of the next cycle of the PWM signal can be determined according to the pre-configured cycle length variation parameter and / or duty cycle variation indicator parameter. That is, the cycle length and / or duty cycle indicator parameter of the next cycle of the PWM signal can be varied. Correspondingly, the cycle length and / or duty cycle indicator parameter of the PWM signal generated based on the signal parameters for the next cycle can also be varied. This allows the cycle length and / or duty cycle of the PWM signal to be changed without processor intervention, thereby facilitating processor shutdown or sleep states and reducing system power consumption. Furthermore, it can record the duration of the pulse width modulation signal corresponding to the signal and the changing parameters. If the duration exceeds a preset duration threshold, the changing parameters are updated to obtain updated changing parameters. Updating the changing parameters includes: selecting a new parameter from a plurality of candidate parameters as the updated changing parameters, or updating the changing mode indicator bit and / or the changing feature indicator bit under the changing mode in the changing parameters to obtain updated changing parameters. Updating the changing mode indicator bit includes increasing or decreasing the changing mode indicator bit by a preset value. In this way, the pulse width modulation signal generation device can automatically update the changing parameters without the participation of external devices, thereby improving the flexibility of signal generation and facilitating further reduction of system power consumption.
[0077] In one embodiment, providing a pre-configured variation parameter in response to the end of each cycle of the generated pulse width modulation signal includes: providing a pre-configured cycle length variation parameter in response to the end of each cycle of the generated pulse width modulation signal; determining the signal parameter of the next cycle of the pulse width modulation signal based on the variation parameter includes: determining the cycle length of the next cycle of the pulse width modulation signal based on the cycle length variation parameter.
[0078] In one embodiment, determining the period length of the next period of the pulse width modulation signal based on the period length variation parameter includes: determining the period length of the next period of the pulse width modulation signal based on the period length variation parameter and the period length of the most recently ended period of the pulse width modulation signal, thereby obtaining a target length.
[0079] In one embodiment, generating the pulse width modulation signal of the next period based on the signal parameters of the next period includes: generating the pulse width modulation signal of the next period based on the target length, such that the period length of the pulse width modulation signal of the next period is equal to the target length.
[0080] In one embodiment, the duty cycle change indication parameter is used to represent the change in the duration of the high level in one cycle of the pulse width modulation signal; the duty cycle indication parameter is used to represent the duration of the high level in one cycle of the pulse width modulation signal; providing a pre-configured change parameter in response to the end of each cycle of the generated pulse width modulation signal includes: providing the pre-configured duty cycle change indication parameter in response to the end of each cycle of the generated pulse width modulation signal; determining the signal parameter of the next cycle of the pulse width modulation signal based on the change parameter includes: determining the duty cycle indication parameter of the next cycle of the pulse width modulation signal based on the duty cycle change indication parameter.
[0081] In one embodiment, determining the duty cycle indication parameter for the next period of the pulse width modulation signal based on the duty cycle change indication parameter includes: determining the duty cycle indication parameter for the next period of the pulse width modulation signal based on the duty cycle change indication parameter and the duty cycle indication parameter for the most recently ended period of the pulse width modulation signal, thereby obtaining a target duty cycle indication parameter.
[0082] In one embodiment, generating the pulse width modulation signal of the next period based on the signal parameters of the next period includes: generating the pulse width modulation signal of the next period based on the target duty cycle indication parameter.
[0083] In one embodiment, the duty cycle change indicator parameter is used to indicate the change in the duration of the high level in one cycle of the pulse width modulation signal; the duty cycle indicator parameter is used to indicate the duration of the high level in one cycle of the pulse width modulation signal; the cycle length is represented as the counting cycle value of the counter; the duty cycle indicator parameter is represented as a first count value indicator of the counter; wherein, the first count value is greater than or equal to the initial count value of the counting submodule and less than the sum of the initial count value and the counting cycle value; generating the pulse width modulation signal of the next cycle according to the signal parameters of the next cycle includes: performing a counting operation according to the counting cycle value of the counter in the next cycle; comparing the current count value of the counter with the first count value, outputting a first level when the current count value is less than the first count value, or outputting a second level when the current count value is greater than or equal to the first count value, the first level and the second level forming the pulse width modulation signal of the next cycle, wherein the first level is the logical inversion of the second level.
[0084] In one embodiment, the variation parameter includes a variation mode indicator bit of the signal parameter and a variation feature indicator bit of the variation mode.
[0085] In one implementation, the variation mode includes any of the following: A first change mode is used to indicate that the signal parameter is within a preset range, and each cycle increases by a first preset value compared to the previous cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; wherein, the first change mode is indicated by the change mode indicator bit, and the first preset value is indicated by the change feature indicator bit. The second change mode is used to indicate that the signal parameter is within the preset range, and each cycle decreases by a second preset value compared to the previous cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is made equal to a specified value within the preset range; wherein, the second change mode is indicated by the change mode indicator bit, and the second preset value is indicated by the change feature indicator bit; A third change mode is used to indicate that the signal parameter is within the preset range, and each cycle is k times the previous cycle; or to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein, the third change mode is indicated by the change mode indicator bit, and k is indicated by the change feature indicator bit, where k is a positive integer; The fourth change mode is used to indicate that the signal parameter is within the preset range, and each cycle is one-nth of the previous cycle; or to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein the fourth change mode is indicated by the change mode indicator bit, and n is indicated by the change feature indicator bit, where n is a positive integer; The fifth change mode is used to indicate the increase in the length of each cycle relative to the length of the previous cycle of the signal parameter within the preset range, starting from a preset initial value of the increase and increasing by a fifth preset value in each cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein, the fifth change mode is indicated by the change mode indicator bit, and the preset initial value of the increase and the fifth preset value are indicated by the change feature indicator bit; The sixth change mode is used to indicate the reduction in the length of each cycle relative to the length of the previous cycle of the signal parameter within the preset range, starting from a preset initial value of reduction and decreasing by a sixth preset value in each cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein, the sixth change mode is indicated by the change mode indicator bit, and the preset initial value of reduction and the sixth preset value are indicated by the change feature indicator bit.
[0086] It should be noted that, in this document, 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.
[0087] The various embodiments in this specification are described in a related manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0088] In particular, the device embodiment is basically similar to the method embodiment, so the description is relatively simple. For relevant details, please refer to the description of the method embodiment.
[0089] For ease of description, the above apparatus is described by dividing it into various functional units / modules. Of course, in implementing this invention, the functions of each unit / module can be implemented in one or more software and / or hardware.
[0090] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0091] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A device for generating pulse width modulation signals, characterized in that, include: Signal generation module, variable parameter configuration module, signal parameter determination module; The variable parameter configuration module, coupled to the signal generation module and the signal parameter determination module respectively, is configured to send pre-configured variable parameters to the signal parameter determination module in response to the end of each cycle of the pulse width modulation signal generated by the signal generation module. The variable parameters include a cycle length variation parameter and / or a duty cycle variation indication parameter of the pulse width modulation signal. The variable parameter configuration module includes a register for storing the variable parameters, which are pre-configured by the processor. The variable parameters are selected from a plurality of pre-configured and stored alternative parameters. The signal parameter determination module, coupled to the variable parameter configuration module, is configured to receive the variable parameters and determine the signal parameters of the next period of the pulse width modulation signal based on the variable parameters; the signal parameters include period length and / or duty cycle indication parameters. The signal generation module, coupled to the signal parameter determination module, is configured to generate a pulse width modulation signal for the next period based on the signal parameters of the next period. The change parameters include a change mode indicator bit for the signal parameters and a change feature indicator bit for the change mode; The pulse width modulation signal generation device further includes: a variable parameter update module, coupled to the signal generation module, configured to record the duration of the pulse width modulation signal generated by the signal generation module corresponding to the variable parameter, and update the variable parameter when the duration exceeds a preset duration threshold to obtain the updated variable parameter; Updating the change parameter includes: selecting a new change parameter from a plurality of candidate parameters as the updated change parameter, or updating the change mode indicator bit and / or the change feature indicator bit under the change mode in the change parameter to obtain the updated change parameter; wherein updating the change mode indicator bit includes increasing or decreasing the change mode indicator bit by a preset value. The variable parameter configuration module is further configured to send the updated variable parameters to the signal parameter determination module in response to the end of each cycle of the pulse width modulation signal generated by the signal generation module.
2. The pulse width modulation signal generation apparatus according to claim 1, characterized in that, The variable parameter configuration module includes at least one of the following: The period length variation configuration submodule is configured to send the pre-configured period length variation parameter to the signal parameter determination module in response to the end of each period of the pulse width modulation signal generated by the signal generation module. The duty cycle change configuration submodule is configured to send a pre-configured duty cycle change indication parameter to the signal parameter determination module in response to the end of each cycle of the pulse width modulation signal generated by the signal generation module. The variable parameter configuration module includes a period length variable configuration submodule; the signal parameter includes the period length; The signal parameter determination module includes a period length determination submodule, which is coupled to the period length change configuration submodule and is configured to determine the period length of the next period of the pulse width modulation signal based on the period length change parameter sent by the period length change configuration submodule. The cycle length determination submodule is configured to determine the cycle length of the next cycle of the pulse width modulation signal based on the cycle length change parameter and the cycle length of the most recently ended cycle of the pulse width modulation signal, thereby obtaining the target length.
3. The pulse width modulation signal generation apparatus according to claim 2, characterized in that, The signal generation module is coupled to the period length determination submodule and is configured to receive the target length sent by the period length determination submodule, and generate a pulse width modulation signal for the next period based on the target length, so that the period length of the pulse width modulation signal for the next period is equal to the target length.
4. The pulse width modulation signal generation apparatus according to claim 2, characterized in that, The duty cycle change indicator parameter is used to represent the change in the duration of the high level in one cycle of the pulse width modulation signal; the duty cycle indicator parameter is used to represent the duration of the high level in one cycle of the pulse width modulation signal. The variable parameter configuration module includes a duty cycle variable configuration submodule; The signal parameters include duty cycle indication parameters; The signal parameter determination module includes a duty cycle determination submodule, which is coupled to the duty cycle change configuration submodule and is configured to determine the duty cycle indication parameter for the next period of the pulse width modulation signal based on the duty cycle change indication parameter sent by the duty cycle change configuration submodule.
5. The pulse width modulation signal generation apparatus according to claim 4, characterized in that, The duty cycle determination submodule is configured to determine the duty cycle indication parameter for the next period of the pulse width modulation signal based on the duty cycle change indication parameter and the duty cycle indication parameter for the most recently ended period of the pulse width modulation signal, thereby obtaining the target duty cycle indication parameter.
6. The pulse width modulation signal generation apparatus according to claim 5, characterized in that, The signal generation module is coupled to the duty cycle determination submodule and is configured to receive the target duty cycle indication parameter and generate the pulse width modulation signal for the next cycle based on the target duty cycle indication parameter.
7. The pulse width modulation signal generation apparatus according to claim 1, characterized in that, The duty cycle change indicator parameter is used to represent the change in the duration of the high level in one cycle of the pulse width modulation signal; the duty cycle indicator parameter is used to represent the duration of the high level in one cycle of the pulse width modulation signal. The signal generation module includes a counting submodule and a comparison submodule; the period length determined by the signal parameter determination module is represented as the counting period value of the counting submodule; the duty cycle indication parameter determined by the signal parameter determination module is represented as the first count value indication of the counting submodule; wherein, the first count value is greater than or equal to the initial count value of the counting submodule and less than the sum of the initial count value and the counting period value; The counting submodule, coupled to the signal parameter determination module, is configured to perform a counting operation based on the counting cycle value of the next cycle. The comparison submodule is coupled to the signal parameter determination module and the counting submodule respectively, and is configured to compare the current count value of the counting submodule with the first count value. If the current count value is less than the first count value, the first level is output, or if the current count value is greater than or equal to the first count value, the second level is output. The first level and the second level form the pulse width modulation signal of the next cycle, wherein the first level is the logical inversion of the second level.
8. The pulse width modulation signal generation apparatus according to claim 7, characterized in that, The change pattern includes any of the following: A first change mode is used to indicate that the signal parameter is within a preset range, and each cycle increases by a first preset value compared to the previous cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is equal to a specified value within the preset range; wherein, the first change mode is indicated by the change mode indicator bit, and the first preset value is indicated by the change feature indicator bit. The second change mode is used to indicate that the signal parameter is within the preset range, and each cycle decreases by a second preset value compared to the previous cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is made equal to a specified value within the preset range; wherein, the second change mode is indicated by the change mode indicator bit, and the second preset value is indicated by the change feature indicator bit; A third change mode is used to indicate that the signal parameter is within the preset range, and each cycle is k times the previous cycle; or to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein, the third change mode is indicated by the change mode indicator bit, and k is indicated by the change feature indicator bit, where k is a positive integer; The fourth change mode is used to indicate that the signal parameter is within the preset range, and each cycle is one-nth of the previous cycle; or to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein the fourth change mode is indicated by the change mode indicator bit, and n is indicated by the change feature indicator bit, where n is a positive integer; The fifth change mode is used to indicate the increase in the length of each cycle relative to the length of the previous cycle of the signal parameter within the preset range, starting from a preset initial value of the increase and increasing by a fifth preset value in each cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein, the fifth change mode is indicated by the change mode indicator bit, and the preset initial value of the increase and the fifth preset value are indicated by the change feature indicator bit; The sixth change mode is used to indicate the reduction in the length of each cycle relative to the length of the previous cycle of the signal parameter within the preset range, starting from a preset initial value of reduction and decreasing by a sixth preset value in each cycle; or it is used to indicate that when the signal parameter is outside the preset range, the signal parameter is set to a specified value within the preset range; wherein, the sixth change mode is indicated by the change mode indicator bit, and the preset initial value of reduction and the sixth preset value are indicated by the change feature indicator bit.
9. A chip, characterized in that, The apparatus includes the pulse width modulation signal generation device according to any one of claims 1 to 8.
10. A method for generating a pulse width modulation signal, characterized in that, include: In response to the end of each cycle of the generated pulse width modulation signal, pre-configured variation parameters are provided, including a cycle length variation parameter and / or a duty cycle variation indication parameter of the pulse width modulation signal; The variable parameters are pre-configured by the processor and stored in registers; the variable parameters are selected from a plurality of pre-configured and stored alternative parameters. The signal parameters for the next period of the pulse width modulation signal are determined based on the changing parameters; the signal parameters include period length and / or duty cycle indication parameters. Generate the pulse width modulation signal for the next cycle based on the signal parameters for the next cycle; The duration of the pulse width modulation signal corresponding to the changing parameter is recorded. If the duration exceeds a preset duration threshold, the changing parameter is updated to obtain the updated changing parameter. The changing parameter includes a changing mode indicator bit and a changing feature indicator bit under the changing mode. Updating the changing parameter includes: selecting a new changing parameter from a plurality of candidate parameters, or updating the changing mode indicator bit and / or the changing feature indicator bit under the changing mode in the changing parameter to obtain the updated changing parameter. Updating the changing mode indicator bit includes increasing or decreasing the changing mode indicator bit by a preset value. In response to the end of each cycle of the pulse width modulation signal, the updated variation parameters are provided.