January 09, 2025

50 single crystal oscillator problems and solutions summary

1. Analysis of the reason why the crystal oscillator of single chip does not vibrate

It is a common phenomenon to encounter the crystal oscillator of the single chip, so what are the reasons for the crystal oscillator?

(1) PCB board wiring error;

(2) There is a problem with the quality of the single chip microcomputer;

(3) There is a problem with the quality of the crystal oscillator;

(4) The load capacitor or matching capacitor does not match the crystal oscillator or the capacitor quality is faulty;

(5) The PCB board is damp, resulting in impedance mismatch and failure to start vibration;

(6) The trace of the crystal oscillator circuit is too long;

(7) There are traces between the legs of the crystal oscillator;

(8) The influence of peripheral circuits.

Solution, it is recommended to troubleshoot one by one as follows:

(1) Eliminate the possibility of circuit errors, so you can compare them with the recommended circuit of the corresponding model.

(2) Eliminate the possibility of bad external components, because the peripheral parts are nothing but resistors and capacitors, you can easily identify whether it is good.

(3) Eliminate the possibility that the crystal oscillator is a vibration-damping product, because you will not try only one or two crystal oscillators.

(4) Try changing the capacitance at both ends of the crystal. Maybe the crystal oscillator can start up. Please refer to the crystal oscillator for the size of the capacitor.

(5) When routing the PCB, the trace of the crystal oscillator circuit should be as short as possible and as close as possible to the IC, so as to prevent the trace between the two legs of the crystal.

2. What is the asymmetry of the two trimmer capacitors in the crystal oscillator circuit of the single chip? How much difference will the frequency change? When I detected the receiving module of the wireless mouse, I found that the frequency always changed slowly (that is, the hand of the probe has not been loosened, and the frequency is slowly getting smaller). The crystal oscillator is new!

A: The asymmetry of the capacitor will not cause the frequency drift. The frequency drift you mentioned may be caused by the unstable capacity of the crystal oscillator. You can change it. It is not difficult to change the two capacitors, or your crystal oscillator. The stability is too bad, or the method you are measuring has a problem.

3, 51 single-chip clock circuit with 12MHZ crystal oscillator when the value of the capacitor is derived? Take the internal clock circuit to explain it!

A: Actually, no one of these two capacitors can explain how to choose the value, because 22pF is really too small.

This can only be said to have a relationship with the internal oscillator circuit's own characteristics, used together to correct the waveform, no one to go deep into why it is such a large value.


4. Why is the crystal oscillator required to be close to the IC, and the crystal oscillator of the single chip does not vibrate?

A: The reasons are as follows:

The crystal oscillator generates electrical vibration at a fixed frequency by electric excitation, and the vibration generates current feedback to the circuit. After the circuit receives the feedback, the signal is amplified, and the amplified electrical signal is used to excite the mechanical vibration of the crystal oscillator. The crystal oscillator generates vibration again. The current is fed back to the circuit, and so on. When the excitation electric signal in the circuit and the nominal frequency of the crystal oscillator are the same, the circuit can output a strong, frequency-stable sine wave. The shaping circuit then converts the sine wave into a square wave for use in the digital circuit.

The problem is that the crystal's output capability is limited, it only outputs electrical energy in milliwatts. Inside the IC (integrated circuit), this signal is amplified by a few hundred times or even thousands of times by an amplifier to be used normally.

The crystal oscillator and the IC are usually connected by copper traces. This trace can be regarded as a length of wire or a number of wires. When the wire is cut, the current will be generated. The longer the wire, the stronger the current generated.

In reality, magnetic lines of force are not common, and electromagnetic waves are everywhere, such as: radio broadcasts, television tower launches, cell phone communications, and so on. The connection between the crystal and the IC becomes the receiving antenna. The longer it is, the stronger the received signal is, and the stronger the generated electrical energy is until the received electrical signal strength exceeds or approaches the signal strength generated by the crystal. The output of the amplifying circuit in the IC will no longer be a square wave of a fixed frequency, but a messy signal, which causes the digital circuit to fail to work synchronously and error.

Therefore, when drawing a PCB (circuit board), the closer the crystal oscillator is to its amplifier circuit (IC pin), the better.

5, the crystal oscillator and speed of the microcontroller, the cycle of executing an instruction is not determined by the crystal oscillator. Then, for example, 51 single-chip microcomputer and MSP430, 51 high-speed crystal oscillator, 430 low speed, is it faster to run 51? Is the speed of the single-chip microcomputer only related to the crystal oscillator, the key is whether the single-chip microcomputer can support such a large crystal oscillator? Is my understanding correct?

