Supercharge Your Innovation With Domain-Expert AI Agents!

Method for achieving accurate clock timing by arranging RTC (real time clock) in MCU (micro control unit)

A precise and clock-based technology, applied in electronic timers, clocks and watches, changing time indications, etc., can solve the problems of additional wiring, inaccurate clocks of electric energy meters, large investment, etc., and achieve the effect of calibrating clocks and accurate clocks

Active Publication Date: 2011-09-07
JIANGSU LINYANG ENERGY CO LTD
View PDF3 Cites 22 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] At present, the traditional electric energy meter clock usually adopts an independent RTC mode with temperature compensation. Using this mode requires additional wiring, occupies MUC resources, and requires a large investment.
The MUC built-in RTC has great advantages in performance and price, but because of the use of an external crystal, it is easily affected by temperature and generates frequency offset, resulting in the error of the MCU built-in RTC being much larger than that of an independent RTC with temperature compensation. As a result, the clock of the energy meter is inaccurate

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for achieving accurate clock timing by arranging RTC (real time clock) in MCU (micro control unit)
  • Method for achieving accurate clock timing by arranging RTC (real time clock) in MCU (micro control unit)

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0012] Such as figure 1 Shown, the present invention, MCU built-in RTC realizes the method for accurate timing of clock, comprises the following steps:

[0013] (1) Adjustment of the prescaler: In the case of using a kHZ crystal oscillator, the default value of the prescaler is k-1, and the prescaler counts to a value of k to generate a 1-second pulse interrupt. Therefore, for the prescaler counter, every time a "bit" is adjusted, the corresponding adjustment error is: 1 / k*1000,000 ppm, the adjustment can be controlled by software, and the adjustment takes effect within 1 second;

[0014] (2) Adjustment of the clock calibration register: In a fixed time window, the temperature sensor collects the external temperature, and uses the temperature to find the value of the frequency offset to calculate the actual number of frequency offset PPM, thereby calculating the value of the calibration register;

[0015] (3) The temperature is sampled by the temperature sensor, and the frequ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for achieving accurate clock timing by arranging an RTC (real time clock) in an MCU (micro control unit). The method comprises the following steps: (1) adjustment of a prescaler: setting the default value of the prescaler as (k-1) when a kHZ crystal oscillator is utilized, and generating one second pulse interruption when the counting of the prescaler is k; (2) adjustment of a clock calibration register: utilizing a temperature sensor to collect the external temperature in a fixed time window, looking for the value of frequency offset according to the temperature, calculating the number of the actual frequency offset PPM (percent per million), and calculating the value of the calibration register; (3) utilizing the temperature sensor to sample the temperature, measuring the frequency output at the corresponding temperature, calculating the frequency offset acc according to a reference frequency, fitting the k value of a function of the temperature and the frequency offset based on the large amount of data so as to a temperature-frequency offset table, and looking for the table to obtain the accurate frequency offset PPM value through software; and (4) writing the corresponding value to the prescaler register and calibration register of the RTC during the service program interruption of the RTC.

Description

technical field [0001] The invention relates to a method for realizing accurate timing of clocks with built-in RTCs in various single-phase, three-phase and multi-function electric energy meters. Background technique [0002] At present, the traditional electric energy meter clock usually adopts an independent RTC mode with temperature compensation. Using this mode requires additional wiring, occupies MUC resources, and requires a large investment. The MUC built-in RTC has great advantages in performance and price, but because of the use of an external crystal, it is easily affected by temperature and generates frequency offset, resulting in the error of the MCU built-in RTC being much larger than that of an independent RTC with temperature compensation. As a result, the clock of the energy meter is inaccurate. Therefore, how to adjust the prescaler register and clock calibration register of the MCU built-in RTC according to the crystal oscillation characteristics and tempe...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G04G5/00
Inventor 梁世清陆永华尹建丰季海涛
Owner JIANGSU LINYANG ENERGY CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More