1.2 The Oscillator
- The loop gain is equal to unity in absolute magnitude, |βA| = 1
- The phase shift around the loop is zero or an integer multiple of 2π, i.e., ∠βA = 2πn for n ∈ 0, 1, 2, 3...
The first criterion will ensure a constant amplitude signal. A number less than 1 will attenuate the signal, and a number greater than 1 will amplify the signal to infinity. The second criterion will ensure a stable frequency. For other phase shift values, the sine wave output will be canceled due to the feedback loop.
The 32.768 kHz oscillator in Microchip AVR microcontrollers is shown in Figure 1-3 and consists of an inverting amplifier (internal) and a crystal (external). Capacitors (CL1 and CL2) represent internal parasitic capacitance. Some AVR devices also have selectable internal load capacitors, which may be used to reduce the need for external load capacitors, depending on the crystal used.
The inverting amplifier gives a π radian (180 degrees) phase shift. The remaining π radian phase shift is provided by the crystal and the capacitive load at 32.768 kHz, causing a total phase shift of 2π radian. During start-up, the amplifier output will increase until steady-state oscillation is established with a loop gain of 1, causing the Barkhausen criteria to be fulfilled. This is controlled automatically by the AVR microcontroller's oscillator circuitry.