A: The speed of each MCU is affected by the internal logic gate level transition speed.

You are right, for a 51, give him a higher crystal, the speed will be faster.

But for advanced microcontrollers it is different. Inside the advanced MCU, there are generally frequency control registers. Therefore, simply increasing the crystal oscillator may reach the limit of the MCU, resulting in runaway.

6, the relationship between the operating speed of the single-chip microcomputer and the size of the crystal oscillator, if the maximum operating frequency of the single-chip microcomputer is 40M, can the crystal oscillator select 24M or higher, but not more than 40M, so whether the running speed of the single-chip microcomputer increases greatly? Does it have a bad influence on the MCU at this working frequency for a long time? What is the principle of the selection of the crystal oscillator by the single chip microcomputer? Thank you!

A: Of course, it is influential. The faster the working speed of the MCU, the greater the power consumption, and the more severe the interference will be. In short, the maximum can run 40M, and the running is not more than 40M, there is no problem, just related technology. (such as the selection of PCB Design components, etc.) will be much higher.

7. I would like to ask: Is there any way to determine whether a certain MCU can work normally under a crystal oscillator of a certain size?

A: The crystal oscillator is like the heart of a single chip microcomputer.

Crystal oscillator selection is too high is not suitable, the specific crystal oscillator upper limit is, I am afraid it can not be measured, can only be in accordance with the requirements of other people's single-chip, the general STC series MCU upper limit is 35M or 40M, stc alone on the written, such as STC11F16XE 35I-LQFP44G Among them, 35I is an industrial grade chip with a crystal oscillator of up to 35M.

What kind of problems will occur if the upper limit is exceeded? If there is no test, the general crystal oscillator selects 12M more. If the STC 1T command is selected, it is equivalent to the crystal oscillator of 12*12=144M. If it is used for serial communication, it is recommended to use 11.0592M or 22.184M. The most important choice for crystal oscillator is to refer to the manual of others.

8, 4 AT89C51 microcontroller can use a 12M crystal to make it work? One uses the internal clock mode, and the other three use the external mode... Then I can use the internal mode instead of four (all 4 microcontrollers are connected in parallel to one crystal oscillator)?

A: Yes, one of them is normally connected to the crystal, and its XTAL2 output is connected to the other three XTAL1 inputs.

9, AT89C51 single-chip 4 trillion crystal can start?

A: Of course, look at the datasheet, I guess 1M can be

Some microcontrollers such as 2051 may still be low

Taiwanese Japanese can have 32.768kHz

10, 89c51 microcontroller reset circuit often uses 12MHZ crystal oscillator, in fact, the market is slightly smaller than 12MHZ, why? Urgent

A: When you need serial communication, you usually use 11.0582MHZ, so the baud rate is good.

It is easy to calculate with a duty cycle of 12 MHz.

21, the crystal oscillator of the single chip does not vibrate, but when the hand touches the crystal, it starts to vibrate. Why?

A: Look at the matching of the crystal oscillator with the capacitor, is there any error?

22. How to judge whether the crystal oscillator of the single chip starts to vibrate? Hurry! !

A: The easiest way is to use an oscilloscope. In addition, you can see if the power supply is normal.

23. How to judge whether the external crystal oscillator of the single chip has started up? My STC89C52 MCU was originally good, but I can't do it. I changed it to a crystal oscillator. But after a few hours, it will not work, what is going on. There is also how to determine whether the crystal oscillator starts to oscillate?

Answer: The first point: try to change a single-chip microcomputer first, and the problem is still to exclude the single-chip microcomputer;

The second point: it may be caused by the virtual welding, this should be noted;

The third point: I also encountered a similar problem with the STC89C52. I changed the crystal oscillator to OK. It seems that the STC is not as smooth as the AT89S52.

In fact, for the STC89C52 you can directly look at the 30 feet (ALE), pick up a light, and you can see it at once. 24, I use the msp430 microcontroller, but the external two crystal oscillators are always unable to start, useless. May I ask what is the reason? The line connection is correct, and the 32768HZ is not connected to an external capacitor. The 8M crystal is connected to the 56PF capacitor.

A: The 32.768K crystal oscillator is connected to two 30P capacitors, and the 8M crystal oscillator is also replaced by 30P.

25, MSP430 microcontroller 8MHz crystal oscillator, how long does it take to increase the counter TAR?

