ECAP module, system and method for adaptive dynamic strategy adjustment

By integrating frequency monitoring, adaptive prescaler coefficient calculation and configuration update modules in the eCAP module, the problem that the static prescaler coefficient configuration cannot adapt to the dynamic frequency changes is solved, and high precision capture and high applicability are achieved.

CN119783595AActive Publication Date: 2025-04-08HUNAN GREAT WALL GALAXY TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411940909.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-08
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

The prescaled frequency coefficient configuration of the existing eCAP module is static and cannot adapt to the dynamic changes in the input signal frequency, resulting in a decrease in capture accuracy under frequency fluctuations and low applicability.

Method used

The frequency monitoring module, an adaptive prescaler coefficient calculation module and a configuration update module are integrated in the eCAP module to monitor the frequency changes of the input signal in real time, and calculate the optimal prescaler coefficient that meets the preset capture accuracy based on the adaptive algorithm, and update the configuration of the prescaler processing module in real time.

Benefits of technology

The eCAP module realizes high-precision capture of frequency dynamically changing signals, improves the applicability and reliability of the module, and can adapt to input signals with unknown constant frequency and frequency dynamically changing input signals without adding external devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783595A_ABST
    Figure CN119783595A_ABST
Patent Text Reader

Abstract

The invention relates to an eCAP module, system and method of a self-adaptive dynamic adjustment strategy, and the method comprises the steps: integrating a frequency monitoring module, a self-adaptive pre-frequency-division coefficient calculation module and a configuration updating module in the eCAP module, and enabling the frequency monitoring module to monitor the latest frequency of an input signal in real time after reading a timestamp in a capture register; the self-adaptive pre-frequency-division coefficient calculation module calculates the optimal pre-frequency-division coefficient meeting the preset capturing precision according to the newest frequency by adopting a self-adaptive algorithm, and finally the configuration updating module updates the pre-frequency-division coefficient currently used by the pre-frequency-division processing module into the optimal pre-frequency-division coefficient in real time. Real-time modification of the pre-frequency division coefficient of the eCAP module is realized on the basis of a self-adaptive dynamic adjustment strategy, so that the applicability of the eCAP module is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of integrated circuit design, and relates to an eCAP module, system and method for adaptive dynamic adjustment strategy. Background Art

[0002] As a key component in modern digital signal processing systems, the eCAP (Enhanced Capture) module is widely used in motor drive control, pulse width modulation (PWM) signal measurement, and time interval measurement. Its core function is to accurately capture the rising or falling edge of the input signal (such as the external pin PIN) and record the corresponding timestamp. Among them, the pre-scaling coefficient is an important parameter in the eCAP module, which determines the frequency division ratio before the input signal is captured. However, the current eCAP module pre-scaling coefficient configuration is usually static, that is, the pre-scaling coefficient remains unchanged during system operation, which limits the eCAP module's ability to adapt to dynamically changing signals. The current eCAP module is more based on the pre-scaling coefficient configured when the frequency of the input signal is known and relatively constant, so it cannot meet the use of the input signal when the frequency is in dynamic fluctuations, and there is a technical problem of low applicability. Summary of the invention

[0003] In view of the problems existing in the above-mentioned traditional technologies, the present invention proposes an eCAP module with an adaptive dynamic adjustment strategy, a digital signal processing system and an adaptive dynamic adjustment method for the pre-division coefficient of the eCAP module, which can greatly improve the applicability of the eCAP module.

[0004] In order to achieve the above objectives, the embodiments of the present invention adopt the following technical solutions: On the one hand, an eCAP module with an adaptive dynamic adjustment strategy is provided, including a pre-scaling processing module, a capture register, a time base counter, a frequency monitoring module, an adaptive pre-scaling coefficient calculation module and a configuration update module; The pre-scaling processing module is used to perform frequency division processing on the input signal of the external PIN according to the configured pre-scaling coefficient. The capture register is used to record the timestamp of the rising edge or falling edge of the input signal. The time base counter is used to provide the time base counter value corresponding to the rising edge or falling edge of the input signal. The frequency monitoring module is used to monitor the latest frequency of the input signal in real time after reading the timestamp in the capture register. The adaptive pre-scaling coefficient calculation module is used to calculate the best pre-scaling coefficient that meets the preset capture accuracy according to the latest frequency using an adaptive algorithm, and the configuration update module is used to update the pre-scaling coefficient currently used by the pre-scaling processing module to the best pre-scaling coefficient in real time.

[0005] On the other hand, a digital signal processing system is also provided, including a system chip, wherein the system chip integrates an eCAP module with the above-mentioned adaptive dynamic adjustment strategy.

