CN101252357B - Method for correcting parameter - Google Patents

Method for correcting parameter Download PDF

Info

Publication number
CN101252357B
CN101252357B CN2007100690844A CN200710069084A CN101252357B CN 101252357 B CN101252357 B CN 101252357B CN 2007100690844 A CN2007100690844 A CN 2007100690844A CN 200710069084 A CN200710069084 A CN 200710069084A CN 101252357 B CN101252357 B CN 101252357B
Authority
CN
China
Prior art keywords
value
msp430
formula
aclk
frg
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.)
Active
Application number
CN2007100690844A
Other languages
Chinese (zh)
Other versions
CN101252357A (en
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.)
Lierda Science & Technology Group Co Ltd
Original Assignee
陈贤兴
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 陈贤兴 filed Critical 陈贤兴
Priority to CN2007100690844A priority Critical patent/CN101252357B/en
Publication of CN101252357A publication Critical patent/CN101252357A/en
Application granted granted Critical
Publication of CN101252357B publication Critical patent/CN101252357B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Electric Clocks (AREA)

Abstract

The invention relates to a parameter correction method to make internal reference voltage, DCO and external OSC more precise in use, and a correction system. Vref, DCO or OSC calibration programs are downloaded to a target MCU and then the calibration programs are executed, and the actual Vref, DCO or OSC calibration programs after calibration are written to Information A, so a user can use conveniently, thus limiting measurement error and improving timepiece precision.

Description