Answer: The crystal frequency of MSP430 MCU can be set by itself. Is it always sourced by using external crystal or internal oscillator? There are also MCLK, SMCLK, ACLK selection, no division, etc. I have a little forgotten now, but you You can look at the document, which one of the mclk, smclk, and ACLK counters are used to determine whether or not to divide the frequency. Generally, the 1Mhz TAR is 1us, then 8M is 1/8us.

26, if the MSP430 microcontroller does not initialize the crystal oscillator, then what is the microcontroller used as a clock? What is the frequency of the DCO?

A: Internal DCO, different series of DCO default frequency is different, please refer to the manual. The 4 series seems to be 1M.

27. Is there a blank microcontroller with no program, can the external crystal oscillator start?

Answer: The external crystal oscillator can be oscillated without the internal crystal oscillator. For example, the traditional MS51 series MCU has an internal crystal oscillator, and the external crystal oscillator will not start. It needs to be oscillated after the external crystal oscillator is configured. If the external crystal oscillator is not used, Configuration still uses internal crystal oscillator, such as silicon lab series c8051f** microcontroller

28, dspic30f6014 microcontroller can program, but can not run. The crystal oscillator does not start up (it is useless after switching), the reset voltage is measured as 5v, and the power supply is normal (it is a mature product, but this happens occasionally)

Answer: 01. Review the parts used for the oscillating circuit (crystal and capacitor) and the pcb layout near the crystal oscillator.

02. Check if the configuration bit is correct.

03, can also find FAE consultation

29, why at89c52 P1.0 output 2.5v voltage, the microcontroller does not seem to work, the crystal oscillator waveform is an irregular sine wave can not? The circuit board did not achieve the expected effect, the LED is always bright, it is still a problem with the microcontroller, P1.0 output 2.5v voltage, X5045 for the watchdog, I have been looking for several days.

A: Remove the watchdog and temporarily make the minimum system. There are only power supply, 8952, crystal oscillator and two 30P capacitors.

1. Set the P1.0 port to 1 and test whether the voltage of the port is above 2.5V.

2. Set P1.0 port to 0 to test whether the voltage change is about 0V.

If yes, it is OK, otherwise you should look at the power supply voltage, crystal oscillator, and 8952. The power supply voltage is 5+, -0.25V, and the ripple must be small

30. Does the MCU test the crystal voltage have an effect on the working state?

My 51 MCU connected two LEDs from the P2 port, only one bright when normal. After I plugged in the power, both of the results were lit. So I measured the crystal voltage, but my black test pen is grounded. When the red test pen touches the crystal oscillator pin, one of the two LEDs will go out. When both are turned on, both will be lit.

Each time the power is plugged in, the two crystal pins are 1.9V and 1.5v respectively, but after a while, the two pins are 5.4V and 0.02V respectively.

A: There will be a little impact, which will have an effect on the frequency, which will cause the crystal to stop vibrating. Because your multimeter is added to the equivalent of the oscillator circuit and the partial capacitor resistance and inductance, it affects the state of the original circuit.

31, the production of max232 download MCU, the working voltage is normal, to add a crystal oscillator? c

A: Of course, if you don't have an external crystal oscillator, then the clock circuit of the MCU will be gone, and the serial port of the MCU will not be able to transfer data. In the end, you can't download the program.

32. What effect does the static working point have on the oscillation of the crystal oscillator?

A: A crystal with a high Q value is not sensitive to the choice of amplifier, but it is prone to frequency drift (and possibly even damage) during overdrive. Environmental factors that affect the operation of the oscillator are: electromagnetic interference (EMI), mechanical shock and shock

33, I use an external 4M crystal oscillator plus two 30pf ceramic capacitors, the frequency is normal with an oscilloscope, but the peak-to-peak board is about 6V, and some are about 3V, the board function is normal but I am afraid of low voltage instability. I don't know if there is any basis for the crystal test, or thank you! ! !

Answer: It doesn't matter. The peak-to-peak value is caused by the discrete parameters of the capacitor and the crystal oscillator. As long as it works normally, it can be amplified by the single-chip microcomputer. They are all amplified and expanded into square waves. The peak-to-peak value is high. Useless.

Your high voltage should look at it, pic general working voltage is 5V, how the oscillator will come in such a high voltage? I usually use a resistor in series with the CPU crystal input.

34, I used an external 4M crystal oscillator plus two 30pf ceramic capacitors, the frequency is normal with an oscilloscope, but the peak-to-peak board is about 6V, and some are about 3V, the board function is normal but I am afraid of low voltage instability. I don't know if there is any basis for the crystal test, or thank you! ! !