[0006] On the other hand, a method for adaptively and dynamically adjusting the pre-scaling coefficient of an eCAP module is provided. The method for adaptively and dynamically adjusting the pre-scaling coefficient of an eCAP module based on the above-mentioned adaptive dynamic adjustment strategy comprises the following steps: After the system is powered on and reset, the registers inside the eCAP module are initially configured; Load the edge timestamp corresponding to the input signal into the capture register according to the polarity selection of the polarity bit field of the control register ECCTL1; If the frequency monitoring module, the adaptive pre-scaling coefficient calculation module and the configuration update module are turned on, the frequency monitoring module immediately reads the timestamp from the capture register to perform frequency calculation; when the signal frequency calculated this time is compared with the signal frequency calculated last time to determine that it meets the currently set capture accuracy requirement, the signal frequency calculated this time is discarded and the signal frequency obtained last time is latched; The adaptive pre-scaling coefficient calculation module uses an adaptive algorithm to calculate the pre-scaling coefficient that meets the currently set capture accuracy according to the input new signal frequency and submits it to the configuration update module as the current new optimal pre-scaling coefficient; After the configuration update module receives the new optimal pre-scaling coefficient, if the pre-scaling coefficient used by the pre-scaling processing module is currently allowed to be updated, the configuration update module immediately configures the new optimal pre-scaling coefficient to the pre-scaling coefficient bit field of the control register ECCTL1.

[0007] One of the above technical solutions has the following advantages and beneficial effects: The eCAP module, system and method of the above-mentioned adaptive dynamic adjustment strategy integrate a frequency monitoring module, an adaptive pre-division coefficient calculation module and a configuration update module in the eCAP module. The frequency monitoring module reads the timestamp in the capture register and monitors the latest frequency of the input signal in real time. The adaptive pre-division coefficient calculation module uses an adaptive algorithm to calculate the best pre-division coefficient that meets the preset capture accuracy according to the latest frequency. Finally, the configuration update module updates the pre-division coefficient currently used by the pre-division processing module to the best pre-division coefficient in real time, thereby realizing real-time modification of the pre-division coefficient of the eCAP module based on the adaptive dynamic adjustment strategy. Without adding external devices, it can not only adapt to the high-precision capture of input signals with unknown constant frequency, but also ensure the high-reliability capture of input signals with dynamically changing frequencies during the entire use process, thereby greatly improving the applicability of the eCAP module. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0009] Figure 1 FIG. 1 is a schematic diagram of the overall structure of an eCAP module for adaptively and dynamically adjusting a strategy in an embodiment; Figure 2 is a schematic diagram of the overall structure of an eCAP module for adaptive dynamic adjustment strategy in another embodiment; Figure 3 A schematic diagram of the use process of an eCAP module for adaptively and dynamically adjusting a strategy in one embodiment; Figure 4 FIG. 1 is a flow chart of a method for adaptively and dynamically adjusting the pre-scaling coefficient of an eCAP module in an embodiment. DETAILED DESCRIPTION

[0010] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art of the present invention. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0011] It should be noted that the reference to "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The presentation of this phrase at various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It will be appreciated by those skilled in the art that the embodiments described herein may be combined with other embodiments. The term "and / or" used in the specification and appended claims of the present invention refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0012] The following will describe the implementation of the present invention in detail with reference to the accompanying drawings in the embodiment diagram of the present invention.

[0013] In practical applications, the frequency of the input signal is often very unstable, which poses a severe challenge to the configuration of the pre-division coefficient of the eCAP module. The traditional configuration method of fixed pre-division coefficients is difficult to balance the accurate capture of low-frequency signals and the efficient processing of high-frequency signals, which limits the performance of the eCAP module. In this regard, some research on eCAP-related technologies has emerged, such as a link port multi-clock signal detection device implemented with a chip eCAP module. It uses the chip's eCAP module to detect multiple clock signals in sequence according to demand in a single link port high-frequency frequency detection method, and has the advantages of simple structure and wide detection range. Although the link port multi-clock signal detection device uses a clock switching circuit to meet the selection of as many capture sources as possible, and a pre-divider to divide the clock signal, it cannot be dynamically adjusted according to actual needs in the face of dynamic frequency changes. It increases the options of capture input sources by adding modules to the external single port, but does not consider the frequency fluctuations that the eCAP module itself will encounter during the capture process. Therefore, the configuration of its pre-division coefficient is essentially static. When the processed input signal has large frequency fluctuations, the demand for high-precision capture of the input signal cannot be met.

