CN101247123A - Single-chip system clock calibration method - Google Patents

Single-chip system clock calibration method Download PDF

Info

Publication number
CN101247123A
CN101247123A CNA2007101241185A CN200710124118A CN101247123A CN 101247123 A CN101247123 A CN 101247123A CN A2007101241185 A CNA2007101241185 A CN A2007101241185A CN 200710124118 A CN200710124118 A CN 200710124118A CN 101247123 A CN101247123 A CN 101247123A
Authority
CN
China
Prior art keywords
system clock
oscillator
frequency
instrument
chip
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
Application number
CNA2007101241185A
Other languages
Chinese (zh)
Inventor
吴明星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CNA2007101241185A priority Critical patent/CN101247123A/en
Publication of CN101247123A publication Critical patent/CN101247123A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Electric Clocks (AREA)

Abstract

A single-chip system clock adjusting method is suitable for the system clock adjusting of the data transmission measuring device and instrument, wherein, the electronic circuit part of the data transmission measuring device and instrument is composed of a single-chip (1), a counter module (2), other functional module and the like. The single-chip is arranged with a RC oscillator and an operable register which is used for adjusting the frequency of the RC oscillator. The system clock is generated by the embedded RC oscillator, and by counting the inputted one group or an impulse signal with standard width by the counter module (2) and comparing with the counting and adjusting constant quantity preset by the standard impulse, the new frequency calibrating constant quantity is calculated. The method of writing the constant quantity into the register which is in the single-chip (1) and is used for adjusting the frequency of RC oscillator and adjusting the frequency of the RC oscillator for obtaining the more accurate system clock settles the problems of instable and inaccurate frequency when the embedded RC oscillator of the single-chip is directly taken as the system clock.

Description