Answer: It doesn't matter. The peak-to-peak value is caused by the discrete parameters of the capacitor and the crystal oscillator. As long as it works normally, it can be amplified by the single-chip microcomputer. They are all amplified and expanded into square waves. The peak-to-peak value is high. Useless.

Your high voltage should look at it, the general working voltage of pic is 5V, how can the oscillator come in such a high voltage?

I usually use a resistor in series with the CPU crystal input.

35, pic microcontroller AD sampling program active crystal oscillator should choose?

If an on-chip oscillator is used, is it necessary to connect an external resonator?

If I have an external active crystal oscillator, what kind of frequency is better? I have heard that 4MHz is not ideal. Is it possible to connect 20MHz? How is this chosen?

A: An external resonator is not required for the on-chip oscillator.

If your MCU only performs AD acquisition conversion, then it does not need too high frequency, the internal 4Mhz oscillator can be.

But if you have to do other things that require more stringent timing, such as bus communication, then consider using an external oscillator because the internal oscillator error is too large (even 1% error even if calibrated), and how much is used. The crystal oscillator depends on the working requirements. The higher the frequency, the higher the power consumption of the microcontroller. But if you only do AD, 4M is enough.

36, everyone. I want to ask a pic microcontroller problem: the crystal frequency is not the same. Does the compiler have the same library delay function delay? For example, is the crystal 20MHZ delayus(1) and 5MHZ delayus(1) the same as 1us?

A: It should be the same.

Because the frequency is not the same, your settings are not the same when compiling, the multiples needed for natural calculation at compile time, the parameters are different.

But there may be a little difference because of the inexhaustible frequency.

37, the external microcontroller 24M crystal, 1ms reference delay function with C language how to write?

A: Timer T0 working mode 1 crystal frequency 24MHz

Timer maximum timing (us): 32768

Timer minimum timing (us): 0.5

[1ms precise timing C51 code]

Void T0_init(void) //Timer initialization

{

TMOD |= 0x01;

TH0 = 0xf8; //Set the initial value of the timer, timing 1000us

TL0 = 0x33;

IE |= 0x82; //Open the total interrupt

TR0 = 1; //Start timer

}

Void T0_intservice(void) interrupt 1 //Timer interrupt service

{

TH0 = 0xf8; //Reload timer count initial value

TL0 = 0x33;

/ / Here you can insert other handlers, will not affect the timer work

}

38. Can a single-chip 24M crystal oscillator measure a signal of 20 MHz?

A: It depends on what MCU is used. Some microcontrollers require more than two machine cycles to execute an instruction. That definitely does not measure the signal of 20MHZ.

39. Which is better to generate signals with the crystal oscillator circuit of the single chip microcomputer and generate signals with the 555 timer?

A: Generally speaking, the stability of the crystal is better than that of the RC oscillator.

40. What circuit can use 32768 crystal oscillator to generate 32768 square wave signal?

A: With the NOR gate, the task of oscillation and square wave shaping can also be completed. The circuit is shown in the illustration.

The crystal oscillator in the figure is originally 38000Hz. If it is changed to 32768Hz, it can work normally.

41. The principle of crystal oscillator, how to generate sinusoidal signal, in detail, from the circuit aspect analysis?

Answer: The crystal can be equivalent to an inductor, forming an oscillating circuit with the capacitor inside. The energy slowly flows from the inductor to the capacitor, and then slowly flows from the capacitor to the inductor, and the oscillation is repeated. The positive half cycle is the charging and discharging process of the capacitor, and the negative half cycle is the charging and discharging process of the inductor.

42. What are the pin connections of the 11.09952 crystal oscillator and the microcontroller? Which pins should the power supply and 18B20 be connected to? RT, how to connect the MCU from the experiment board? How to connect the LCD of 1602LCD to the MCU? Every time you connect from the simulation, there are only backlights and black dots, but the programs that have been burned are not displayed.

A: The crystal oscillator is connected to the microcontroller x1 (or XTAL1) and x2 (or XTAL2) pins.

The power supply is connected to the VCC and GND of the microcontroller.

The 18b20 power supply pin is connected to the power supply, and the middle data line can be any io port of the single chip microcomputer. The specific control is done by the program.

The data line of 1602 is connected to the single-chip io (such as the P1 port of 51 single-chip microcomputer), and other control lines rw, reset, cs, etc. can be connected to any IO port of the single-chip microcomputer.

If the program is not running, and the program is correct, you have to see how the program defines these pins and define the location of the microcontroller according to the program definition.