[0014] Based on this, a new solution is proposed in this specification to solve the problem that the pre-scaling coefficient configuration in the prior art is not flexible and cannot adapt to the needs of different working scenarios in real time. The new solution, with the help of the high flexibility and robustness of the adaptive algorithm, can not only quickly respond to the frequency changes of the input signal, but also maintain stable processing performance under noise interference; in addition, the balance between capture accuracy and computing efficiency is also considered to ensure the overall performance of the system. The new solution can monitor the frequency changes of the input signal in real time, and dynamically adjust the pre-scaling coefficient of the eCAP module according to the monitoring results and preset optimization goals (such as indicators such as capture accuracy and processing efficiency), thereby ensuring that the eCAP module can maintain the best capture performance at different signal frequencies.

[0015] In one embodiment, Figure 1As shown, an eCAP module with an adaptive dynamic adjustment strategy is provided, including a pre-scaling processing module, a capture register, a time base counter, a frequency monitoring module, an adaptive pre-scaling coefficient calculation module and a configuration update module. The pre-scaling processing module is used to perform frequency division processing on the input signal of the external PIN according to the configured pre-scaling coefficient, and the capture register is used to record the timestamp of the rising edge or falling edge of the input signal (according to the polarity configuration). The time base counter is used to provide the time base counter value corresponding to the rising edge or falling edge of the input signal. The frequency monitoring module is used to monitor the latest frequency of the input signal in real time after reading the timestamp in the capture register. The adaptive pre-scaling coefficient calculation module is used to calculate the best pre-scaling coefficient that meets the preset capture accuracy according to the latest frequency using an adaptive algorithm. The configuration update module is used to update the pre-scaling coefficient currently used by the pre-scaling processing module to the best pre-scaling coefficient in real time.

[0016] It can be understood that when the frequency of the captured input signal changes greatly during the process of capturing the input signal of the external PIN, the capture accuracy of the input signal decreases because the pre-scaling coefficient of the traditional eCAP module remains unchanged after the configuration is completed. This embodiment proposes an eCAP module with an adaptive dynamic adjustment strategy, which aims to intelligently and dynamically adjust the pre-scaling coefficient of the eCAP module according to the real-time frequency characteristics of the input signal, thereby maximizing the work efficiency and adaptability of the eCAP module while ensuring the capture accuracy, and is particularly suitable for high-precision, wide-frequency range application scenarios such as motor control, frequency measurement, and timestamp recording.

[0017] Specifically, the pre-scaling processing module, capture register, time base counter, frequency monitoring module, adaptive pre-scaling coefficient calculation module and configuration update module work together to realize the frequency adaptive processing of the input signal and the real-time configuration of the pre-scaling coefficient of the eCAP module. The entire eCAP module is responsible for capturing the rising edge or falling edge of the input signal, recording its timestamp, and immediately storing the timestamp in the internal capture registers CAP1~CAP4. These timestamp data will be used for subsequent signal processing and analysis. The time base counter is used to count at a fixed clock frequency according to the system clock to provide an accurate time reference for the capture event. For example, when measuring the pulse width, the pulse width time can be calculated by recording the time base counter value corresponding to the rising edge and falling edge of the pulse; for example, the time base counter difference between two consecutive identical edges (such as the rising edge or the falling edge) can be captured, and then combined with the clock frequency of the time base counter, the pulse period can be directly obtained. For example, in motor speed measurement, the motor speed is measured by the pulse signal period emitted by the photoelectric sensor.

[0018] The frequency monitoring module is responsible for real-time monitoring of the frequency of the input signal. The adaptive pre-scaling coefficient calculation module is one of the core improvement parts. The adaptive pre-scaling coefficient calculation module uses an adaptive algorithm to calculate and determine the optimal pre-scaling coefficient based on the real-time frequency information provided by the frequency monitoring module. The optimal pre-scaling coefficient can be called an adaptive pre-scaling coefficient relative to the initial configuration pre-scaling coefficient given when the eCAP module is initially configured, and can change with each frequency change of the input signal (this change is called an adaptive dynamic adjustment strategy). The core concept of the adaptive algorithm is to dynamically adjust the pre-scaling coefficient to adapt to the frequency change of the input signal. The specific implementation of the adaptive algorithm is: when the frequency of the input signal increases, the pre-scaling coefficient increases accordingly; when the frequency of the input signal decreases, the pre-scaling coefficient decreases accordingly, so that the pre-scaling coefficient can always meet the preset capture accuracy requirements for the input signal after the frequency change. The adaptive algorithm can ensure that the eCAP module can accurately capture the timestamp of the input signal under the dynamic change of the frequency of the input signal.

[0019] The configuration update module is responsible for updating the calculated optimal pre-scaling coefficient to the pre-scaling processing module of the eCAP module in real time, so that the pre-scaling processing module can capture and process the current input signal according to the optimal pre-scaling coefficient. In this way, the eCAP module can immediately use the new pre-scaling coefficient for signal processing to ensure the accuracy and real-time performance of the capture. In the design process of the eCAP module, the above-mentioned frequency monitoring module, adaptive pre-scaling coefficient calculation module, configuration update module and other modules can be integrated into the eCAP module, and a configuration interface can be provided to the outside.