A kind of single-chip system clock calibration method
Technical field:
The present invention relates to a kind of single-chip system clock calibration method, be applicable to that number passes in the kilowatt meter reading-out system that metrical instrument, instrument and the management equipment of checking meter form, number passes the system clock calibration of metrical instrument, instrument, especially adopts single-chip microcomputer inside to carry the RC oscillator and does the system clock calibration that the number of system clock source passes metrical instrument, instrument.
Background technology:
Along with the development of technology and the raising of living standards of the people, intelligent remote is checked meter becomes the demand of modern society, bring great convenience for user and administrative department, from the line-disparting type kilowatt meter reading-out system of early stage metrical pulse signal sending type, copy the table system privately to number and in kilowatt meter reading-out system, be used widely in succession.
Number passes long-distance meter-reading system generally partly to be made up of number biography metrical instrument, the instrument and the management equipment of checking meter etc., and by the registration output of certain communication stipulations with metrical instrument, instrument, and remote transmission is to the rear end management system.For the equipment in the kilowatt meter reading-out system, need adopt unified, stable communication speed carries out communication, and the stability of communication speed is by each part of system or device interior, the stability of system clock and determining, for reaching the stability of certain system clock, usually adopt the high quartz oscillator of stability as system clock source, but the volume of quartz oscillator is bigger, price is also higher, be unfavorable for realizing the miniaturization of electronic circuit part, make electronic circuit partly be installed on metrical instrument, bring certain degree of difficulty in the instrument, also increased product cost.
Number biography formula bus metrical instrument, the electronic circuit part of instrument is formed by single-chip microcomputer and peripheral circuit, manufacture craft along with single-chip microcomputer, the raising of design level, many moneys single-chip microcomputer has been realized interior band RC oscillator, and have the exercisable register that is used to adjust the single-chip system clock frequency, at present, existing indivedual number passes metrical instrument, instrument has directly used the built-in RC oscillator of single-chip microcomputer as system clock, but because the frequency of the built-in RC oscillator of single-chip microcomputer, the centre frequency deviation of using with system is bigger, general about 5% deviation range, the less stable of while RC oscillator, variation with supply power voltage, the variation of ambient temperature and changing, and the fluctuation range of output frequency is bigger, causes the communication instability, even the situation of systemic breakdown happens occasionally.
Summary of the invention:
Purpose of design of the present invention: a kind of single-chip system clock Calibration Method is provided, realize directly using number to pass in metrical instrument, the instrument, the inner RC oscillator of single-chip microcomputer is as system clock source, obtain method stable, accurate system clock simultaneously, having does not need to increase oscillator peripheral components and circuit, reduces the use amount of electronic devices and components, reduced small product size, save product cost, be suitable for various operational environments simultaneously, and characteristics such as system clock is reliable and stable.
The present invention is achieved through the following technical solutions: number involved in the present invention passes metrical instrument, the electronic circuit of instrument is by single-chip microcomputer (1), counter module (2), other functional modules functional parts such as (3) is formed, wherein: counter module (2) can be integrated in the single-chip microcomputer (1), the built-in RC oscillator of single-chip microcomputer (1), and have an exercisable register that is used to adjust the RC oscillator frequency, if the name of this register is called OSCCAL, number passes metrical instrument, the system clock of electronic section in the instrument, the RC oscillator that is carried by single-chip microcomputer (1) provides, set number and pass the system clock of gauge table by the RC oscillator generation of interior band, frequency before triggering a calibrating frequency is f0, under this frequency condition, set in advance a frequency calibration constant Datal who deposits in the OSCCAL register, when needing the start-up system clock alignment, management equipment or other equipment pass metrical instrument toward number by checking meter, instrument sends the pulse signal of a group or a agreement width, if the pulses low width is TLin, the high level width is THin, suppose that number passes metrical instrument, counter module in the meter electronics circuit (2) is by the rising edge flip-flop number of input pulse, trailing edge stops counting, promptly the high level width THin to input pulse counts, the standard counting step that preestablishes THin is THcnt, after the flip-flop number module (2), in clock frequency is under the condition of f0, the level width that counter module (2) count down to is Tcnt, the level width gauge numerical value THcnt of Tcnt and predefined regular length is made comparisons, calculate the difference DELTA between THcnt and the Tcnt, after obtaining difference DELTA, carry out data processing, obtain new frequency calibration constant Data, Data is write the OSCCAL register, adjust the frequency of oscillation of the built-in RC oscillator of single-chip microcomputer (1), finish the calibration of single-chip microcomputer (1) system clock.
Basic skills of the present invention is: by single-chip microcomputer (1) system of external equipment to need calibration system clock, import one or one group of standard calibrating frequency pulse, it is calibration source, flip-flop number module (2) counting, the count value of counter module (2) is compared with the count calibrations value of being set by calibration source, obtain difference DELTA, with data processing, carry out the modification of frequency calibration constant, finish the calibration of system clock, the method of data processing can be varied, and data processing method commonly used has following two kinds:
First kind of data processing method: ranking operation method: difference DELTA and predefined weight coefficient δ are multiplied each other, calculate frequency correction coefficients a, a and primary frequency frequency calibration constant Datal are carried out computing can obtain new frequency calibration constant Data, new frequency calibration constant Data is write the OSCCAL register, finish the calibration of single-chip microcomputer (1) system clock.
Concrete mathematic(al) representation is as follows:
Difference DELTA=Tcnt-THcnt
a=Δ*δ
Data=Datal+a
Second kind of data processing method: successive approximation method: the deviate that preestablishes permission, promptly set difference DELTA, when the actual difference Δ is in setting the scope of difference DELTA, Datal is added 1 or subtract 1 computing, obtain new Data value, new frequency calibration constant Data is write the OSCCAL register, under the condition of new original frequency, calibrating frequency again is till the actual difference Δ is in the scope of setting difference DELTA then, through repeatedly approaching, finish the calibration of single-chip microcomputer (1) system clock.
Advantage of the present invention:
1, single-chip system clock calibration method provided by the present invention, directly adopt related number to pass inside RC oscillator that the single-chip microcomputer in metrical instrument, the instrument carries as system clock source, do not need to increase in addition the external oscillator circuit, can dwindle the size of the electronic circuit board of number biography metrical instrument, instrument, lower assembly space, simultaneously do not need outside oscillating circuit, can reduce product cost.
2, by adopting single-chip system clock calibration method provided by the present invention, realization will be counted and be passed inside RC oscillator frequency that the single-chip microcomputer in the gauge table carries and be calibrated to automatically and satisfy the requirement that whole system is stablized communication, improve the stability and the reliability of whole system communication.
3, by single-chip system clock calibration method provided by the present invention, can realize that number passes metrical instrument, the accurate calibrating frequency of instrument before dispatching from the factory, and number passes metrical instrument, instrument is used later on-the-spot online calibrating frequency, make product can adapt to different conditions of work, eliminate of the influence of factors such as environment for use variations in temperature, voltage fluctuation, improved the stability and the reliability of product work communication robust.
Description of drawings:
Below, in conjunction with the accompanying drawings concrete enforcement of the present invention is described further:
Fig. 1: the number of one embodiment of the present of invention passes metrical instrument, meter electronics circuit block diagram
Fig. 2: the work schedule schematic diagram of one embodiment of the present of invention
Fig. 3: the workflow schematic flow sheet of one embodiment of the present of invention
Specific embodiments:
Accompanying drawing 1, Fig. 2, Fig. 3 provide one embodiment of the present of invention without limitation, and the present invention will be further described below in conjunction with embodiment.
As shown in Figure 1: number involved in the present invention passes metrical instrument, the electronic circuit part of instrument, comprise: single-chip microcomputer (1), counter module (2), other functional modules (3) are formed, wherein: counter module (2) can be integrated in the single-chip microcomputer (1), the built-in RC oscillator of single-chip microcomputer (1), and have an exercisable register OSCCAL that is used to adjust the RC oscillator frequency, system clock is provided by the RC oscillator that single-chip microcomputer (1) carries, and other functional module (3) has contained several biography metrical instruments, the communication interface function of instrument, the power supply processing capacity, functional parts such as DATA REASONING or digital coding function.
As shown in Figure 2: the counter that this embodiment provided starts operating mechanism and is: counted by input pulse rising edge flip-flop number module (2), after the enabling counting device module (2), stop counter module (2) counting when detecting the input pulse trailing edge, finish a count cycle, to a calibrating frequency process, according to different instructions for uses, can adopt the individual pulse sample count, also can finish by set of pulses sampling, the count value of counter module (2) is defined as successively: T1cnt, T2cnt, T3cnt......Tncnt, in conjunction with Fig. 3, specify its workflow again:
1, single-chip microcomputer (1) works on power, finish its initial work, when initial work, be written into the following parameters that sets in advance or preserve: according to stipulations, the comparison value Tcnt to calibration pulse counting width of agreement, from register OSCCAL, read, or the original calibrating frequency constant Datal that presets.
2, wait for and catch the input of external perimysium reference pulse signal, according to concrete instructions for use, the pulse signal that is used for the input of calibrating frequency, be a group or a pulse signal, defining its high level width is THin, low level width is TLin, and signal can also can be the commissioning device output in producing by the management equipment output of checking meter of scene operation.
3, when capturing the rising edge of calibration pulse signal, beginning enabling counting device module (2), counter begins counting, behind the trailing edge that detects calibration pulse, stops counting, and defining current count value is Tcnt.
4, carry out data processing by single-chip microcomputer (1), current Tcnt and predefined regular length level width gauge numerical value THcnt are made comparisons, calculate the difference DELTA between THcnt and the Tcnt, carry out data processing, obtain new frequency calibration constant Data, and Data write the OSCCAL register, finish the calibration of single-chip microcomputer (1) system clock.
Obviously, the system clock calibration method of the number biography metrical instrument shown in the embodiment, instrument is counted input pulse by simple, easy only passing through of realizing, the count calibrations constant that relatively sets in advance, finish the built-in RC oscillator of direct use single-chip microcomputer as the system clock oscillator, and obtain to be directly used in the clock request of communication, the present invention realizes simply, can save product cost, and solves the problem of environmental impact, has very high promotional value.
Certainly; the compute mode of handling enumeration data can be varied; the mode of counter triggers is varied; workflow also can be varied; in addition to the implementation; the present invention can also have other execution modes, and all employings are equal to the technical scheme of replacement or equivalent transformation formation, all drop in the protection range of claim of the present invention.

