A microcontroller having a dual mode relax oscillator that is trimmable. In one
embodiment, the present invention provides a relaxation oscillator circuit comprising
two current sources for establishing a reference voltage for use in causing the
relaxation oscillator circuit to operate in two power modes, and a control coupled
to both current sources for switching between power modes. In one embodiment, one
power mode is a low power mode for standard operation of the microcontroller and
one power mode is a very low power mode for use in a sleep mode. In one embodiment,
the relaxation oscillator circuit further comprises digitally trimmable components
operable to control a current charging a capacitor of the relaxation oscillator
circuit to account for process variation in the capacitor, wherein the current
is for controlling a frequency of the microcontroller.