[0020] The eCAP module with the above-mentioned adaptive dynamic adjustment strategy integrates a frequency monitoring module, an adaptive pre-division coefficient calculation module and a configuration update module in the eCAP module. The frequency monitoring module reads the timestamp in the capture register and monitors the latest frequency of the input signal in real time. The adaptive pre-division coefficient calculation module calculates the optimal pre-division coefficient that meets the preset capture accuracy according to the latest frequency using an adaptive algorithm. Finally, the configuration update module updates the pre-division coefficient currently used by the pre-division processing module to the optimal pre-division coefficient in real time, thereby realizing real-time modification of the pre-division coefficient of the eCAP module based on the adaptive dynamic adjustment strategy. Without adding external devices, it can not only adapt to the high-precision capture of input signals with unknown constant frequency, but also ensure the high-reliability capture of input signals with dynamically changing frequencies during the entire use process, thereby greatly improving the applicability of the eCAP module.

[0021] In one embodiment, Figure 2As shown, the frequency monitoring module includes a frequency calculation module, a control logic CTRL0 and a frequency register. The control logic CTRL0 is used to read the timestamp in the capture register and input it into the frequency calculation module. The frequency calculation module is used to calculate the latest frequency of the input signal according to the timestamp and store it in the frequency register. Correspondingly, the adaptive pre-scaling coefficient calculation module can be composed of the control logic CTRL1 and the adaptive algorithm module.

[0022] It can be understood that the frequency monitoring module reads the timestamp in the capture registers CAP1~CAP4 through the control logic CTRL0, inputs it into the frequency calculation module to calculate the latest frequency and writes it into the FREQUENCY (frequency) register in Table 1. The control logic CTRL0 is a logic circuit in the eCAP module. In this embodiment, it is configured to read the timestamp in the capture register, control the calculation of the frequency calculation module and write the latest frequency into the frequency register. The control logic CTRL1 is similar.

[0023] Table 1

[0024] The frequency monitoring module of this embodiment can quickly and in real time calculate the latest frequency of the input signal, thereby realizing frequency monitoring of the input signal.

[0025] In one embodiment, Figure 2 As shown, the frequency monitoring module also includes an accuracy calculation module. The accuracy calculation module is used to determine whether the latest frequency currently calculated by the frequency calculation module meets the preset capture accuracy, and when the latest frequency does not meet the preset capture accuracy, the latest frequency currently calculated is discarded and the frequency register is instructed to latch the latest frequency calculated last time.

[0026] It can be understood that in this embodiment, when the frequency calculation module outputs the latest frequency obtained by the current calculation, the latest frequency obtained by the current calculation can also be submitted to the accuracy calculation module at the same time, and the accuracy calculation module calculates whether the current frequency meets the preset capture accuracy. The preset capture accuracy can be a single value or a precision range, which can be set according to the actual application needs. The accuracy calculation module can perform a capture accuracy comparison, such as comparing the latest frequency obtained by the current calculation with the latest frequency calculated last time. If the latest frequency obtained by the current calculation meets the capture accuracy requirement currently set, then the latest frequency obtained by the current calculation is discarded, and the latest frequency calculated last time is latched, that is, the frequency output to the adaptive pre-scaling coefficient calculation module is not updated, so that the adaptive pre-scaling coefficient calculation module does not generate a new pre-scaling coefficient, thereby avoiding excessive updating of the pre-scaling coefficient when it still meets the capture accuracy requirement, thereby reducing system overhead. When determining whether the capture accuracy requirement is met based on the frequency calculation of the input signal, the calculation relationship between the frequency of the input signal and its capture accuracy can be understood in the same way as the existing calculation relationship in the art, and will not be elaborated in this specification.

[0027] In one embodiment, the frequency monitoring module may further include a polarity selection traversal table for instructing the control logic CTRL0 to select the value in the capture register as the input of the frequency calculation module according to the polarity of the polarity bit field CAPxPOL of the control register ECCTL1 initially configured by the eCAP module.

[0028] It can be understood that in this embodiment, a polarity selection traversal table can also be added to the frequency monitoring module to accurately select the value in the capture register as the input of the frequency calculation module. The polarity selection traversal table is formed by the register configuration inside the eCAP module.

