Patent ID: 8797083

Claim:
A method of operating a timer, comprising: generating a periodic timing signal having a first frequency that differs from a desired timer frequency by a first amount, by dividing a frequency of an input clock signal by N, where N is a positive integer greater than one; switching a frequency of the periodic timing signal from the first frequency to a second frequency that differs from the desired timer frequency by a second amount, by dividing the frequency of the input clock signal by M in response to counting a first number of cycles of the periodic timing signal having the first frequency, where M is a positive integer unequal to N and where M−N equals ±K, wherein K is a positive integer; and switching the frequency of the periodic timing signal from the second frequency to the first frequency in response to counting a second number of cycles of the periodic timing signal having the second frequency, where the second number is unequal to the first number; wherein a first error value equals an absolute value of a difference between an accumulated duration of the first number of cycles and a duration of a target cycle and a second error value equals an absolute value of a difference between an accumulated duration of the second number of cycles and the duration of the target cycle; wherein the first number and the second number are determined by the first error value and the second error value; wherein the first number is equivalent to a ratio of a least common multiple of the first error value and the second error value, to the first error value; and wherein the second number is equivalent to a ratio of the least common multiple of the first error value and the second error value to the second error value.