Parameter correcting method
Technical field
The present invention relates to a kind of internal reference voltage, DCO and outside OSC more precise parameters bearing calibration and corrective system in the use of making.
Background technology
The use of MSP430A/D internal reference voltage (being called for short Vref), DCO and outside OSC all deviation can occur to a great extent at present, and neither one can accurately be proofreaied and correct the method and system of its parameter, directly influences exploitation and the application of MSP430.
Summary of the invention
Purpose of design: avoid the weak point in the background technology, design a kind of parameter correcting method and parameter calibration system that is used for the MSP430 parametric calibration.
Design:, be mainly reflected in the following aspects because the use of the 12bit A/D internal reference voltage of MSP430 (being called for short Vref), DCO and outside OSC all deviation can occur to a great extent:
Internal reference voltage (being called for short Vref): with MSP430F449 is example; Inner Vref should be 2.5V or 1.5V in theory; But being actually every inside all there are differences; Its scope is 2.4V-2.6V or 1.44V-1.56V, in order to reduce the error in the use, so will calibrate inner Vref.
Internal DC O (being called for short DCO): the frequency of MSP430 internal DC O can be unsteady to some extent with the variation of ambient temperature and voltage, in order to make inner DCO frequency more accurate, so also will calibrate inner DCO.
External crystal (being called for short OSC): to the external crystal of present use; Although nominal is 5PPM, 10PPM, in fact error own is just all bigger, adds the influence of external environment condition again; Especially in the clock source of using external crystal as perpetual calendar; That error is just quite big, in order to obtain accurate clock source, just requires the external OSC of portion to calibrate.
In order to realize above-mentioned purpose of design.The present invention downloads to Vref, DCO or OSC calibration procedure in the target MCU earlier before using target MCU as required; Carry out calibration procedure then; And will calibrate back actual Vref, DCO and OSC and write among the fixing Information A; Can be user-friendly to like this, improve measure error and improve clock accuracy.
Technical scheme 1: parameter correcting method
(1) MSP430 internal reference voltage calibration: at the normal voltage signal of the A0 of AD passage input 1.25V; The 1.25V input voltage that utilizes inner 1.5V or 2.5V reference voltage to remove standard for manual sampling then; Then through AD sampled value 1.5_Value, 2.5_Value; Calculate the reference voltage actual value of the inner ADC12 of current MSP430, and be saved among the inner FLASH of MSP430.This numerical value programs is called, and has solved internal reference voltage and has proofreaied and correct problem.Concrete computing formula is following:
Vref _ 1.5 = 4095 * Vref 1.5 V _ Value With Vref _ 2.5 = 4095 * Vref 2.5 V _ Value
The formula explanation:
Vref is the stable 1.25V of outside input;
Vref_1.5 is the later internal reference voltage of calibration;
Vref_2.5 is the later internal reference voltage of calibration;
1.5V_Value be that the pattern input voltage is 1.25V, the sampled value when internal reference is 1.5V;
2.5V_Value be that the pattern input voltage is 1.25V, the sampled value when internal reference is 2.5V.
(2) MSP430 internal DC O calibration: the inner DCO of MSP430 is a digital oscillator, and TA is one 16 an inner bit timing device of MSP430.The DCO clock is as the timer counting clock of TA; A clock Frg (unit is Hz) who catches passage input standard with TA; TA is operated in acquisition mode, and acquisition mode selects rising edge to catch, when timer TA detects first rising edge of Frg signal; The count value of record timer this moment is TAR1; And then when timer TA detected N rising edge of Frg, the count value of record timer this moment was TAR2 again, and Ta_Counter=TAR2-TAR1 is the number of catching the needed DCOCLOCK of N cycle of Frg like this.Calculate actual DCOCLOCK value then, and write among the InformationA, programs is called, and has solved DCO and has proofreaied and correct problem.
Computing formula is following:
DCOCLOCK = Frg * Ta _ Counter N
The formula explanation:
DCOCLOCK is the measured value of DCOCLOCK
N is the number of catching the Frg cycle with TA
Frg is that the signal of catching of outside input is that frequency is 1K
Ta_Couter is the tale number that TA catches N Frg cycle;
(3) the outside OSC of MSP430 (32.768KHz) calibration: with the clock source of external clock Fin (generally getting 10M high accuracy standard time clock) as TA; Catch the REAL_ACLK signal with TA then; Acquisition mode selects rising edge to catch; When timer TA detected first rising edge of REAL_ACLK signal, the count value of record timer this moment was TAR1, when timer TA detects N rising edge of ACLK; The count value of record timer this moment is TAR2 again, Ta_Counter=TAR2-TAR1.Computing formula is following:
REAL _ ACLK = N * Fin Ta _ Counter
The formula explanation:
REAL_ACLK is the measured value of ACLK,
N is the number of cycles of catching ACLK with TA, and Fin is the clock source 10M of TA,
Ta_Couter is that TA catches N total counting number of ACLK cycle.
Technical scheme 2: parameter calibration system, it comprises the MSP430 chip, it is characterized in that constituting by MSP430-voltage parameter calibration control board, MSP430-DCO parametric calibration control board, MSP430-OSC parametric calibration control board,
(1) the MSP430F2121 voltage calibration master controller in the MSP430-voltage parameter calibration control board is connected with the signal end of REF3212 standard capacitance box;
(2) signal end of the standard frequency generator in the MSP430-DCO parametric calibration control board is connected with the signal end of DCO calibration master controller;
(3) signal end of the standard frequency generator in the MSP430-OSC parametric calibration control board is connected with the signal end of MSP430.
The present invention compares with background technology, and not only inner Vref calibration is accurate, and internal DC O calibration accurately, and simultaneously outside OSC calibration is accurate.
Description of drawings
Fig. 1 is the structural representation of parameter calibration system.
Fig. 2 is the structural representation of interface circuit.
Fig. 3 is the structural representation of MSP430 internal reference voltage calibration.
Fig. 4 is the structural representation of MSP430 internal DC O calibration.
Fig. 5 is the structural representation of the outside OSC calibration of MSP430.
Fig. 6 is the circuit theory sketch map of parameter calibration system.
Fig. 7 is the Frg signal schematic representation.
Embodiment
Embodiment 1: with reference to accompanying drawing 1~7.
MSP430 internal reference voltage calibration (is example with the inner ADC12 of F449).
The reference electrode of the ADC12 that MSP430 is inner is pressed with 1.5V and 2.5V, but because of the reason of inner deviation, the scope of the reference voltage of 1.5V is at 1.4V-1.6V; And the scope of the reference voltage of 2.5V is at 2.44V-2.56V; Like this, before doing the AD sampling, should calibrate internal reference voltage earlier, our method of employing is here: at the normal voltage signal of the A0 of AD passage input 1.25V; The 1.25V input voltage that utilizes inner 1.5V or 2.5V reference voltage to remove standard for manual sampling then; Through AD sampled value 1.5_Value, 2.5_Value, calculate the reference voltage actual value of the inner ADC12 of current MSP430 then, concrete computing formula is following:
Vref _ 1.5 = 4095 * Vref 1.5 V _ Value With Vref _ 2.5 = 4095 * Vref 2.5 V _ Value Formula 1
Formula explanation: Vref is the stable 1.5V of external schema input; Vref_1.5 is the later internal reference voltage of calibration; Vref-2.5 is the later internal reference voltage of calibration; 1.5V_Value be that the pattern input voltage is 1.5V, the sampled value when internal reference is 1.5V; 2.5V_Value be that the pattern input voltage is 1.5V, the sampled value when internal reference is 2.5V; Calculate actual internal reference through top formula; Vref_1.5 and Vref_2.5, and the result write the 1000H of inner Information A.So that improve conversion accuracy when the client uses.
MSP430 internal DC O calibrates (is example with MSP430F2013)
The inner DCO of MSP430 is a digital oscillator, and the frequency of its DCO can change with the fluctuation of temperature and voltage, so require time precision than higher occasion in some communication or timing, calibration DCO is necessary fully.
Be example with the MSP430F2013 single-chip microcomputer below; The calibration steps of DCO is discussed, can be found out that through figure below the calibrating principle of DCO is, standard 10MHz crystal is exported the clock signal of Frg=1KHz later on through master controller MSP430F2121 frequency division; Then the clock signal of 1KHz is input to MSP430F2013 single-chip microcomputer timer TA and catches the external signal input; Through the external signal that software selects Frg=1KHz to catch for timer TA, selecting DCO to be calibrated is the clock source of basic timer, can catch the Frg signal through TA like this; Calculate the actual value of DCO then through formula, accompanying drawing 7 is seen in concrete analysis.
At first be basic principle of measurement: catch the Frg signal with inner DCO clock DCOCLOCK now; Acquisition mode selects rising edge to catch; When timer TA detected first rising edge of Frg signal, the count value of record timer this moment was TAR1, and then when timer TA detects second rising edge of Frg; The count value of record timer this moment is TAR2 again; Time difference between two rising edges of Frg signal is the one-period 1/Frg=1ms of Frg, thus TAc=TAR2-TRA1 just TA just catch the number of the needed DCOCLOCK of one-period of Frg in the number of 1ms inside counting; Be DCOCLOCK/Frg=TAc, the frequency DCOCLOCK=TAc*Frg of the clock source DCO of TA like this.
Based on above basic principle, if adopt the clock source of DCOCLOCK=1MHz as TA, the signal of catching still is Frg=1KHz;, TA catches 1000 cycles of Frg signal, and the number of TA counting should be 1000000 like this; DCOCLOCK just, and the like, as long as the signal that we catch is Frg; In order to improve the precision of measurement, catch N the cycle (N is the bigger the better in theory) of Frg signal, obtain the count value Ta_Couter of counter at last; Calculate actual DCOCLOCK value then, and write among the Information A.
Computing formula is following:
DCOCLOCK = Frg * Ta _ Counter N Formula 2
The formula explanation: DCOCLOCK is the measured value of DCOCLOCK
N is the number of catching the Frg cycle with TA
Erg is that the signal of catching of outside input is that frequency is 1K
Ta_Couter is the tale number that TA catches N Frg cycle;
The outside OSC of MSP430 (32.768KHz) calibration (F449 is an example)
The external crystal of MSP430F449MCU has XT1 and two kinds of interfaces of XT2; Generally, the 32.768KHz crystal is connected on the XT1 as the low-frequency clock source, and precision is generally divided 5PPM, 10PPM and 20PPM etc.; Can select the crystal of 1PPM in the higher occasion of precision prescribed; But in fact the frequency difference of external crystal is very big, and this just requires us to try every possible means to measure the actual frequency of crystal, to reach the purpose of calibration.
The principle of calibrating outside DCO (32.768K) is, and the standard time clock of 10MHz connects through the TACLK pin, and is set to the clock source of TA, and 32.768K is connected to MSP430F449 as LFXT1 and ACLK through XIN on user's plate; Catch ACLK through TACCR2 then, utilize formula to calculate the actual value of ACLK, detailed process is following:
When timer TA detects first rising edge of REAL_ACLK signal; The count value of record timer this moment is TAR1; When timer TA detects second rising edge of ACLK; The count value of record timer this moment is TAR2 again, and Ta_Counter=TAR2-TRA1 representes the number of TA at a REAL_ACLK cycle inside counting 10Mhz, thereby draws REAL_ACLK=10M/Ta_Counter.
Its error amount (REAL_ACLK-32.768KHz)/32.768KHZ=1/1000000; Go out the 32.768K crystal of 1PPM by this formula to calculating, its value is 32768.032768, that is to say 1PPM=0.032768; In order to reduce error; Improve precision, we catch the cycle (N is the bigger the better in theory) of N REAL_ACKL, calculate actual REAL_ACLK value then.
Computing formula is following:
REAL _ ACLK = N * Fin Ta _ Counter Formula 3
The formula explanation: REAL_ACLK is the measured value of ACLK,
N is the number of cycles of catching ACLK with TA, and Fin is the clock source 10M of TA,
Ta_Couter is that TA catches N total counting number of ACLK cycle.
The term explanation
2.5V_VAULE: the sampled value that inner 2.5V reference voltage removes the 1.25V input voltage of standard for manual sampling.
1.5V_VAULE: the sampled value that inner 1.5V reference voltage removes the 1.25V input voltage of standard for manual sampling.
Vref_2.5V: be the reference voltage level of the pairing reality of 2.5V.
Vref_1.5V: be the reference voltage level of the pairing reality of 1.5V.
Vref: the 1.25V input voltage of standard.
DCO:MSP430 internal digital oscillator.
The OSC:MSP430 external crystal oscillator.
What need understand is: though the foregoing description is to the present invention's detailed explanation of contrasting; But these explanations, just to simple declaration of the present invention, rather than limitation of the present invention; Any innovation and creation that do not exceed in the connotation of the present invention all fall in protection scope of the present invention.