Claims (2)

1. single-chip system clock Calibration Method, be applicable to by number and pass metrical instrument, calibrate during the system of instrument, it is characterized in that: number passes metrical instrument, the electronic circuit part of instrument is by single-chip microcomputer (1), counter module (2), other functional modules (3) are formed, the built-in RC oscillator of single-chip microcomputer (1), and have an exercisable register that is used to adjust the RC oscillator frequency, the frequency of oscillation that built-in RC oscillator produces is used as system clock, by the pulse signal of counter module (2) to a group or a normal width of input, it is calibration source, count, and compare with the count calibrations constant that presets by the calibration pulse width, calculation process, the frequency calibration constant that calculating makes new advances, this constant is write the register that is used to adjust the RC oscillator frequency in the single-chip microcomputer, proofread and correct the frequency of oscillation of the built-in RC oscillator of single-chip microcomputer (1), obtain accurate system clock.
2. single-chip system clock calibration method according to claim 1 is characterized in that: counter module (2) can be integrated in the single-chip microcomputer (1).
CNA2007101241185A 2007-10-24 2007-10-24 Single-chip system clock calibration method Pending CN101247123A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2007101241185A CN101247123A (en) 2007-10-24 2007-10-24 Single-chip system clock calibration method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2007101241185A CN101247123A (en) 2007-10-24 2007-10-24 Single-chip system clock calibration method

