# Patent

## Title
Voltage-and temperature-compensated RC oscillator circuit

## Abstract

An integrated temperature-compensated RC oscillator circuit includes an inverter having an input and an output. An RC network is coupled between the inverter and a pair of comparators. A first comparator has an inverting input coupled to a first reference voltage, a non-inverting input coupled to the RC network, and an output. A second comparator has an inverting input coupled to the RC network, a non-inverting input coupled to a second reference voltage, and an output. A set-reset flip-flop has a set input coupled to the output of the first comparator, a reset input coupled to the output of the second comparator, and an output coupled to the input of the inverter. Differential amplifiers in the comparators each have a diode-connected p-channel MOS transistor controlling a mirrored p-channel MOS transistor whose channel width is less than that of the diode-connected p-channel current mirror transistor.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
This application is a continuation of co-pending U.S. patent application Ser. No. 11/022,331, filed Dec. 21, 2004.


BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates to integrated circuits. More particularly, the present invention relates to a voltage-compensated and temperature-compensated RC oscillator circuit for an integrated circuit.
2. Background
Integrated circuits have previously been provided with on-board oscillator circuits, including both RC oscillator circuits and crystal oscillator circuits. RC oscillator circuits are not known for frequency stability and are susceptible to both voltage-supply instability and temperature instability.
SUMMARY OF THE INVENTION
An integrated voltage-compensated and temperature-compensated RC oscillator is disclosed.
A better understanding of the features and advantages of the present invention will be obtained by reference to the following detailed description of the invention and accompanying drawings, which set forth an illustrative embodiment in which the principles of the invention are utilized.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a schematic diagram of an illustrative integrated-circuit voltage-compensated and temperature-compensated RC oscillator circuit of the present invention.
FIG. 2 is a schematic diagram of an illustrative voltage-compensation circuit that may be employed in the integrated-circuit voltage-compensated and temperature-compensated RC oscillator circuit of FIG. 1.
FIGS. 3A and 3B are schematic diagrams of illustrative temperature-compensation circuits that may be employed in the integrated-circuit voltage-compensated and temperature-compensated RC oscillator circuit of FIG. 1.