Claims (1)

1. parameter correcting method is characterized in that: the calibration of (1) MSP430 internal reference voltage:
Normal voltage signal at the A0 of AD passage input 1.25V; The 1.25V input voltage that utilizes inner 1.5V or 2.5V reference voltage to remove standard for manual sampling then; Then through AD sampled value 1.5_Value, 2.5_Value; Calculate the reference voltage actual value of the inner ADC12 of current MSP430, and be saved among the inner FLASH of MSP430, this numerical value programs is called; Solved internal reference voltage and proofreaied and correct problem, the concrete computing formula of reference voltage actual value of the inner ADC12 of its MSP430 is seen formula 1:
Figure FSB00000712126100011
and Formula 1
The formula explanation:
Vref is the stable 1.25V of external schema input,
Vref_1.5 is the later internal reference voltage of calibration,
Vref_2.5 is the later internal reference voltage of calibration,
1.5V_Value be that the pattern input voltage is 1.25V, the sampled value when internal reference is 1.5V,
2.5V_Value be that the pattern input voltage is 1.25V, the sampled value when internal reference is 2.5V;
(2) MSP430 internal DC O calibration:
The inner DCO of MSP430 is a digital oscillator, and TA is one 16 an inner bit timing device of MSP430, and the DCO clock is as the timer counting clock of TA; With the clock Frg who catches passage input standard of TA, TA is operated in the rising edge acquisition mode, when timer TA detects first rising edge of Frg signal; The count value of record timer this moment is TAR1, and and then when timer TA detected N1 rising edge of Frg, the count value of record timer this moment was TAR2 again; Ta_Counter1=TAR2-TAR1 is the number of catching the needed DCO clock of N1 cycle of Frg like this; Calculate actual DCOCLOCK value then, and write among the Information A, programs is called; Solved DCO and proofreaied and correct problem, its DCOCLOCK value computing formula is seen formula 2:
Figure FSB00000712126100013
formula 2
The formula explanation:
DCOCLOCK is the DCO clock frequency value of measuring,
N1 is the number of catching the Frg cycle with TA,
1K is the lock-on signal frequency values of the outside input of Frg,
Ta_Couter1 is the tale number that TA catches N1 Frg cycle;
(3) the outside OSC calibration of MSP430:
With the clock source of external clock Fin as TA; Catch the ACLK signal with TA then, acquisition mode selects rising edge to catch, when timer TA detects first rising edge of ACLK signal; The count value of record timer this moment is TAR3; When timer TA detected N2 rising edge of ACLK, the count value of record timer this moment was TAR4 again
Ta_Counter2=TAR4-TAR3, its REAL_ACLK calculated signals formula is seen formula 3:
Figure FSB00000712126100021
formula 3
The formula explanation:
REAL_ACLK is the measured value of ACLK,
N2 is the number that TA catches the ACLK cycle, and Fin is the clock source of TA,
Ta_Couter2 is the tale number that TA catches N2 ACLK cycle.
CN2007100690844A 2007-06-15 2007-06-15 Method for correcting parameter Active CN101252357B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007100690844A CN101252357B (en) 2007-06-15 2007-06-15 Method for correcting parameter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007100690844A CN101252357B (en) 2007-06-15 2007-06-15 Method for correcting parameter

