The invention discloses a method for improving the precision of a built-in real-time
clock of an
electric energy meter MCU. Based on the practical
crystal oscillator frequency, fine compensation can be achieved. An
electric energy meter comprises the MCU, a
crystal oscillator and a
power management unit. The method for improving the precision of the built-in real-time
clock of the
electric energy meter MCU includes the following steps of compensation amount calculation and
clock calibration. Compensation amount calculation is performed according to the following processes that firstly, frequency deviations of the practical
crystal oscillator under different temperatures are measured; secondly, a temperature-
frequency deviation curve sketch is drawn, and the turn temperature T0 is found out; thirdly, the measured frequency deviations of the two sides of T0 undergo
curve fitting, and a corresponding buckling constant is obtained; fourthly, a temperature-
frequency deviation function table is formed according to a function of the third process, the
frequency deviation value of the current temperature can be obtained through the temperature-frequency
deviation function table according to the practical
environmental temperature, and the frequency deviation value serves as the compensation amount for calibrating the clock under the practical
environmental temperature. According to the method for improving the precision of the built-in real-time clock of the electric energy meter MCU, an accurate compensation value can be obtained according to errors of the practical
crystal oscillator, and therefore the precision of the clock is improved.