[0029] Specifically, when the frequency monitoring module reads the timestamp from the capture registers CAP1~CAP4 of the eCAP module, since the calculated frequency is based on the timestamps of adjacent edges with the same polarity, and in actual applications, users have uncertainty when configuring the polarities of the four capture registers CAP1~CAP4. For example, the capture register CAP1 may be loaded with the captured rising edge timestamp, the capture register CAP2 may be loaded with the captured falling edge timestamp, the capture register CAP3 may be loaded with the captured falling edge timestamp, and the capture register CAP4 may be loaded with the captured rising edge. In the falling edge polarity selection mode, only the capture registers CAP2 and CAP3 can be used to calculate the frequency.

[0030] In order to avoid errors that may be caused by the uncertainty of human configuration, a polarity selection traversal table is added to the frequency monitoring module to enable the control logic CTRL0 to specifically and accurately select the value in which capture register to be used as the input of the frequency calculation module to complete the frequency calculation according to the polarity of the initially configured polarity bit field CAPxPOL.

[0031] In one embodiment, Figure 2 As shown, the configuration update module includes a storage register and a control logic CTRL2. The storage register is used to store the initial configuration pre-scaling coefficient and the optimal pre-scaling coefficient. The control logic CTRL2 is used to update the pre-scaling coefficient used by the pre-scaling processing module to the optimal pre-scaling coefficient in real time.

[0032] It can be understood that a PRESERVE register is set in the configuration update module to record the initial configuration pre-scaling coefficient value (i.e., the pre-scaling coefficient configured when the system is powered on and the initialization configuration is completed) and the adaptive pre-scaling coefficient. The control logic CTRL2 is a logic circuit in the eCAP module, which is used to perform the behavior control of the pre-scaling coefficient update and the read and write control of the storage register, etc. The configuration update module of this embodiment is used to dynamically update the pre-scaling coefficient currently used by the eCAP module in real time.

[0033] In one embodiment, the storage registers include registers PRESERVE[4:0], registers PRESERVE[9:5], registers PRESERVE

[10] , registers PRESERVE

[11] , and registers PRESERVE[32:12]. Register PRESERVE[4:0] is used to store the initial configuration pre-scaling coefficient, register PRESERVE[9:5] is used to store the optimal pre-scaling coefficient, register PRESERVE

[10] is used to select whether to enable the frequency monitoring module, the adaptive pre-scaling coefficient calculation module, and the configuration update module, register PRESERVE

[11] is used to configure the configuration update module to enable the initial configuration pre-scaling coefficient or enable the optimal pre-scaling coefficient, and register PRESERVE[32:12] is a reserved bit and is not used.

[0034] It can be understood that, as shown in Table 2, the save register also includes the enable or disable configuration of the frequency monitoring module, the adaptive pre-scaling coefficient calculation module and the configuration update module, as well as the configuration of whether to enable the new pre-scaling coefficient, so as to facilitate flexible switching between turning on or off the adaptive pre-scaling mode to adapt to more application scenarios.

[0035] Table 2

[0036] Note: R means read-only, and R / W means both readable and writable.

[0037] In some implementations, in order to more clearly and intuitively demonstrate the implementation of the eCAP module of the above-mentioned adaptive dynamic adjustment strategy, as shown in FIG. Figure 3 The following is a schematic diagram of the usage flow of the eCAP module of the above-mentioned adaptive dynamic adjustment strategy: Step 1: After the system is powered on and reset, the registers inside the eCAP module are initially configured, including the initial configuration pre-scaling coefficient of the pre-scaling processing module, and the register PRESERVE

[10] is used to select whether to enable the frequency monitoring module, the adaptive pre-scaling coefficient calculation module, and the configuration update module; the register PRESERVE

[11] is used to indicate whether the configuration update module chooses to use the initial configuration pre-scaling coefficient configured initially, or chooses to use the optimal pre-scaling coefficient calculated in real time by the adaptive pre-scaling coefficient calculation module. When the frequency monitoring module and the adaptive pre-scaling coefficient calculation module are disabled, the configuration update module only uses the initial configuration pre-scaling coefficient configured initially in the register PRESERVE[4:0], which is convenient for switching when the system turns on the adaptive pre-scaling working mode and needs to return to the initial configuration.

[0038] Step 2: After the initial configuration of the eCAP module register is completed and it works normally, the eCAP module will load the edge timestamp corresponding to the input signal into the capture registers CAP1~CAP4 according to the polarity selection of the polarity bit field CAPxPOL (x=1, 2, 3, 4) of the control register ECCTL1.

[0039] Step 3: (1) If the adaptive pre-scaling coefficient calculation module is not enabled, the eCAP module directly starts capturing the timestamp of the input signal.

