What are the functions of crystal oscillator?
The clock source of microcontroller can be divided into two types: the clock source based on mechanical resonant devices, such as crystal oscillator and ceramic resonant channel; RC oscillator. One is the configuration of Pierce oscillator, which is suitable for crystal oscillator and ceramic resonant channel. The other is a simple discrete RC oscillator. Oscillators based on crystal oscillator and ceramic resonant channel can usually provide very high initial accuracy and low temperature coefficient. RC oscillator can start up quickly and has low cost, but it usually has poor accuracy in the whole range of temperature and working power supply voltage, and can vary from 5% to 50% of the nominal output frequency. But its performance is affected by the environmental conditions and the selection of circuit components. The selection of components and layout of circuit board should be taken seriously< br>
In use, the ceramic resonant channel and the corresponding load capacitance must be optimized according to the specific logic series. The crystal oscillator with high Q value is not sensitive to the choice of amplifier, but it is easy to cause frequency drift (even damage) when it is over driven. The environmental factors that affect the operation of the oscillator are: electromagnetic interference (EMI), mechanical vibration and impact, humidity and temperature. These factors will increase the variation of output frequency, increase the instability, and in some cases, cause the oscillator to stop< br>
Most of the above problems can be avoided by using oscillator module. These modules have their own oscillators, provide low resistance square wave output, and can guarantee operation under certain conditions. Two common types are crystal oscillator module and integrated RC oscillator (silicon oscillator). Crystal oscillator module provides the same precision as discrete crystal oscillator. The precision of the silicon oscillator is higher than that of the discrete RC oscillator, and in most cases it can provide the same precision as the ceramic resonant channel< br>
The power consumption should also be considered when choosing the oscillator. The power consumption of the discrete oscillator is mainly determined by the power supply current of the feedback amplifier and the internal capacitance of the circuit. The power consumption of CMOS amplifier is directly proportional to the operating frequency, which can be expressed as the value of power dissipation capacitance. For example, the power dissipation capacitance of hc04 inverter gate is 90pf. When working under 4MHz and 5V power supply, it is equivalent to 1.8Ma power supply current. With 20pF crystal load capacitor, the power supply current is 2.2ma. Ceramic resonant channels generally have larger load capacitance, and need more current accordingly. In contrast, crystal oscillator module generally needs power supply current of 10mA ~ 60mA. The power supply current of silicon oscillator depends on its type and function, ranging from a few microamperes of low frequency (fixed) devices to a few milliamps of programmable devices. A low-power silicon oscillator, such as max7375, needs less than 2mA at 4MHz. To optimize clock source in specific applications, we need to consider the following factors: accuracy, cost, power consumption and environmental requirements.