Accuracy adjustment for time-of-day clock using a microcontroller
AssigneeFord Motor Company
InventorMax C. Chapman
Life of this patent
Estimating the term…
Abstract
A microcontroller, software-based time-of-day clock compensates for inaccurate oscillator frequency by periodically correcting the time-of-day value using a calibration offset measured by manufacturing test equipment and permanently stored in nonvolatile memory. A high degree of time keeping accuracy is achieved without the use of trimming capacitors or presorted piezoelectric crystals in the oscillator. Furthermore, frequency error compensation is incorporated into the microcontroller system without requiring a significant amount of processing time overhead.
Claims11
Apparatus comprising:
- idle timer means for generating interrupts separated by a fixed time period which differs from an ideal time period by an error;
- first counting means having a first register and coupled to said idle timer means for counting said interrupts and for generating an increment signal when a number of interrupts have occurred equal to a load value loaded into said first register;
- reload means for storing a reload value and for (1) transferring said reload value to said first register as said load value upon the occurrence of said increment signal and 2) then resetting said reload value to a predetermined value;
- second counting means coupled to said idle timer means and to said reload means for counting said interrupts and for transferring an accumulated error value to said reload means as said reload value when a number of interrupts have occurred equal to a large count number relatively greater than said predetermined value;
- and
- time means coupled to said first counting means and receiving said increment signal for keeping track of time-of-day.
A method for maintaining accurate time keeping with an interrupt-driven clock, said interrupts being separated by a fixed time period, said method comprising the steps of:
- maintaining a first count of interrupts corresponding to a first time interval being measured and displayed by said clock;
- maintaining time values for display by said clock;
- maintaining a second count of interrupts corresponding to a second time interval equalling a large number of interrupts and containing many of said first time intervals;
- in response to said first count being equal to a predetermined number, performing the steps of (A) restarting said first count to count to said predetermined number;(B) updating said time values;
- and (C) setting said predetermined number to a first constant equalling the number of interrupts that would occur during said first time interval if the time between interrupts equalled an ideal time period;
- and
- in response to said second count being equal to said large number, performing the steps of (A) restarting said second count;
- and (B) setting said predetermined number to a second constant related to the difference between said fixed time period and said ideal time period multiplied by said large number and divided by said ideal time period.
Dependencies are inferred from the claim text.