[0040] (2) If the frequency monitoring module, the adaptive pre-scaling coefficient calculation module and the configuration update module are turned on, the frequency monitoring module immediately reads the timestamp from the capture registers CAP1~CAP4 of the eCAP module to the frequency calculation module for frequency calculation. When the signal frequency calculated this time is compared with the signal frequency calculated last time to determine that it meets the currently set capture accuracy requirements, the signal frequency calculated this time is discarded and the signal frequency obtained last time is latched, that is, the frequency output to the adaptive pre-scaling coefficient calculation module is not updated.

[0041] Step 4: If the frequency monitoring module detects that the currently captured signal frequency no longer meets the currently set capture accuracy requirements, and provides a new signal frequency to the adaptive pre-division coefficient calculation module, the adaptive algorithm of the adaptive pre-division coefficient calculation module immediately calculates the pre-division coefficient that meets the currently set capture accuracy based on the input new signal frequency, and submits it to the configuration update module as the current new optimal pre-division coefficient.

[0042] Step 5: After the configuration update module receives the new optimal pre-scaling coefficient, if the pre-scaling coefficient used by the pre-scaling processing module is currently allowed to be updated, the configuration update module immediately configures the new optimal pre-scaling coefficient to the frequency division coefficient bit field of the control register ECCTL1 of the eCAP module to update the pre-scaling coefficient used by the pre-scaling processing module. If the configuration update module is not enabled, the configuration update module latches the new optimal pre-scaling coefficient in the register PRESERVE[9:5]. When the user turns on the configuration update module through software during the input signal capture process, the configuration update module first monitors whether the frequency monitoring module provides an update frequency request to the adaptive pre-scaling coefficient calculation module. If a new frequency is detected, the latched pre-scaling coefficient value in the configuration update module is cleared, waiting for the adaptive pre-scaling coefficient calculation module to provide a new optimal pre-scaling coefficient, and then submits the latest optimal pre-scaling coefficient to the frequency division coefficient bit field of the control register ECCTL1 of the eCAP module. If no frequency update request is detected, the optimal pre-scaling factor of the current PRESERVE[9:5] is directly submitted to the pre-scaling factor bit field of the control register ECCTL1 of the eCAP module.

[0043] The eCAP module with the above-mentioned adaptive dynamic adjustment strategy does not need to know the frequency range in advance to manually calculate the pre-division coefficient and then configure it when capturing input signals with uncertain frequency ranges. Instead, it can adjust the size of the pre-division coefficient in time when capturing input signals with frequency fluctuations, and more accurately capture the timestamp of the input signal according to the capture accuracy requirements. After adding a configuration update module to the eCAP module, it can be compatible with the fixed parameter configuration scheme of the existing eCAP module, and can be changed to an adaptive dynamic adjustment strategy according to the frequency of the input signal. There is no need to add additional components or interfaces to assist the eCAP module in capturing input signals, which fundamentally expands the applicable scenarios of the eCAP module and achieves a technological breakthrough from the existing capture of relatively stable frequencies to the accurate capture of dynamic frequency fluctuations, improving the efficiency and accuracy of signal processing, and reducing the process of manual repeated configuration and debugging, thereby improving the work efficiency of the entire system.

[0044] In one embodiment, a digital signal processing system is further provided, including a system chip, wherein the system chip integrates the eCAP module with the above-mentioned adaptive dynamic adjustment strategy.

[0045] It can be understood that the description of the system chip and other existing components of the digital signal processing system in this embodiment can be understood by referring to the same existing components in the digital signal processing system in the field, and will not be described in detail in this specification. For the specific explanation of the eCAP module of the adaptive dynamic adjustment strategy, please refer to the corresponding definition of the eCAP module of the adaptive dynamic adjustment strategy in each embodiment above, which will not be repeated here.

[0046] The digital signal processing system can effectively adapt to different application scenarios such as motor drive control, pulse width modulation (PWM) signal measurement, and time interval measurement by applying the eCAP module of the above-mentioned adaptive dynamic adjustment strategy, and provide high-performance signal processing capabilities.

[0047] In one embodiment, a method for adaptively and dynamically adjusting the pre-scaling coefficient of an eCAP module is also provided. The eCAP module based on the above-mentioned adaptively and dynamically adjusting strategy is as follows: Figure 4 As shown, the method for adaptively and dynamically adjusting the pre-scaling coefficient of the eCAP module may include the following processing steps S10 and S18: S10, after the system power-on reset is completed, the registers inside the eCAP module are initially configured; S12, loading the edge timestamp corresponding to the input signal into the capture register according to the polarity selection of the polarity bit field of the control register ECCTL1; S14, if the frequency monitoring module, the adaptive pre-scaling coefficient calculation module and the configuration update module are turned on, the frequency monitoring module immediately reads the timestamp from the capture register to perform frequency calculation; when the signal frequency calculated this time is compared with the signal frequency calculated last time to determine that it meets the currently set capture accuracy requirement, the signal frequency calculated this time is discarded and the signal frequency obtained last time is latched; S16, the adaptive pre-scaling coefficient calculation module uses an adaptive algorithm to calculate the pre-scaling coefficient that meets the currently set capture accuracy according to the input new signal frequency and submits it to the configuration update module as the current new optimal pre-scaling coefficient; S18, after the configuration update module receives the new optimal pre-scaling coefficient, if the pre-scaling coefficient used by the pre-scaling processing module is currently allowed to be updated, the configuration update module immediately configures the new optimal pre-scaling coefficient to the pre-scaling coefficient bit field of the control register ECCTL1.