Publications (2)

Publication Number Publication Date
CN101252357A CN101252357A (en) 2008-08-27
CN101252357B true CN101252357B (en) 2012-07-18

Family

ID=39955559

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007100690844A Active CN101252357B (en) 2007-06-15 2007-06-15 Method for correcting parameter

Country Status (1)

Country Link
CN (1) CN101252357B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101936751B (en) * 2010-07-20 2012-07-04 兰州大学 Method and circuit thereof for improving resolution of encoder by adopting secondary subdivision
CN102096383A (en) * 2010-12-28 2011-06-15 重庆长安汽车股份有限公司 High-precision signal sampling circuit
CN102866899B (en) * 2012-07-24 2015-10-21 深圳芯邦科技股份有限公司 A kind of method and apparatus of calibration parameter
CN103677078B (en) * 2012-09-04 2017-11-21 国民技术股份有限公司 A kind of calibration method of clock frequency, system and chip
CN102882672A (en) * 2012-09-18 2013-01-16 深圳市文鼎创数据科技有限公司 Method and device for calibrating dynamic token clock
CN103852620A (en) * 2012-12-06 2014-06-11 苏州工业园区新宏博通讯科技有限公司 Self-adaptation test method of automatic reclosing lock

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1570653A (en) * 2004-05-14 2005-01-26 杭州利尔达单片机技术有限公司 MSP430FE42x single phase multifunctional electric energy meter and metering method
CN1763686A (en) * 2004-10-01 2006-04-26 富晶半导体股份有限公司 Monitoring clock correction method and apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1570653A (en) * 2004-05-14 2005-01-26 杭州利尔达单片机技术有限公司 MSP430FE42x single phase multifunctional electric energy meter and metering method
CN1763686A (en) * 2004-10-01 2006-04-26 富晶半导体股份有限公司 Monitoring clock correction method and apparatus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
周征,李贵山.A/D转换器参考电压的软件校正.电子元件与材料23 2.2004,23(2),46-48.
周征,李贵山.A/D转换器参考电压的软件校正.电子元件与材料23 2.2004,23(2),46-48. *

