Patent ID: 9304498
Filing Date: 2016-04-05
CPC Classification: G04G

Claim Text:
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 register 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 a Hz 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, 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, executing otherwise, executing and 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.