[0048] The above-mentioned method for adaptive dynamic adjustment of the pre-division coefficient of the eCAP module integrates a frequency monitoring module, an adaptive pre-division coefficient calculation module and a configuration update module in the eCAP module. The frequency monitoring module reads the timestamp in the capture register and monitors the latest frequency of the input signal in real time. The adaptive pre-division coefficient calculation module calculates the optimal pre-division coefficient that meets the preset capture accuracy according to the latest frequency using an adaptive algorithm. Finally, the configuration update module updates the pre-division coefficient currently used by the pre-division processing module to the optimal pre-division coefficient in real time, thereby realizing real-time modification of the pre-division coefficient of the eCAP module based on an adaptive dynamic adjustment strategy. Without adding external devices, it can not only adapt to the high-precision capture of input signals with unknown constant frequency, but also ensure the high-reliability capture of input signals with dynamically changing frequencies during the entire use process, thereby greatly improving the applicability of the eCAP module.

[0049] In one embodiment, the above-mentioned method for adaptively and dynamically adjusting the pre-scaling coefficient of the eCAP module may further include the steps of: If the configuration update module is not enabled, the configuration update module latches the new optimal pre-scaling coefficient in register PRESERVE[9:5]; When the configuration update module is turned on, the configuration update module clears the latched pre-scaling coefficient value when it detects that the frequency monitoring module provides a new frequency to the adaptive pre-scaling coefficient calculation module; After waiting for the adaptive pre-scaling coefficient calculation module to provide a new optimal pre-scaling coefficient, the configuration update module submits the latest optimal pre-scaling coefficient to the pre-scaling coefficient bit field of the control register ECCTL1.

[0050] In one embodiment, the above-mentioned method for adaptively and dynamically adjusting the pre-scaling coefficient of the eCAP module may further include the steps of: If the frequency monitoring module, the adaptive pre-scaling coefficient calculation module, and the configuration update module are not enabled, the eCAP module directly starts capturing the timestamp of the input signal according to the initial configuration.

[0051] For the specific explanation and limitation of the method for adaptive dynamic adjustment of the pre-division coefficient of the eCAP module, please refer to the corresponding limitation of the adaptive dynamic adjustment strategy of the eCAP module mentioned above, which will not be repeated here.

[0052] It should be understood that although Figure 4 The steps in the method are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps can be executed in other orders. Figure 4At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequentially, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0053] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus dynamic random access memory (RambusDRAM, referred to as RDRAM) and interface dynamic random access memory (DRDRAM).

[0054] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0055] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of protection of the invention. It should be pointed out that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the attached claims.

Claims

1. An eCAP module with adaptive dynamic adjustment strategy, characterized in that: It includes a pre-scaling processing module, a capture register, a time base counter, a frequency monitoring module, an adaptive pre-scaling coefficient calculation module and a configuration update module; The pre-scaling processing module is used to perform frequency division processing on the input signal of the external PIN according to the configured pre-scaling coefficient, the capture register is used to record the timestamp of the rising edge or falling edge of the input signal, the time base counter is used to provide the time base counter value corresponding to the rising edge or falling edge of the input signal, and the frequency monitoring module is used to monitor the latest frequency of the input signal in real time after reading the timestamp in the capture register; The adaptive pre-scaling coefficient calculation module is used to calculate the best pre-scaling coefficient that meets the preset capture accuracy according to the latest frequency using an adaptive algorithm, and the configuration update module is used to update the pre-scaling coefficient currently used by the pre-scaling processing module to the best pre-scaling coefficient in real time.

2. The eCAP module of the adaptive dynamic adjustment strategy according to claim 1, characterized in that: The frequency monitoring module includes a frequency calculation module, a control logic CTRL0 and a frequency register. The control logic CTRL0 is used to read the timestamp in the capture register and input it into the frequency calculation module. The frequency calculation module is used to calculate the latest frequency of the input signal according to the timestamp and store it in the frequency register.