Also Published As

Publication number Publication date
CN101252357A (en) 2008-08-27

Similar Documents

Publication Publication Date Title
CN101252357B (en) Method for correcting parameter
CN102032974B (en) Temperature compensation method for pressure sensor
CN105388445B (en) A kind of auto-adjustment method of single-phase electric energy meter
CN101303401A (en) RTC regulating apparatus of electrical energy meter and RTC automatic compensation correcting method
CN101930211B (en) Clock source device based on GPS second pulse and control method thereof
CN101634595B (en) High-precision platinum resistor temperature measuring system and temperature measuring method based on same
CN110401499A (en) For Fast Frequency Offset calibration method, device, equipment and the medium of radio-frequency module
CN104297716B (en) Intelligent electric meter RTC calibrating method
CN104849523A (en) Single-phase watt-hour meter temperature compensation method
CN102597707A (en) Angle detector with combined self calibration function
CN102830748A (en) Method and system for calibrating clock skew inside chip
CN203299557U (en) Real-time clock compensation device
CN103063321B (en) Platinum resistance temperature measuring equipment and temperature measuring method thereof
CN103424731A (en) Electric energy meter real-time clock correction device and correction method
CN105978555A (en) Real-time clock timing precision correction circuit and method with temperature compensation function
CN102163040B (en) Built-in hardware clock module with temperature compensation function
KR20200095069A (en) Portable error corection apparatuse for Internet of Things meter
CN102879061A (en) Water gauge error correction method based on fitted equation
CN106501605A (en) One kind is than phase device
CN201540331U (en) Multi-passage high-precision synchronous frequency-measuring device
CN201091067Y (en) Parameter correcting system
CN112444671A (en) Electric energy metering method and device of electric energy meter based on instantaneous power and storage medium
CN109620200A (en) A kind of device and method of intracranial pressure, encephalic temperature testing calibration
CN115981416A (en) Crystal oscillator supporting Beidou clock synchronization and self-timekeeping
CN115616541A (en) Calibration method for reference clock of sonobuoy

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: LI ERDA SCIENCE + TECHNOLOGY CO., LTD.

Effective date: 20120817

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20120817

Address after: Hangzhou City, Zhejiang province 310011 Gongshu District Dengyun Road No. 425

Patentee after: Lierda Science and Technology Co., Ltd.

Address before: Hangzhou City, Zhejiang province 310011 Dengyun Road No. 639 electronic market C area 4 Building Technology Department

Patentee before: Chen Xianxing

C56 Change in the name or address of the patentee

Owner name: LIERDA TECHNOLOGY GROUP CO., LTD.

Free format text: FORMER NAME: LIERDA SCIENCE AND TECHNOLOGY CO., LTD.

CP03 Change of name, title or address

Address after: 310011 Gongshu District, Hangzhou Province, the United States and the United States hospital A District, building 1201, room 18, room

Patentee after: Lierda Science & Technology Group Co., Ltd.

Address before: Hangzhou City, Zhejiang province 310011 Gongshu District Dengyun Road No. 425

Patentee before: Lierda Science and Technology Co., Ltd.