An integrated circuit comprises an oscillator that generates an oscillator
signal. A first counter generates a first count based on transitions of
the oscillator signal. A first circuit generates a match signal based on
the first count and a reference count. A second counter generates a
second count that is initialized at a starting count and adjusts the
second count based on transitions of a reference clock signal. An output
circuit outputs an oscillator speed based on the second count and the
match signal. The oscillator speed is defined by a range that is
independent of a frequency of the reference clock signal.