DETAILED DESCRIPTION
Those of ordinary skill in the art will realize that the following description of the present invention is illustrative only and not in any way limiting. Other embodiments of the invention will readily suggest themselves to such skilled persons.
Referring first to FIG. 1, a schematic diagram shows an illustrative integrated-circuit voltage-compensated and temperature-compensated RC oscillator circuit 10 according to the present invention. The output of inverter 12 drives an RC network including resistor 14 coupled between the output of inverter 12 and one plate of capacitor 16. The second plate of capacitor 16 is coupled to ground.
The node common to resistor 14 and capacitor 16 is coupled to the non-inverting input of a first analog comparator 18 and the non-inverting input of a second analog comparator 20. Both analog comparators 18 and 20 are temperature compensated according to the present invention as will be further disclosed herein.
The inverting input of the first analog comparator 18 and the inverting input of the second analog comparator 20 are coupled to a voltage divider network including resistors 22, 24, and 26 coupled in series between VCC and ground. Resistors 22, 24, and 26 are equal in value such that the trip point of first analog comparator 18 is always 2⁄3 VCC and the trip point of the second comparator 20 is always 1⁄3 VCC. As will be appreciated by persons of ordinary skill in the art, these comparator trip points are independent of variations in VCC because the voltage division is fixed as a function of the fixed-value resistors 22, 24, and 26.
The output of first analog comparator 18 is coupled to the set input S of set-reset flip-flop 28. The output of second analog comparator 20 is coupled to the reset input R! of set-reset flip-flop 28. The Q output of set-reset flip-flop 28 is coupled to the input of inverter 12.
Referring now to FIG. 2, a schematic diagram shows an illustrative voltage-compensation circuit 30 that may be employed in the integrated-circuit voltage-compensated and temperature-compensated RC oscillator circuit of FIG. 1 in accordance with the present invention. Band-gap reference circuit 32 drives the inverting input of operational amplifier 34. The output of operational amplifier 34 drives the gate of n-channel MOS transistor 36. The source of n-channel MOS transistor 36 is grounded. Three resistors 38, 40 and 42 are connected as a series voltage divider between VCC and ground. Resistor 32 has a value that is much smaller than the values of resistors 40 and 42, whose values are equal. The drain of n-channel MOS transistor 36 is coupled to the common connection of resistors 38 and 40 and the non-inverting input of operational amplifier 34 is coupled to the common connection of resistors 40 and 42. This circuit provides a very stable voltage at the gate of n-channel MOS transistor 36.
Diode-connected p-channel MOS transistor 44 is coupled in series with n-channel MOS transistor 46 between VCC and ground. N-channel MOS transistor 46 has its gate coupled to the gate of n-channel MOS transistor 36. P-channel MOS transistor 48 is connected to p-channel MOS transistor 44 as a current mirror. P-channel MOS transistor 50 is turned on because its gate is coupled to ground and it generates the current IREF1 at its source. P-channel MOS transistor 52 is also connected to p-channel MOS transistor 44 as a current mirror. If p-channel MOS transistor 54 is turned on using trim-bit switch line 56, it will contribute to the current IREF at its source, which is connected in common with the source of p-channel MOS transistor 50. P-channel MOS transistor 58 is also connected to p-channel MOS transistor 44 as a current mirror. If p-channel MOS transistor 60 is turned on using trim-bit switch line 62, it will contribute to the current IREF1 at its source, which is connected in common with the source of p-channel MOS transistor 50. In the illustrative circuit of FIG. 2, the value of IREF1 can be set to one of three values. Persons of ordinary skill in the art will appreciate that, if additional switched or unswitched p-channel and n-channel transistor pairs are provided, additional levels of IREF1 current can be selectively generated to trim the value of IREF1 at wafer sort.
P-channel MOS transistor 64 is connected to p-channel MOS transistor 44 as a current mirror. P-channel MOS transistor 66 is turned on because its gate is coupled to ground and it generates the current IREF2 at its source. P-channel MOS transistor 68 is also connected to p-channel MOS transistor 44 as a current mirror. If p-channel MOS transistor 70 is turned on using trim-bit switch line 72, it will contribute to the current IREF2 at its source, which is connected in common with the source of p-channel MOS transistor 66. N-channel MOS transistor 74 is also connected to p-channel MOS transistor 44 as a current mirror. If p-channel MOS transistor 76 is turned on using trim-bit switch line 78, it will contribute to the current IREF2 at its source, which is connected in common with the source of p-channel MOS transistor 66. The sources of p-channel MOS transistors 66, 70, and 76 are coupled to the gate and drain of n-channel MOS transistor 80. N-channel MOS transistor 82 is coupled to n-channel MOS transistor 80 as a current mirror. As can be seen by persons of ordinary skill in the art, the current −IREF2 is at the drain of n-channel MOS transistor 82. The current −IREF2 is opposite in sign to the current IREF1.
In the illustrative circuit of FIG. 2, the value of −IREF2 can also be set to one of three values. Persons of ordinary skill in the art will appreciate that, if additional switched or unswitched p-channel and n-channel transistor pairs are provided, additional levels of −IREF2 current can be selectively generated to trim the value of −IREF2 at wafer sort.
FIG. 3A is a schematic diagram of an illustrative temperature-compensated analog comparator circuit 90 that may be employed as analog comparator 20 in the integrated-circuit voltage-compensated and temperature-compensated RC oscillator circuit of FIG. 1. P-channel MOS transistors 92 and 94 and n-channel MOS transistors 96 and 98 are configured as a differential amplifier with bias transistor 100 coupled between the sources of n-channel MOS transistors 96 and 98 and ground. The gate of n-channel MOS transistor 96 serves as the non-inverting input 102 of the comparator and the gate of n-channel MOS transistor 98 serves as the inverting input 104 of the comparator. The output of the comparator is the common connection of the drains of p-channel MOS transistor 94 and n-channel MOS transistor 98. The gate of n-channel MOS bias transistor 100 is driven from diode-connected n-channel MOS transistor 106 and thus mirrors IREF1. Diode-connected p-channel MOS transistor 108 may be optionally coupled between the sources of p-channel MOS transistors 92 and 94 and VCC in order to bias the sources of p-channel MOS transistors 92 and 94 at a VT below VCC as is known in the art.
As may be seen from an examination of FIG. 3A, the widths of n-channel MOS transistors 96 and 98 are the same and are equal to A. The width of p-channel MOS transistor 92 is equal to B and the width of p-channel MOS transistor 94 is equal to B/2. In an illustrative non-limiting embodiment of the invention A may be equal to 20 microns and B may be equal to 10 microns.
The analog comparator 90 of FIG. 3A is temperature compensated. As the temperature increases, the tendency of a differential amplifier circuit is to switch at a later point in time given the same voltage input conditions. By differently sizing the p-channel MOS transistors 92 and 94 such that p-channel MOS transistor 94 is smaller than p-channel MOS transistor 92 as shown in FIG. 3A, the trip point of the circuit tends to occur earlier in time than if both p-channel transistors had been sized the same, thus compensating for the temperature shift. As the ratio between the sizes of p-channel MOS transistors 92 and 94 increases, the amount of temperature compensation increases.
FIG. 3B is a schematic diagram of an illustrative temperature-compensated analog comparator circuit 110 that may be employed as analog comparator 18 in the integrated-circuit voltage-compensated and temperature-compensated RC oscillator circuit of FIG. 1. N-channel MOS transistors 112 and 114 and p-channel MOS transistors 116 and 118 are configured as a differential amplifier with bias transistor 120 coupled between the sources of p-channel MOS transistors 116 and 118 and VCC. The gate of p-channel MOS transistor 116 serves as the inverting input 122 of the comparator and the gate of p-channel MOS transistor 118 serves as the non-inverting input 124 of the comparator. The output of the comparator is the common connection of the drains of n-channel MOS transistor 114 and p-channel MOS transistor 118. The gate of p-channel MOS bias transistor 120 is driven from diode-connected n-channel MOS transistor 126 and thus mirrors IREF2. Diode-connected n-channel MOS transistor 128 may be optionally coupled between the sources of p-channel MOS transistors 112 and 114 and ground in order to bias the sources of n-channel MOS transistors 112 and 114 at a VT above ground as is known in the art.
As may be seen from an examination of FIG. 3B, the widths of p-channel MOS transistors 116 and 118 are the same and are equal to C. The width of n-channel MOS transistor 112 is equal to D and the width of n-channel MOS transistor 114 is equal to D/2. In an illustrative non-limiting embodiment of the invention C may be equal to 40 microns and D may be equal to 5 microns.
The analog comparator 90 of FIG. 3B is temperature compensated. As the temperature increases, the tendency of a differential amplifier circuit is to switch at a later point in time given the same voltage input conditions. By differently sizing the n-channel MOS transistors 112 and 114 such that n-channel MOS transistor 114 is smaller than n-channel MOS transistor 112 as shown in FIG. 3B, the trip point of the circuit tends to occur earlier in time than if both n-channel transistors had been sized the same, thus compensating for the temperature shift. As the ratio between the sizes of n-channel MOS transistors 112 and 114 increases, the amount of temperature compensation increases.
While embodiments and applications of this invention have been shown and described, it would be apparent to those skilled in the art that many more modifications than mentioned above are possible without departing from the inventive concepts herein. The invention, therefore, is not to be restricted except in the spirit of the appended claims.