3. The eCAP module of the adaptive dynamic adjustment strategy according to claim 2, characterized in that: The frequency monitoring module also includes an accuracy calculation module, which is used to determine whether the latest frequency currently calculated by the frequency calculation module meets the preset capture accuracy, and when the latest frequency does not meet the preset capture accuracy, discard the latest frequency currently calculated and instruct the frequency register to latch the latest frequency obtained by the last calculation.

4. The eCAP module of any one of claims 1 to 3, characterized in that: The configuration update module includes a storage register and a control logic CTRL2, wherein the storage register is used to store the initial configuration pre-scaling coefficient and the optimal pre-scaling coefficient, and the control logic CTRL2 is used to update the pre-scaling coefficient previously used by the pre-scaling processing module to the optimal pre-scaling coefficient in real time.

5. The eCAP module of the adaptive dynamic adjustment strategy according to claim 4, characterized in that: The storage registers include register PRESERVE[4:0], register PRESERVE[9:5], register PRESERVE[10], register PRESERVE[11] and register PRESERVE[32:12]; The register PRESERVE[4:0] is used to store the initial configuration pre-division coefficient, the register PRESERVE[9:5] is used to store the optimal pre-division coefficient, the register PRESERVE[10] is used to select whether to enable the frequency monitoring module, the adaptive pre-division coefficient calculation module and the configuration update module, the register PRESERVE[11] is used to configure the configuration update module to enable the initial configuration pre-division coefficient or enable the optimal pre-division coefficient, and the register PRESERVE[32:12] is used as a reserved bit.

6. The eCAP module of the adaptive dynamic adjustment strategy according to claim 2, characterized in that: The frequency monitoring module also includes a polarity selection traversal table for instructing the control logic CTRL0 to select the value in the capture register as the input of the frequency calculation module according to the polarity of the polarity bit field CAPxPOL of the control register ECCTL1 initially configured by the eCAP module.

7. A digital signal processing system, characterized in that: The system chip comprises a system chip, wherein the system chip integrates an eCAP module with the adaptive dynamic adjustment strategy according to any one of claims 1 to 6.

8. A method for adaptively and dynamically adjusting the pre-scaling coefficient of an eCAP module, characterized in that: Based on the eCAP module of the adaptive dynamic adjustment strategy according to any one of claims 1 to 6, the method for adaptive dynamic adjustment of the pre-scaling coefficient of the eCAP module comprises the steps of: After the system is powered on and reset, the registers inside the eCAP module are initially configured; Load the edge timestamp corresponding to the input signal into the capture register according to the polarity selection of the polarity bit field of the control register ECCTL1; If the frequency monitoring module, the adaptive pre-scaling coefficient calculation module and the configuration update module are turned on, the frequency monitoring module immediately reads the timestamp from the capture register to perform frequency calculation; when the signal frequency calculated this time is compared with the signal frequency calculated last time to determine that it meets the currently set capture accuracy requirement, the signal frequency calculated this time is discarded and the signal frequency obtained last time is latched; The adaptive pre-scaling coefficient calculation module uses an adaptive algorithm to calculate a pre-scaling coefficient that meets the currently set capture accuracy according to the input new signal frequency and submits it to the configuration update module as the current new optimal pre-scaling coefficient; After the configuration update module receives the new optimal pre-scaling coefficient, if the pre-scaling coefficient used by the pre-scaling processing module is currently allowed to be updated, the configuration update module immediately configures the new optimal pre-scaling coefficient to the scale factor bit field of the control register ECCTL1.

9. The method for adaptively and dynamically adjusting the pre-scaling coefficient of the eCAP module according to claim 8, characterized in that: Also includes the steps: If the configuration update module is not enabled, the configuration update module latches the new optimal pre-scaling coefficient in register PRESERVE[9:5]; When the configuration update module is turned on, the configuration update module clears the latched pre-scaling coefficient value when detecting that the frequency monitoring module provides a new frequency to the adaptive pre-scaling coefficient calculation module; After waiting for the adaptive pre-scaling coefficient calculation module to provide a new optimal pre-scaling coefficient, the configuration update module submits the latest optimal pre-scaling coefficient to the pre-scaling coefficient bit field of the control register ECCTL1.

10. The method for adaptively and dynamically adjusting the pre-scaling coefficient of the eCAP module according to claim 8 or 9, characterized in that: Also includes the steps: If the frequency monitoring module, the adaptive pre-scaling coefficient calculation module and the configuration updating module are not enabled, the eCAP module directly starts to capture the timestamp of the input signal according to the initial configuration.

Citation Information

Patent Citations

  • Oscillator with automatic frequency selection function

    CN117544166A

  • Liquid level detection device with digital output adopted

    CN203758572U

  • Link port multi-clock signal detection device realized by chip eCAP module

    CN219957789U