Publications (1)

Publication Number Publication Date
CN101247123A true CN101247123A (en) 2008-08-20

Family

ID=39947383

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2007101241185A Pending CN101247123A (en) 2007-10-24 2007-10-24 Single-chip system clock calibration method

Country Status (1)

Country Link
CN (1) CN101247123A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101571410A (en) * 2009-06-04 2009-11-04 吴明星 Intelligent opto-electrical direct reader
CN102236363A (en) * 2010-04-28 2011-11-09 上海华虹集成电路有限责任公司 Full-speed USB (Universal Serial Bus) equipment
CN102331979A (en) * 2011-09-28 2012-01-25 成都市芯锐微电子有限公司 Dynamic clock frequency calibration method applied to universal serial bus (USB) equipment
CN103677078A (en) * 2012-09-04 2014-03-26 国民技术股份有限公司 Method, system and chip for calibrating clock frequency
CN103761158A (en) * 2014-01-16 2014-04-30 刘宝成 Method for recalibrating base line PIC single chip microcomputer inner oscillator
CN103954833A (en) * 2014-05-12 2014-07-30 万高(杭州)科技有限公司 Electric energy meter, metering chip and built-in clock signal modulation method thereof
CN104850170A (en) * 2015-06-04 2015-08-19 万高(杭州)科技有限公司 Crystal-metering-free SoC (system-on-chip) and clock acquiring method thereof
CN104869628A (en) * 2015-04-30 2015-08-26 广东美的制冷设备有限公司 Clock calibration method of air-condition electric control device, air-condition electric control device, terminal and system
CN104978842A (en) * 2015-06-10 2015-10-14 烟台东方威思顿电气股份有限公司 Self-repair method of low-pressure concentrator clock
CN108958092A (en) * 2017-05-23 2018-12-07 青岛海尔洗衣机有限公司 Clock method for detecting abnormality and device, computer readable storage medium, equipment
CN111443587A (en) * 2020-04-16 2020-07-24 珠海泰芯半导体有限公司 External clock calibration method and system
CN111487683A (en) * 2020-04-20 2020-08-04 合肥国为电子有限公司 Groove wave seismograph and underground clock calibration and time synchronization method thereof
CN112061919A (en) * 2020-08-31 2020-12-11 杭州临安森源电缆有限公司 Method for testing timing counter of elevator
CN114553355A (en) * 2022-01-18 2022-05-27 山东梅格彤天电气有限公司 High-precision time synchronization method, device and system for low-voltage intelligent terminal
CN116318120A (en) * 2023-03-30 2023-06-23 归芯科技(深圳)有限公司 Calibration circuit, calibration method, chip and electronic equipment of RC oscillation clock

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101571410B (en) * 2009-06-04 2013-04-24 吴明星 Intelligent opto-electrical direct reader
CN101571410A (en) * 2009-06-04 2009-11-04 吴明星 Intelligent opto-electrical direct reader
CN102236363A (en) * 2010-04-28 2011-11-09 上海华虹集成电路有限责任公司 Full-speed USB (Universal Serial Bus) equipment
CN102331979A (en) * 2011-09-28 2012-01-25 成都市芯锐微电子有限公司 Dynamic clock frequency calibration method applied to universal serial bus (USB) equipment
CN103677078B (en) * 2012-09-04 2017-11-21 国民技术股份有限公司 A kind of calibration method of clock frequency, system and chip
CN103677078A (en) * 2012-09-04 2014-03-26 国民技术股份有限公司 Method, system and chip for calibrating clock frequency
CN103761158A (en) * 2014-01-16 2014-04-30 刘宝成 Method for recalibrating base line PIC single chip microcomputer inner oscillator
CN103954833A (en) * 2014-05-12 2014-07-30 万高(杭州)科技有限公司 Electric energy meter, metering chip and built-in clock signal modulation method thereof
CN103954833B (en) * 2014-05-12 2017-12-19 杭州万高科技股份有限公司 A kind of electric energy meter, computation chip and its onboard clock signal modulating method
CN104869628A (en) * 2015-04-30 2015-08-26 广东美的制冷设备有限公司 Clock calibration method of air-condition electric control device, air-condition electric control device, terminal and system
CN104850170A (en) * 2015-06-04 2015-08-19 万高(杭州)科技有限公司 Crystal-metering-free SoC (system-on-chip) and clock acquiring method thereof
CN104978842A (en) * 2015-06-10 2015-10-14 烟台东方威思顿电气股份有限公司 Self-repair method of low-pressure concentrator clock
CN104978842B (en) * 2015-06-10 2018-03-06 烟台东方威思顿电气有限公司 A kind of method of low pressure concentrator clock self-regeneration
CN108958092A (en) * 2017-05-23 2018-12-07 青岛海尔洗衣机有限公司 Clock method for detecting abnormality and device, computer readable storage medium, equipment
CN108958092B (en) * 2017-05-23 2022-11-04 佛山市顺德海尔电器有限公司 Singlechip clock anomaly detection method and device, computer readable storage medium and equipment
CN111443587A (en) * 2020-04-16 2020-07-24 珠海泰芯半导体有限公司 External clock calibration method and system
CN111487683A (en) * 2020-04-20 2020-08-04 合肥国为电子有限公司 Groove wave seismograph and underground clock calibration and time synchronization method thereof
CN111487683B (en) * 2020-04-20 2023-04-18 合肥国为电子有限公司 Groove wave seismograph and underground clock calibration and time synchronization method thereof
CN112061919A (en) * 2020-08-31 2020-12-11 杭州临安森源电缆有限公司 Method for testing timing counter of elevator
CN114553355A (en) * 2022-01-18 2022-05-27 山东梅格彤天电气有限公司 High-precision time synchronization method, device and system for low-voltage intelligent terminal
CN116318120A (en) * 2023-03-30 2023-06-23 归芯科技(深圳)有限公司 Calibration circuit, calibration method, chip and electronic equipment of RC oscillation clock
CN116318120B (en) * 2023-03-30 2024-05-03 归芯科技(深圳)有限公司 Calibration circuit, calibration method, chip and electronic equipment of RC oscillation clock

