CN102520222A - Electric energy meter system anti-interference control method - Google Patents
Electric energy meter system anti-interference control method Download PDFInfo
- Publication number
- CN102520222A CN102520222A CN2011103330391A CN201110333039A CN102520222A CN 102520222 A CN102520222 A CN 102520222A CN 2011103330391 A CN2011103330391 A CN 2011103330391A CN 201110333039 A CN201110333039 A CN 201110333039A CN 102520222 A CN102520222 A CN 102520222A
- Authority
- CN
- China
- Prior art keywords
- external memory
- electric energy
- energy meter
- tagged word
- interrupt
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention relates to an electric energy meter system anti-interference control method. The method comprises the following steps: before a CPU reads data, firstly whether an external memory is in normal working or not is determined, which means that a method of sending a tagged word to the external memory, reading out the tagged word and determining whether a result is consistent with the sent tagged word or not is employed, if so, it is proved that the external memory is in normal working, at that time, data read from the external memory by the CPU is correct data, if not, it is proved that the external memory still does not in normal working, after a period of time, the tagged word is sent to the external memory again for carrying out detection until a read result is same with written data, repetition number n is set, when repetition is carried out n times, the read result is not same with the written data, a system is restarted, and the memory is protected. By employing the method, a phenomenon that power supply voltage rises too slow and leads to wrong modification of a record result is avoided.
Description
Technical field:
The present invention relates to the electric energy meter technical field, specifically is the anti-interference control method of a kind of electric energy meter system.
Background technology:
Electric energy meter can receive the interference that electric power system produces in actual moving process; Special in electric energy meter system with power down protection writing function; When electric energy meter re-powers; CPU can read once more and be stored in data in the storer; This just requires to improve the power supply quality of electric power system, as uses measures such as various voltage stabilizers, power adjustment to eliminate the influence of electric network noises, promptly adopts measure on the hardware circuit to eliminate the phenomenon of the mistake upset of the voltage comparator that electric energy meter causes because of the voltage fluctuation of electric power system.
Though electric energy meter is taked certain measure to the interference of voltage fluctuation on hardware, for powering on the stage of electric energy meter, the read-write mistake of the inharmonious appearance of system works; Hardware can't solve: during system power-on phase; Because pcb board is printed the influence of lines inductance, supply voltage rises slowly, when CPU operate as normal; Voltage comparator circuit output is low level still, causes sending external interrupt signal.Though storer itself has the write-protect end, unstable because of system works, as not taking necessary software processes measure, still can make system produce interrupt response, thereby change by mistake the record result, the random number write store among the RAM of the stage CPU that is about to power on.
Summary of the invention:
The technical matters that the present invention will solve is, overcomes existing technological deficiency, powering on the stage of a kind of solution is provided, the anti-interference control method of electric energy meter system of the read-write mistake of the inharmonious appearance of system works.
Technical solution of the present invention is, provides a kind of electric energy meter system anti-interference control method, and it may further comprise the steps:
(1), begins program initialization, and disabled interrupt;
(2), whether inquiry have an external interrupt, if external interrupt is arranged, then interrupt, and continue inquiry, if no external interrupt then gets into next step;
(3), wait for that t1 after the time, sends into tagged word, and then reads out in external memory storage; And whether judged result is consistent with the value of the tagged word of sending into, if identical, then proves external memory storage operate as normal; Get into step (5),, then return step (3) if inequality;
(4), repeat after n time, still inequality, then system restarts, and returns step (1),
(5), playback record data and parameter is set;
(6), open interruption, entering electric energy meter master routine.
Said t1 is 10ms, and said n is 3.
After adopting said method, the present invention has the following advantages:
Whether the present invention judges external memory storage operate as normal earlier before the CPU reading of data, promptly adopt to storer and send into tagged word, and read out; If the method whether judged result is consistent with the tagged word of sending into identical, then proves external memory storage operate as normal; Data in the CPU reading external memory are correct data at this moment, if inequality, explain that then external memory storage does not still have operate as normal; Send into tagged word once more after then waiting for a period of time and detect, until the result who reads with write identical, but owing to the erasable number of times of storer is limited; Pernicious situation in order to prevent to occur is provided with multiplicity n, when repeating after n time; Still inequality, then system restarts, thus protected storage.Adopt this method because each duty that CPU writes before, detects external memory storage, therefore, overcome supply voltage and had risen slowly, cause changing by mistake the phenomenon generation of writing down the result.
Description of drawings:
Accompanying drawing is the process flow diagram of the anti-interference control method of electric energy meter system of the present invention.
Embodiment:
Below in conjunction with accompanying drawing and embodiment the present invention is done further detailed explanation.
As shown in the figure, the present invention provides a kind of electric energy meter system anti-interference control method, and it may further comprise the steps:
(1), begins program initialization, and disabled interrupt; During beginning, first disabled interrupt, the data in the reading external memory, the model of the external memory storage that adopts in the present embodiment are AT24C02.
(2), whether inquiry have an external interrupt, if external interrupt is arranged, then interrupt, and continue inquiry, if no external interrupt then gets into next step; This step is that the Interrupt Process of handling is accomplished, and prevents to influence each other.
(3), wait for that t1 after the time, sends into tagged word, and then reads out in external memory storage; And whether judged result is consistent with the value of the tagged word of sending into, if identical, then proves external memory storage operate as normal; Get into step (5),, then return step (3) if inequality; Tagged word can be used 55H (01010101B) or AAH (10101010B).
(4), repeat after n time, still inequality, then system restarts, and returns step (1); Because the erasable number of times of external memory storage is limited, for the vicious cycle that prevents to occur, so set multiplicity n; After repetition n time, still inequality, CPU gets into endless loop; In endless loop, do not visit house dog, above (about 1.6S, house dog allows the maximum access time interval) after the certain hour; House dog sends reset signal, and system restarts.
(5), playback record data and parameter is set; The external memory storage operate as normal then can the reading external memory data recorded perhaps be provided with parameter;
(6), open interruption, entering electric energy meter master routine.
Said t1 is 10ms, and said n is 3.
After adopting said method, the present invention has the following advantages:
Whether the present invention judges external memory storage operate as normal earlier before the CPU reading of data, promptly adopt to storer and send into tagged word, and read out; If the method whether judged result is consistent with the tagged word of sending into identical, then proves external memory storage operate as normal; Data in the CPU reading external memory are correct data at this moment, if inequality, explain that then external memory storage does not still have operate as normal; Send into tagged word once more after then waiting for a period of time and detect, until the result who reads with write identical, but owing to the erasable number of times of storer is limited; Pernicious situation in order to prevent to occur is provided with multiplicity n, when repeating after n time; Still inequality, then system restarts, thus protected storage.Adopt this method because each duty that CPU writes before, detects external memory storage, therefore, overcome supply voltage and had risen slowly, cause changing by mistake the phenomenon generation of writing down the result.
Claims (2)
1. anti-interference control method of electric energy meter system, it is characterized in that: it may further comprise the steps:
(1), begins program initialization, and disabled interrupt;
(2), whether inquiry have an external interrupt, if external interrupt is arranged, then interrupt, and continue inquiry, if no external interrupt then gets into next step;
(3), wait for that t1 after the time, sends into tagged word, and then reads out in external memory storage; And whether judged result is consistent with the value of the tagged word of sending into, if identical, then proves external memory storage operate as normal; Get into step (5),, then return step (3) if inequality;
(4), repeat after n time, still inequality, then system restarts, and returns step (1),
(5), playback record data and parameter is set;
(6), open interruption, entering electric energy meter master routine.
2. the anti-interference control method of electric energy meter system according to claim 1 is characterized in that: said t1 is 10ms, and said n is 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011103330391A CN102520222A (en) | 2011-10-28 | 2011-10-28 | Electric energy meter system anti-interference control method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011103330391A CN102520222A (en) | 2011-10-28 | 2011-10-28 | Electric energy meter system anti-interference control method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102520222A true CN102520222A (en) | 2012-06-27 |
Family
ID=46291210
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011103330391A Pending CN102520222A (en) | 2011-10-28 | 2011-10-28 | Electric energy meter system anti-interference control method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102520222A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104317746A (en) * | 2014-10-27 | 2015-01-28 | 安徽江淮汽车股份有限公司 | Data redundancy access method for EEPROM (electrically erasable programmable read-only memory) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101197191A (en) * | 2001-09-13 | 2008-06-11 | 株式会社瑞萨科技 | Memory card and its initial setting method |
CN201387448Y (en) * | 2009-02-25 | 2010-01-20 | 青岛乾程电子科技有限公司 | Multi-functional electric energy meter with high-reliability data storage function |
CN101923112A (en) * | 2010-07-26 | 2010-12-22 | 珠海中慧微电子有限公司 | Method for managing high reliability of electric energy measurement data |
-
2011
- 2011-10-28 CN CN2011103330391A patent/CN102520222A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101197191A (en) * | 2001-09-13 | 2008-06-11 | 株式会社瑞萨科技 | Memory card and its initial setting method |
CN201387448Y (en) * | 2009-02-25 | 2010-01-20 | 青岛乾程电子科技有限公司 | Multi-functional electric energy meter with high-reliability data storage function |
CN101923112A (en) * | 2010-07-26 | 2010-12-22 | 珠海中慧微电子有限公司 | Method for managing high reliability of electric energy measurement data |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104317746A (en) * | 2014-10-27 | 2015-01-28 | 安徽江淮汽车股份有限公司 | Data redundancy access method for EEPROM (electrically erasable programmable read-only memory) |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9645829B2 (en) | Techniques to communicate with a controller for a non-volatile dual in-line memory module | |
US8832530B2 (en) | Techniques associated with a read and write window budget for a two level memory system | |
CN106020721B (en) | Memory device and energy-saving control method thereof | |
KR101447142B1 (en) | Write energy conservation in memory | |
CN110415752B (en) | Memory controller for controlling refresh operation and memory system including the same | |
CN103544080B (en) | A kind of data guard method, Apparatus and system | |
CN105283918A (en) | Apparatus, method and system for memory device access with a multi-cycle command | |
CN107408099A (en) | Based on the impedance-compensated of detection sensor data | |
CN102214152A (en) | Fast exit from self-refresh state of a memory device | |
TWI473099B (en) | Memory storage device, memory controller and controlling method | |
WO2009017991A1 (en) | Devices, methods, and apparatuses for detection, sensing and reporting functionality for semiconductor memory | |
TW200746155A (en) | Semiconductor memory and method for testing the same | |
CN103809994A (en) | Solid state storage device and sleep control circuit thereof | |
US20180034993A1 (en) | Chip, imaging cartridge, and communication method between the chip and imaging device | |
CN101517547A (en) | Memory system and memory chip | |
CN105653332B (en) | A kind of MCU system and method for burn-recording for correcting OTP burning problem | |
CN113223566B (en) | Control system and control method of memory | |
CN102915209B (en) | Storage control chip, storage equipment and system data writing method | |
CN109144778A (en) | A kind of storage server system and its backup method, system and readable storage medium storing program for executing | |
CN102520222A (en) | Electric energy meter system anti-interference control method | |
CN109901664A (en) | Method, apparatus, system, equipment and the readable storage medium storing program for executing of clock signal are provided | |
CN206331414U (en) | A kind of solid state hard disc | |
WO2008042201A3 (en) | Memory write timing system | |
CN106547577B (en) | Method and device for burning microcontroller chip | |
CN1937075B (en) | Data transfer operation completion detection circuit and semiconductor memory device provided therewith |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20120627 |