43. I am going to use a 52 MCU to make a traffic light circuit. The requirements are red light, green light 30s, yellow light 3s. Cycling changes. So how do you choose the outside crystal? How much is a single instruction cycle? What is the role of the two external capacitors in the figure? How big is the size?

Answer: If you choose crystal oscillator, the two capacitor values ​​can be selected: 30 plus or minus 10PF (frequency between 0~33MHZ);

If you choose a ceramic crystal, the capacitance value can be selected: 40 plus or minus 10PF (frequency is 1.2~12MHZ). The oscillator should be as close as possible to the capacitor. The instruction cycle is ok, this is a formula!

44, 89c52 microcontroller if you do not receive the crystal will have any consequences?

A: The program does not work if the microcontroller does not work. . . . and many more

45. If the 89c52 MCU uses an external crystal oscillator, how should it be set?

Answer: The two pins of the crystal oscillator are connected to a capacitor of 20~30pf and then connected to the XTAL1 and XTAL2 of the MCU. The other ends of the two capacitors are connected and grounded. No need for any setting.

46, 89c52 single-chip crystal frequency is only 12 trillion, too small, how can change the crystal frequency?

A: Externally connected to the 18.432 or 24MHz crystal oscillator. Or change the 4T W77E58 microcontroller, which is equivalent to increase the operating frequency by 3 times. Or change 1T DS89C4XX microcontroller, which is equivalent to increase the working frequency by 8 times! Enough? This is also the case with the 1T STC12C5A** microcontroller.

47. The problem of the working frequency of the single chip microcomputer, how to choose the crystal oscillator in the end?

answer:

1, the most basic one-chip computer, its machine working frequency is: crystal frequency ÷12

2, some microcontrollers (advanced) machine operating frequency is: crystal frequency ÷ 2 (or 6, etc.)

3. Taking assembly language as an example, the time required for a single-chip microcomputer to execute an instruction is 1~2 machine cycles (machine cycle = 1÷ machine working frequency)

4. Example:

A common single-chip crystal oscillator 12MHz, its machine operating frequency is 12MHz ÷ 12 = 1MHz

The machine cycle = 1÷1MHz = 0.000001 seconds (that is, the negative 6th power of 10)

The "MOV" instruction requires a machine cycle to complete, which means that executing this instruction takes 10 negative 6ths of a second, for such a long time.

48, 51 single-chip crystal oscillator connected to the size of the capacitor how to choose? Is the crystal oscillator bigger, the capacitance value is also larger, generally used. Some people say that the commonly used from 15-33pf, how to choose the best? For example, I use a 6M and 12M crystal, how much more suitable is the capacitor?

A: 15-33pf can be generally used 15P and 30P crystal oscillator size is not big, we commonly use 4M and 12M and 11.0592M and 20M 24M we all use 30P microcontroller inside the corresponding shaping circuit we are not worried

49, I will give 51 MCU 12M crystal to connect 2200pF capacitor? The circuit diagram looks like 22pF, but I don't have 22pF... Will 2200pF not work properly?

A: No, the crystal will not work. 15-33p is a reasonable range. You can give it a try and there will be no damage to the microcontroller.

50, the microcontroller can not work properly, crystal problem? How to check if the crystal is normal or not? In addition, I saw that the crystal oscillator is very close to the two small capacitors. I almost didn't cut the pins (how long it took to buy them). I plugged it in. Is this also relevant?

Answer: Use a multimeter to measure the voltage of the two pins connected to the crystal oscillator. The voltage is about 1/2 lower than the power supply voltage. If one or all of the pins are the power supply voltage or zero, it means no vibration. The length of the pin will generally have no effect. In contrast, the grounding is more critical. The grounding of the two resonant capacitors should be as close as possible to the power supply of the microcontroller.


HDI PCB

HDI circuit board is a circuit board with high circuit distribution density using micro-blind and buried via technology.The HDI board is divided into inner layer circuit and outer layer circuit, and the internal connection of each layer circuit is realized by drilling and metallization.


Therefore, the higher the application of HDI technology, the higher the manufacturing level of the laminate. Ordinary HDI boards are laminated once, and high-end HDI uses two, three or more lamination processes, as well as electroplating fill holes, stack holes, laser direct drilling, etc.

We are a large professional printed circuit board manufacturer and also have the ability to produce multi-layer HDI circuit boards.

HDI PCB Manufacturer,Multilayer HDI PCB,Blind Buried via plate,HDI Plate,ENIG Surface Finished

Huizhou Liandajin Electronic Co., Ltd , https://www.ldjpcb.com