Similar Documents

Publication Publication Date Title
CN101247123A (en) Single-chip system clock calibration method
CN103529904B (en) Clock correction circuit and clock correction method
CN102331979B (en) Dynamic clock frequency calibration method applied to universal serial bus (USB) equipment
CN100456858C (en) Time error compensation device and method for terminal
CN102176112B (en) Method for achieving accurate clock timing by arranging RTC (real time clock) in MCU (micro control unit)
CN101930211B (en) Clock source device based on GPS second pulse and control method thereof
CN108063617A (en) The clock frequency calibration method and system of a kind of low frequency RC oscillators
CN100516898C (en) High precision clock detecting method and testing apparatus
CN103063321B (en) Platinum resistance temperature measuring equipment and temperature measuring method thereof
EP3748319B1 (en) Aging calibration for temperature sensor
CN101626587A (en) Crystal auto-calibration method and apparatus
CN111766771A (en) Voltage-controlled crystal oscillator taming-based time interval measuring method and system
CN102081143A (en) Estimation method and system of battery capacity
CN104375004A (en) Method and system for measuring crystal oscillator frequency error
CN102857197A (en) Calibration method for improving frequency accuracy of built-in remote control (RC) oscillator
CN202720032U (en) Measurement and control system of electromagnetic force balanced type electronic balance
CN109188335A (en) Clock of power meter offset detection system and method
CN102882672A (en) Method and device for calibrating dynamic token clock
CN111026232A (en) Clock calibration method, chip and electronic equipment
CN207457344U (en) Equal precision frequency meter based on FPGA and its soft core
CN101136627B (en) Method for automatically setting high-stability constant temperature crystal oscillator parameter
CN112737574A (en) Timing calibration method of chip internal clock source and related device
CN207964942U (en) A kind of time domain measurement system
CN203909178U (en) Multifunctional digital electric power meter
CN111897202A (en) RTC (real time clock) calibration circuit and method of smoke detector MCU (microprogrammed control Unit)

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20080820