发明名称 Method for compensating timing errors of real-time clocks
摘要 The present invention relates to a method for compensating timing errors of real-time clocks, which comprises a compensating step, wherein in step 1, assign CNT to be 0 and execute step two; in step 2, assign FLAG to be 1 when a rising edge of 1 Hz clock is arrived and execute step 3; in step 3, judge FLAG and M3, if FLAG=1 and M3<0, execute step 4 while waiting until CNT=S4; if FLAG=1, CNT=0 and M3>0, execute step 5; otherwise execute step 2; in step 4, execute an assignment operation, CNT=0, M3=M3+S4, FLAG=0 and restart step 2; in step 5, execute an assignment operation, CNT=S4, M3=M3−S4, FLAG=0, and restart step 2. A sampling frequency of relative errors ERR of the present invention is adjustable, and a compensatory accuracy is much higher.
申请公布号 US9304498(B2) 申请公布日期 2016.04.05
申请号 US201414291123 申请日期 2014.05.30
申请人 SI-EN TECHNOLOGY LIMITED 发明人 Zhou Dongshi
分类号 G06F11/00;G06F1/00;G04G3/04 主分类号 G06F11/00
代理机构 代理人
主权项 1. A method for compensating timing errors of real-time clocks which is characterized in that said method comprising a calculating step and a compensating step: wherein said calculating step comprising: step 1, subjecting a cyclic subtraction register M2 to an assignment operation, a cyclic subtraction register M1=said cyclic subtraction registerM⁢⁢2=106*S⁢⁢1*S⁢⁢2S⁢⁢3;a periodic number of accumulative errors register M3 being assigned to be 0, wherein said S1 is used to adjust an ERR effective value, said S2 is used to adjust an operating frequency of compensatory circuits, and said S3 is used to adjust a calculation of times, then executing step 2; step 2, making a compensatory flag register COM assigned to be 0 when a rising edge of a32768S⁢⁢2Hz clock is arrived, said M2 being executed by a subtraction, M2=M1−|ERR*S1|, M1=M2, then executing step 3; step 3, judging said M2, if M2<0, an assignment to M2 being executed,M⁢⁢2=M⁢⁢1+106*S⁢⁢1*S⁢⁢2S⁢⁢3,M1=M2, and said compensatory flag register COM being assigned to be 1, then executing step 4; otherwise, executing said step 2; and step 4, judging ERR*S1, if ERR*S1>0, executingM⁢⁢3=M⁢⁢3+S⁢⁢2S⁢⁢3;otherwise, executingM⁢⁢3=M⁢⁢3-S⁢⁢2S⁢⁢3and executing said step 2; and wherein said compensating step comprising: step 1, making a frequency dividing counter CNT assigned to be 0, then executing step 2; step 2, making a compensatory flag register FLAG assigned to be 1 when a rising edge of a 1 Hz clock is arrived, then executing step 3; step 3, judging said FLAG and said M3, if FLAG=1 and M3<0, executing step 4 while waiting until CNT=S4; if FLAG=1, CNT=0, and M3>0, executing step 5; otherwise, executing said step 2; step 4, executing an assignment operation, CNT=0, M3=M3+S4, FLAG=0, and restarting said step 2, wherein said S4 is a maximum compensatory periodic number in 1 second; and step 5, executing an assignment operation, CNT=S4, M3=M3−S4, FLAG=0, and restarting said step two.
地址 Xiamen, Fujian CN