Anti-jamming electronic metrology microcontroller system
By integrating an anti-interference electronic metering microcontroller system, the problems of anti-interference and metering accuracy of microcontrollers in complex electromagnetic environments are solved, achieving high-precision, low-power metering stability, which is suitable for metering equipment such as smart water meters and gas meters that require long-term operation.
Patent Information
- Application Number
- CN202511285022.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-09-10
AI Technical Summary
Existing microcontrollers are unable to meet the stringent requirements of electronic metrology in complex electromagnetic environments in terms of anti-interference capability, metrological accuracy, and stability, especially in industrial-grade high-precision measurement scenarios.
An anti-interference electronic metering microcontroller system is adopted, including a core control module, an anti-interference power management module, an adaptive filtering ADC module, an intelligent clock management module, a dynamic interrupt management module, and a low-power anti-interference module. The anti-interference capability is enhanced by optimizing instruction execution, responding quickly to voltage fluctuations, adaptive filtering, clock source switching, and interrupt signal shielding.
It improves the anti-interference capability and metering accuracy of the microcontroller in complex electromagnetic environments, ensures long-term working stability, and takes into account the low power consumption requirement, making it suitable for metering scenarios such as smart water meters and gas meters that require long-term monitoring.
Smart Images

Figure CN120779849B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electronic metrology technology and relates to an anti-interference electronic metrology microcontroller system. Background Technology
[0002] In the field of electronic metering, whether it's electronic meters used for civilian energy metering or high-precision industrial measuring equipment for monitoring parameters such as flow, pressure, and temperature in industrial production, the performance of the core control unit, the microcontroller, directly determines the reliability and accuracy of the metering results. These scenarios place extremely high demands on the microcontroller's metering accuracy, long-term operational stability, and anti-interference capabilities. The microcontroller not only needs to accurately acquire and process minute signals but also needs to maintain stable operation in complex electromagnetic environments to prevent external interference from distorting the metering data.
[0003] Currently, while mainstream microcontrollers have integrated modules closely related to metering functions, such as analog-to-digital converters, low-dropout linear regulators, and timers, their anti-interference performance in complex electromagnetic environments still has many problems. Existing microcontroller analog-to-digital converter modules are susceptible to high-frequency interference, the power supply system's response to voltage fluctuations is lagging, clock source interference leads to accumulated timing errors, and anti-interference capabilities are compromised in low-power modes.
[0004] In summary, the existing microcontrollers' anti-interference capabilities, metrological accuracy, and stability in complex electromagnetic environments are insufficient to meet the stringent requirements of the electronic metrology field, especially in industrial-grade high-precision measurement scenarios. Therefore, developing a microcontroller system with strong anti-interference capabilities, high-precision metrological characteristics, and low power consumption has become an urgent technical challenge in this field. Summary of the Invention
[0005] To address the problems existing in the background technology, this invention proposes an anti-interference electronic metering microcontroller system, aiming to develop a microcontroller system with strong anti-interference capability, high-precision metering characteristics, and low power consumption requirements.
[0006] This application provides an anti-interference electronic metering microcontroller system, including:
[0007] The core control module, anti-interference power management module, adaptive filter ADC module, intelligent clock management module, dynamic interrupt management module, and low-power anti-interference module;
[0008] The core control module is used to optimize the instruction pipeline and improve instruction execution efficiency;
[0009] The anti-interference power management module is used to activate a fast response mechanism when a voltage fluctuation is detected to exceed a threshold.
[0010] The adaptive filtering ADC module is used to monitor the high-frequency components of the input signal in real time, and to activate adaptive filtering when the interference intensity exceeds the interference intensity threshold.
[0011] The intelligent clock management module is used to monitor the frequency stability of the external crystal oscillator in real time. When the frequency stability exceeds the threshold, it automatically switches to the internal high-precision RC oscillator and performs timing error compensation.
[0012] The dynamic interrupt management module is used to detect the pulse width of the interrupt signal, identify interference signals, and shield them.
[0013] The low-power anti-interference module is used to wake up the system immediately when an external interruption or key input signal exceeds the interference threshold.
[0014] Optionally, the core control module includes software trap instructions, which are executed in two to four CPU clock cycles.
[0015] Optionally, the fast response mechanism specifically includes: if the voltage drops below the undervoltage reset threshold, initiating backup power switching; if the voltage fluctuates within the low-voltage detection threshold range, dynamically adjusting the output of the low-dropout linear regulator through the bandgap reference source calibration unit to compensate for the voltage deviation, as shown in the formula: ,in, The output voltage of the low dropout linear regulator. The reference voltage is K, and the calibration coefficient is K. To detect input voltage fluctuations.
[0016] Optionally, the adaptive filtering of the adaptive filtering ADC module specifically involves adjusting the downsampling rate according to the interference intensity, as shown in the formula: ,in The base downsampling rate is given, α is the adjustment coefficient, and I is the interference intensity. The threshold is set for interference intensity; simultaneously, moving average filtering is enabled, with a window size of [missing information]. N is an odd number.
[0017] Optionally, the timing error compensation formula of the intelligent clock management module is: ,in, To compensate for the time, The original timing value is given, and Δf is the frequency deviation before and after the switch. The target frequency.
[0018] Optionally, the interference interruption identification algorithm is used to detect the pulse width of the interruption signal to identify the interference signal. If the interruption signal pulse width detected by the interference interruption identification algorithm is less than the pulse width threshold, it is determined to be an interference signal.
[0019] Optionally, the low-power anti-interference module is configured in power-down mode as follows: the internal low-frequency RC oscillator control bit is set to 0 to enable the internal low-frequency RC oscillator, and the timer is set to 1 to enable the timer wake-up function. The response time for switching from power-down mode to working mode is less than or equal to a preset time, and RAM data is retained without loss during the switching process.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] This invention provides an anti-interference electronic metering microcontroller system, including a core control module, an anti-interference power management module, an adaptive filtering ADC module, an intelligent clock management module, a dynamic interrupt management module, and a low-power anti-interference module. The core control module optimizes instruction execution efficiency; the anti-interference power management module monitors voltage fluctuations and responds quickly; the adaptive filtering ADC module can dynamically adjust filtering parameters; the intelligent clock management module can switch clock sources and compensate for errors; the dynamic interrupt management module can configure external interrupts and shield interference; and the low-power anti-interference module retains some functions and can wake up the system when power is lost. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of an anti-interference electronic metering microcontroller system according to an embodiment of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] In one embodiment, such as Figure 1 As shown, an anti-interference electronic metering microcontroller system is provided. This anti-interference electronic metering microcontroller system includes: a core control module, an anti-interference power management module, an adaptive filtering ADC module, an intelligent clock management module, a dynamic interrupt management module, and a low-power anti-interference module.
[0025] The core control module integrates dual data pointer registers and interrupt vector offset functions, supports program memory paging encryption, and improves instruction execution efficiency by optimizing the instruction pipeline.
[0026] The anti-interference power management module includes a multi-stage voltage monitoring circuit. This multi-stage voltage monitoring circuit includes an undervoltage reset module, a low-voltage detection module, and a bandgap reference source calibration unit. The undervoltage reset module supports 8 levels of reset voltage adjustment, and the low-voltage detection module supports 8 levels of detection voltage adjustment. A fast response mechanism is activated when a voltage fluctuation exceeding a threshold is detected.
[0027] The adaptive filtering ADC module includes an interference detection and dynamic adjustment unit for filtering parameters. The interference detection is implemented through a comparator module, which monitors the high-frequency components of the input signal in real time and activates adaptive filtering when the interference intensity exceeds a threshold.
[0028] The intelligent clock management module integrates an internal high-precision RC oscillator and an external crystal oscillator, and includes clock source switching and error compensation mechanisms to monitor the frequency stability of the external crystal oscillator in real time. When the frequency stability exceeds a threshold, it automatically switches to the internal high-precision RC oscillator and performs timing error compensation.
[0029] The dynamic interrupt management module extends the external interrupt function, supports dynamic configuration of trigger modes and priorities for 4 external interrupts, and includes an interference interrupt identification algorithm that identifies and masks interference signals by detecting the pulse width of the interrupt signal.
[0030] The low-power anti-interference module keeps its internal low-frequency RC oscillator and timer working in power-down mode, and includes an interference wake-up mechanism. When an external interrupt or key input signal exceeds the interference threshold, the timer immediately wakes up the system.
[0031] The core control module, built on an enhanced 51 core, integrates dual data pointer registers and an optimized 3-level instruction pipeline, enabling efficient execution of metering algorithms and control logic. It stores the program in Flash and temporarily stores data in RAM. At startup, it loads an initialization program to configure the baseline parameters of each module. During operation, it schedules the entire system using instruction frames I=[M,P,V], where M is the module identifier, P is the parameter address, and V is the configuration value. The core control module supports interrupt vector offsets, allowing for rapid recovery to the pre-interrupt state even if strong interference causes a program reset, ensuring a continuous metering process.
[0032] The anti-interference power management module, based on a built-in low-dropout linear regulator, features a multi-stage voltage monitoring circuit, including undervoltage reset, low-voltage detection, and a bandgap reference source calibration unit. The undervoltage reset module supports 8 adjustable reset voltage levels, and the low-voltage detection module supports 8 adjustable detection voltage levels.
[0033] When the anti-interference power management module detects a voltage fluctuation exceeding a threshold, it triggers a fast response mechanism: if the voltage drops below the undervoltage reset threshold, it immediately initiates backup power switching; if the voltage fluctuates within the low-voltage detection threshold range, it dynamically adjusts the output of the low-dropout linear regulator (LDO) using a bandgap reference source to compensate for the voltage deviation, as shown in the following formula: ,in, This is the LDO output voltage. The reference voltage is 1.21V (typical value), K is the calibration coefficient (0.02-0.1), and ΔV is the detected voltage fluctuation (unit: V).
[0034] The adaptive filtering ADC module, based on a built-in 24-bit Σ-Δ ADC, includes interference detection and dynamic adjustment units for filtering parameters. Interference detection is achieved through a comparator module, which monitors the high-frequency components of the input signal in real time. When the interference intensity I (in mV) exceeds a threshold... (Configurable, default 50mV) When adaptive filtering is enabled: the downsampling rate (DSR) is adjusted according to the interference intensity. ,in, The base downsampling rate is used, and α is an adjustment coefficient; simultaneously, moving average filtering is enabled, and the window size is... (It is an odd number, ranging from 3 to 15).
[0035] The intelligent clock management module integrates an internal high-precision RC oscillator with an external crystal oscillator, and enhances anti-interference capabilities through clock source switching and error compensation mechanisms.
[0036] The frequency stability σ of the external crystal oscillator is monitored in real time. When the frequency stability of the external crystal oscillator exceeds the clock stability threshold, the system automatically switches to the internal high-precision RC oscillator and compensates for timing errors before and after the switch using the following formula:
[0037] ;
[0038] in, To compensate for the time, The original timing value is given, and Δf is the frequency deviation before and after the switch. The target frequency.
[0039] The dynamic interrupt management module receives signals through four external interrupt interfaces. It first uses a 50ns pulse width threshold to identify interference; signals with insufficient pulse width are masked and logged. Valid signals are then scheduled according to priority: metering signal interrupt (… =1) is the highest, power supply abnormal interruption ( =2) Secondly, ordinary external interrupts ( =3) Lowest.
[0040] The low-power anti-interference module is the core unit for balancing energy consumption and anti-interference capabilities in the system. Designed specifically for battery-powered or long-endurance electronic metering scenarios, it minimizes power consumption while ensuring rapid response to critical interference signals through refined mode control and wake-up mechanisms. The module supports two low-power states: power-down mode and idle mode. Power-down mode is the core energy-saving mode, significantly reducing system power consumption to only 1 / 10000 of the normal operating mode. Its core control logic revolves around the power-down mode configuration register, through precise management of the internal low-frequency RC oscillator and timer. When the internal low-frequency RC oscillator control bit is 1, entering power-down mode forcibly shuts down the internal low-frequency RC oscillator to cut off unnecessary clock sources, automatically restarting only when exiting mode and the internal low-frequency RC oscillator is 1. When the timer is 1 and a stable low-frequency clock signal is available, the timer can use the 32kHz clock provided by the internal low-frequency RC oscillator to count. Once a set threshold is reached, a wake-up is triggered, ensuring the system monitors external signals periodically.
[0041] To prevent a decrease in anti-interference capability under low power conditions, the low-power anti-interference module is designed with multiple wake-up protection mechanisms. External interrupts, keyboard input, general asynchronous receiver / transmitter (GAR) data frames, and timer overflows can all serve as wake-up sources, and the wake-up response time is strictly controlled within a preset time to ensure that critical events are not lost in environments with strong electromagnetic interference. Furthermore, the low-power anti-interference module dynamically adjusts the power output through a current reduction factor β, as shown in the formula: ,in, The rated current is β, which represents the current reduction factor. In power-down mode, the total current is compressed while retaining the RAM data retention circuitry to ensure rapid restoration of metering status upon wake-up. When the system is configured continuously... When there is no valid signal for 100 sampling cycles, the low-power anti-interference module automatically triggers the power-down mode; once a valid interference or metering signal is detected, the mode switch is immediately completed through clock switching and power compensation, forming a closed-loop process of low-power standby, fast wake-up and accurate metering, which is perfectly adapted to metering scenarios such as smart water meters and gas meters that require long-term monitoring.
[0042] In the anti-interference electronic metering microcontroller system, the working sequence of each module follows a timing logic of basic support, core scheduling, function execution, and dynamic optimization, as follows:
[0043] During system startup, the anti-interference power management module is the first to start, as all electronic modules rely on a stable power supply for operation. This module first initializes the low-dropout linear regulator (LDO) and outputs a reference voltage. (1.21V), and through the voltage compensation formula (in, The initial voltage calibration is completed for the output voltage of the low-dropout linear regulator (K is the calibration coefficient, and ΔV is the detected input voltage fluctuation). Simultaneously, the undervoltage reset module and low-voltage detection module are activated, setting the initial threshold to provide a stable power base for subsequent modules.
[0044] Approximately 10μs after the anti-interference power management module completes initialization, the intelligent clock management module starts up. It first activates the internal high-frequency RC oscillator, outputting an initial frequency, and simultaneously initiates external crystal preheating to ensure clock source stability. Clock stability is calculated... To provide the system with a precise time reference and ensure the timing coordination of subsequent modules, This is the measured frequency. This is the nominal frequency.
[0045] Within 5μs after the intelligent clock management module starts, the core control module starts. The core control module is responsible for loading the program into the Flash memory, initializing the dual data pointer registers and interrupt vector table, and sending initialization instructions to other modules through instruction frames L=[M,P,V], becoming the central scheduler of the system. Here, L represents the control instruction frame, which is a standardized data format for the core control module to send configuration instructions to other functional modules, used to realize the parameter configuration and working status control of each module. M is the module identifier, P is the parameter address, and V is the configuration value.
[0046] After the core control module completes initialization, the adaptive filtering ADC module and the dynamic interrupt management module start synchronously. The ADC module first configures the initial gain and basic downsampling rate of the programmable gain amplifier, and then starts the interference detection circuit and sets the interference intensity threshold. The interrupt management module configures the external interrupt trigger pulse width threshold and priority matrix, with metering signal interrupts having the highest priority, thus preparing for signal acquisition and interrupt response.
[0047] Finally, the low-power anti-interference module starts up within about 50μs after the system initialization is completed. It configures the wake-up response time and current reduction coefficient β in power-down mode, and works in conjunction with the anti-interference power management module and the intelligent clock management module to ensure that the system can still maintain anti-interference wake-up capability in low-power state.
[0048] After entering the steady-state operation phase, each module works in a periodic, coordinated sequence: the intelligent clock management module outputs a synchronous clock within the sampling period to trigger the ADC module to acquire signals, wherein the sampling period is: , For clock frequency, The sampling period is specified. The ADC module dynamically adjusts the filtering parameters based on the interference intensity and transmits the filtered data to the core control module. The adaptive filtering adjustment method of the adaptive filtering ADC module is as follows: the downsampling rate is adjusted according to the interference intensity, using the formula: ,in The base downsampling rate is given, α is an adjustment coefficient, and I is the interference intensity. The threshold is set for interference intensity; simultaneously, moving average filtering is enabled, with a window size of [missing information]. N is an odd number.
[0049] After the core control module integrates the data, it calibrates the output voltage in real time by monitoring the voltage fluctuation ΔV of the anti-interference power management module. Simultaneously, it determines whether to switch the clock source and executes the compensation formula based on the clock stability σ. (Δf is the frequency deviation,) For the target frequency, (The original timing value); the dynamic interrupt management module identifies the interrupt signal pulse width in real time. The system only responds to valid signals and schedules according to priority; the low-power module triggers a low-power mode when there is no valid signal during a continuous idle period threshold. At this time, the anti-interference power management module will trigger a power-down mode to reduce energy consumption, using the current formula. Reduce energy consumption This represents the output current in low-power mode, i.e., the operating current provided by the low-power anti-interference module to each functional module when the system enters power-down mode. β represents the rated current, and β represents the current reduction factor, used to quantify the reduction ratio of current in low-power mode.
[0050] When an anomaly occurs, such as voltage anomaly, clock instability, or strong interference, each module responds according to priority: the anti-interference power management module prioritizes triggering backup power switching within 10μs, the intelligent clock management module immediately switches to the internal oscillator and performs time compensation, the interrupt module temporarily increases the priority of metering interrupts, and the core control module suspends non-essential tasks and focuses on interference suppression, forming a closed-loop anti-interference mechanism.
[0051] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An anti-interference electronic metering microcontroller system, characterized in that, It includes a core control module, an anti-interference power management module, an adaptive filtering ADC module, an intelligent clock management module, a dynamic interrupt management module, and a low-power anti-interference module; The core control module is used to optimize the instruction pipeline and improve instruction execution efficiency; The anti-interference power management module is used to activate a fast response mechanism when a voltage fluctuation is detected to exceed a threshold. The adaptive filtering ADC module is used to monitor the high-frequency components of the input signal in real time, and to activate adaptive filtering when the interference intensity exceeds the interference intensity threshold. The intelligent clock management module is used to monitor the frequency stability of the external crystal oscillator in real time. When the frequency stability exceeds the threshold, it automatically switches to the internal high-precision RC oscillator and performs timing error compensation. The dynamic interrupt management module is used to detect the pulse width of the interrupt signal, identify interference signals, and shield them. The low-power anti-interference module, in power-down mode, is used to wake up the system immediately when an external interruption or key input signal exceeds the interference threshold; Specifically, the adaptive filtering of the adaptive filtering ADC module involves adjusting the downsampling rate based on the interference intensity, as shown in the formula: ,in The base downsampling rate is given, α is an adjustment coefficient, and I is the interference intensity. The threshold is set for interference intensity; simultaneously, moving average filtering is enabled, with a window size of [missing information]. N is an odd number.
2. The anti-interference electronic metering microcontroller system according to claim 1, characterized in that, The core control module includes software trap instructions, which are executed in two to four CPU clock cycles.
3. The anti-interference electronic metering microcontroller system according to claim 1, characterized in that, The rapid response mechanism is as follows: if the voltage drops below the undervoltage reset threshold, the backup power supply is switched on; if the voltage fluctuates within the low-voltage detection threshold range, the output of the low-dropout linear regulator is dynamically adjusted through the bandgap reference source calibration unit to compensate for the voltage deviation, as shown in the formula: ,in, The output voltage of the low dropout linear regulator. The reference voltage is K, and the calibration coefficient is K. To detect input voltage fluctuations.
4. The anti-interference electronic metering microcontroller system according to claim 1, characterized in that, The timing error compensation formula of the intelligent clock management module is as follows: ,in, To compensate for the time, The original timing value is given, and Δf is the frequency deviation before and after the switch. The target frequency.
5. The anti-interference electronic metering microcontroller system according to claim 1, characterized in that, The dynamic interrupt management module uses an interference interrupt identification algorithm to detect the pulse width of the interrupt signal to identify interference signals. If the pulse width of the interrupt signal detected by the interference interrupt identification algorithm is less than the pulse width threshold, it is determined to be an interference signal.
6. The anti-interference electronic metering microcontroller system according to claim 1, characterized in that, The low-power anti-interference module is configured to enable the internal low-frequency RC oscillator by setting the internal low-frequency RC oscillator control bit to 0 in power-down mode and to enable the timer wake-up function by setting the timer to 1 in power-down mode. The response time for switching from power-down mode to working mode is less than or equal to the preset time, and RAM data is retained without loss during the switching process.
Citation Information
Patent Citations
Anti-interference self-adjusting microcontroller system and controlling method thereof
CN103454949A
Intelligent electromagnetic interference protection system for power supply module
CN119966224A