Home  >  News  >  Industry News
How to quickly understand the crystal?
What is a crystal oscillator?

A crystal oscillator is generally called a crystal resonator. It is a kind of electromechanical device. It is made of quartz crystal with very little electrical loss after precision cutting and grinding, and is plated with electrodes and welded with leads.

A crystal oscillator is very important for a single-chip microcomputer. It can be said that there is no clock cycle without a crystal oscillator, and program code cannot be executed without a clock cycle. In that case, the single-chip microcomputer cannot work. Next, I followed the editor's detailed understanding of the circuit principle and role of a single-chip crystal.

The necessity of a single-chip crystal

When the single-chip microcomputer works, it fetches instructions one by one from the ROM and then executes them step by step. The time it takes for a microcontroller to access a memory is called a machine cycle, which is a time reference. A machine cycle consists of 12 clock cycles. If a single-chip microcomputer selects a 12MHZ crystal oscillator, its clock cycle is 1 / 12us, and its one machine cycle is 12x (1/12) us, which is 1US.

Among all the instructions of the MCS-51 single-chip microcomputer, some are completed relatively quickly, as long as one machine cycle is sufficient, and some are completed relatively quickly, which requires 2 machine cycles, and two instructions require 4 machine cycles. In order to measure the length of instruction execution time, a new concept is introduced: instruction cycle. The so-called instruction cycle refers to the time taken to execute an instruction. For example, when the time required to complete the DJNZ instruction needs to be calculated, the frequency of the crystal oscillator must be known first. If the crystal used is 12MHZ, one machine cycle is 1US. The DJNZ instruction is a two-cycle instruction, so it will execute 2US at a time. If the instruction needs to be executed 500 times, it is exactly 1000us, which is 1ms.

The machine cycle is not only of great significance for instruction execution, but also the machine benchmark is the time reference for the timer and counter of the microcontroller. For example, a single-chip microcomputer selects a 12MHZ crystal oscillator. When the timer value is increased by 1, the actual elapsed time is 1us, which is the timing principle of the single-chip microcomputer.

Microcontroller Crystal Oscillator Frequently Asked Questions

1. How to choose a crystal in the PIC microcontroller oscillation circuit?

For the design of a highly reliable system, the choice of crystal is very important, especially for systems with sleep and wake-up, which often use low voltage for low power consumption. This is because the low power supply voltage reduces the excitation power provided to the crystal, resulting in The crystal starts very slowly or cannot start at all. This phenomenon is not particularly obvious at power-on reset. The reason is that the circuit has enough disturbances when it is powered on, and it is easy to establish oscillations. When the sleep wakes up, the circuit disturbances It is much smaller than when it is powered on, and the oscillation becomes very difficult. In the oscillating circuit, the crystal can neither be overexcited and easily vibrate to higher harmonics, nor can it be underexcited and difficult to start. The crystal must be selected at least. Consider, long-term stability of resonance frequency, load capacitance, excitation power, and temperature characteristics.

2. How to judge whether the crystal oscillator in the circuit is driven excessively?

The resistor RS is often used to prevent the crystal from being overdriven. Overdriving the crystal will gradually wear down and reduce the contact plating of the crystal. This will cause the frequency to rise. It can be detected by an oscilloscope, OSC, output pin. If a very clear sine wave and sine wave are detected Both the upper and lower limit values meet the requirements of the clock input, so the crystal oscillator is not excessively driven. On the contrary, if the peak of a sine waveform, both ends of the trough are flattened to make the waveform square, the crystal oscillator is excessively driven. The resistor RS needs to be used to prevent the crystal from being driven excessively. The easiest way to judge the value of the resistor RS is to connect a 5k or 10k trimmer resistor in series, and slowly increase it from 0 until the sine wave is no longer flattened. This method can find the closest resistance RS value.

3. How to choose capacitors in the crystal circuit?

(1) C1, C21, because each crystal has its own characteristics, it is best to choose external components according to the value provided by the manufacturer.

(2) Within the permissible range, the lower the values of C1 and C2, the better. Although a larger value of C is beneficial to the stability of the oscillator, it will increase the start-up time.

(3) The value of C2 should be greater than the value of C1, so that when the power is turned on, the crystal oscillator will speed up.

Shenzhen Shangmeijia Electronics Co., Ltd., Murata Inductors, Murata Magnetic Beads, Murata Agents.
Back To List
Tel:86-755-8282 3580
Address: 1st Floor,Building 31,Yuanshan Industrial Park B,shangcun,Gongming,Guangming District,shenzhen
86-755-8282 3580
Counseling hotline
Online service
Shenzhen Sanmega Electronics CO.,LTD All Rights Reserved. 
Copyright @ 2017
Home   |   About us   |   Products   |   Solution   |   Service&Support   |   News   |   Contact us   |   Sitemap
Marco 点击这里给我发消息
Linda 点击这里给我发消息
phiona 点击这里给我发消息
Donald 点击这里给我发消息