## Claims

1. An integrated temperature-compensated RC oscillator circuit including:
an inverter having an input and an output;
a resistor having a first terminal and a second terminal, the first terminal coupled to the output of the inverter;
a capacitor coupled between the second terminal of the resistor and a fixed potential;
a voltage divider network having a first node and a second node connected between a power-supply potential and ground;
a first analog comparator having an inverting input coupled to the first node, a non-inverting input coupled to the second terminal of the resistor, and an output;
a second analog comparator having a non-inverting input coupled to the second terminal of the resistor, an inverting input coupled to the second node, and an output;
a set-reset flip-flop having a set input coupled to the output of the first analog comparator, a reset input coupled to the output of the second analog comparator, and an output coupled to the input of the inverter;
the first and second analog comparators each comprising a differential amplifier each having a diode-connected current mirror MOS transistor in series with a non-inverting-input MOS transistor and a mirrored MOS transistor in series with an inverting-input transistor, the diode-connected current mirror MOS transistor having a width larger than the width of the mirrored MOS transistor, the differential amplifier further having a MOS bias transistor having a drain coupled to the sources of the inverting-input and non-inverting-input input transistors, a source coupled to ground, and a gate coupled to a bias-voltage supply.

2. The integrated temperature-compensated RC oscillator circuit of claim 1, wherein the voltage divider network further comprises a first resistor, a second resistor and a third resistor coupled in series between the power-supply potential and ground.

3. The integrated temperature-compensated RC oscillator circuit of claim 2, wherein:
the first resistor is connected between the power-supply potential and the first node;
the second resistor is connected between the first node and the second node; and
the third resistor is connected between the second node and ground.

4. The integrated temperature-compensated RC oscillator circuit of claim 1, wherein the inverting-input and non-inverting-input input transistors of the first and second analog comparators have equal channel widths.

5. The integrated temperature-compensated RC oscillator circuit of claim 1, wherein the bias-voltage supply is derived from a band-gap reference-voltage circuit.

6. The integrated temperature-compensated RC oscillator circuit of claim 1, wherein the width of the diode-connected transistor in the first and second analog comparators is about twice the width of the mirrored MOS transistor.

7. The integrated temperature-compensated RC oscillator circuit of claim 1, wherein the sources of the diode-connected current minor MOS transistor and the mirrored MOS transistor have a source bias of VT.

8. The integrated temperature-compensated RC oscillator circuit of claim 1, wherein the sources of the current mirror MOS transistor and the mirrored MOS transistor are coupled to source potential through a diode-connected MOS transistor.

9. The integrated temperature-compensated RC oscillator circuit of claim 1, wherein:
the current mirror MOS transistor and the mirrored MOS transistor in the first comparator and the inverting-input MOS transistor, the non-inverting-input transistor, and the bias transistor in the second comparator are of a first conductivity type; and
the current mirror MOS transistor and the mirrored MOS transistor in the second comparator and the inverting-input MOS transistor, the non-inverting-input transistor and the bias transistor in the first comparator are of a second conductivity type opposite the first conductivity type.