1. How to choose crystal in PIC microcontroller oscillation circuit
For a high-reliability system design, the choice of crystal is very important. This is especially true for systems designed with sleep wake-up (often using low voltage for low power consumption). This is because the low supply voltage reduces the excitation power provided to the crystal, causing the crystal to start oscillating very slowly or not at all. This phenomenon is not particularly obvious during power-on reset, because the circuit has enough disturbance at power-on to easily establish oscillation; during sleep wake-up, the circuit disturbance is much smaller than at power-on, and starting oscillation becomes very difficult. In the oscillation circuit, the crystal should be neither over-driven (easy to oscillate to high-order harmonics) nor under-driven (not easy to start oscillating). The selection of the crystal must at least consider the resonant frequency, load capacitance, excitation power, rate-temperature characteristics, and long-term stability.
2. How to determine whether the crystal oscillator in the circuit is overdriven?
Resistor RS is often used to prevent the crystal from being overdriven. Overdriving the crystal will gradually wear out and reduce the contact plating of the crystal, which will cause the frequency to rise. An oscilloscope can be used to detect the OSC output pin. If a very clear sine wave is detected and the upper and lower limits of the sine wave meet the clock input requirements, the crystal is not overdriven; on the contrary, if the peaks and troughs of the sine wave are flattened and the waveform becomes square, the crystal is overdriven. At this time, resistor RS is needed to prevent the crystal from being overdriven. The easiest way to determine the value of resistor RS is to connect a 5k or 10k trimming resistor in series and slowly increase it from 0 until the sine wave is no longer flattened. This method can find the closest resistor RS value.
3. How to select capacitors C1C2 in crystal oscillator circuits
1 Because each crystal oscillator has its own characteristics, it is best to select external components according to the values provided by the manufacturer.
2. Within the permissible range, the lower the C1C2 value, the better. A larger C value is beneficial to the stability of the oscillator, but it will increase the start-up time.
3. The value of C2 should be greater than the value of C1 so that the crystal oscillator can start oscillating faster when powered on.
4. What are the characteristics of the I/O pins of the PIC series microcontrollers?
Any I/O pin of the PIC series of microcontrollers has a strong load capacity and can provide or inject at least 25mA of current. Therefore, these pins can be used as controllable power supplies in some occasions. For example, in some low-power designs, it is hoped that some surrounding devices will not consume power or consume as little power as possible when the system is on standby. At this time, it can be considered that the power supply for these devices is provided by an I/O pin. When working, the MCU outputs a high level close to VDD on this pin, and a load of several mA is definitely not a problem. If you want to enter low-power mode, the MCU will output a low level close to 0 on this pin. The controlled device will not consume power without power. For example, LCD display circuits, signal modulation circuits, etc. are very suitable for this type of control.
5. Why can’t the system work properly when it is disturbed by external magnetic and electric fields?
If there is no filtering circuit in the main control circuit, the chip you use should be connected to a circuit at the /MCLR end that can filter out the narrow pulses on the port. The low level width added to /MCLR should be greater than 2US to reset the system, and a low level less than 2US will interfere with the normal operation of the system.
6. How can we improve the accuracy of A/D conversion when using PIC chip with A/D?
1 Make sure your system clock is suitable. If you turn off/on the A/D module, you should wait for a period of time. This period of time is the sampling time. If you change the input channel, you also need to wait for this period of time and the final TADTAD is the time required to complete each bit of A/D conversion. TAD can be selected in ADCS1ADCS0 in ADCON0. It should be between 2US-6US. If TAD is too small, it will not be completely converted at the end of the conversion process. If TAD is too long, the voltage on the sampling capacitor will drop before all conversions are completed. For specific details on the selection of this time, please refer to the relevant data sheet or application formula.
2. Usually, if the resistance of the analog signal input terminal is too high, greater than 10Kohms, the sampling current will decrease, thus affecting the conversion accuracy. If the input signal cannot change quickly, it is recommended to use a 0.1UF capacitor at the input channel port. It will change the sampling voltage of the analog channel due to the current supply. The internal holding capacitor is 51.2PF.
3. If all A/D channels are not used up, it is best to use AN0 less because its next pin is close to OSC1, which will affect the A/D conversion.
4 Finally, in the system, if the frequency of the chip is low, the chip oscillation is the preferred clock for A/D conversion. This will reduce the impact of digital conversion noise to a large extent. At the same time, in the system, after the A/D conversion starts and enters the SLEEP state, the RC oscillation inside the chip must be selected as the A/D conversion clock signal. This method will improve the conversion accuracy.
7. Can the RC oscillator on the A/D chip of PIC16C7XX be used for the counter?
The function of the RC oscillator inside the 16C71A/D converter is to allow the MCU to be in sleep mode and the main oscillation to stop, so that there is a clock source for A/D conversion. This RC oscillator cannot be used by other circuits due to its internal design limitations. The typical clock frequency of the RC oscillator inside the A/D converter is 250K, but it will vary considerably with the ambient temperature, working voltage, product batch number, etc. The clock source of the timer can choose the internal oscillation frequency or the external pulse input signal. If you can choose the latter, you can easily make the MCU's main frequency very high and the clock overflow rate low. Otherwise, there seems to be no other tricks except using software to count and divide the frequency. Another option is to use other types of MCU, which has at least another TIMER1 inside. Because TIMER1 can have an independent crystal as the reference for the clock oscillation, you can easily choose a low-frequency crystal to complete your design.
8. Why can't the security bit be burned to "Secret" when using PICSTAR-PLUS to program 16CE625-04/P?
When using PICSTAR-PLUS to program the chip, the program code is placed in the computer's RAM. Each time you write a program, the data is downloaded to the programmer through the serial port for programming, so errors may occur. I have no doubt that there is a problem with your operation, but please note that PICSTAR-PLUS is a programmer for development purposes and is not recommended for mass production. You can calculate that the error probability is 1%, so it seems that you are using it for mass production. To ensure reliable programming, I recommend that you use the PICKIT programmer produced by Gaoqi.
9. Why does the PIC microcontroller sometimes work normally when powered on but cannot wake up after entering sleep mode?
For a high-reliability system design, the choice of crystal is very important. In the oscillation circuit, the crystal should not be overdriven, which makes it easy to oscillate to high harmonics, nor should it be underdriven, which makes it difficult to start oscillation. This is especially true in systems designed with sleep and wake-up functions (often using low voltage for low power consumption). If you just pick up a crystal and use it, your system may have problems. This is because the low power supply voltage reduces the excitation power provided to the crystal, causing the crystal to start oscillating very slowly or not at all. This phenomenon is not particularly obvious during power-on reset. The reason is that the circuit has enough disturbance at power-on, and it is easy to establish oscillation. During sleep and wake-up, the circuit disturbance is much smaller than that at power-on, and starting oscillation becomes very difficult. A simple way to evaluate whether the oscillation circuit is working at the best point is to use an oscilloscope to view the waveform on the OSC2 pin. It must be considered that the oscilloscope is connected to the capacitor. The best case is to see a very clean and beautiful sine wave without any waveform distortion, and it must be full-scale and close to VCC and GND. The choice of crystal must at least consider the resonant frequency, load capacitance, excitation power, temperature characteristics, and long-term stability.
10. Precautions for crystal selection in PIC microcontroller applications
For a high-reliability system design, the choice of crystal is very important. In the oscillation circuit, the crystal should be neither over-driven (easy to oscillate to high harmonics) nor under-driven (not easy to oscillate). Especially in the design of a system with sleep wake-up, which often uses low voltage for low power consumption, if you still use a crystal at random, your system may have problems. This is because the low power supply voltage reduces the excitation power provided to the crystal, causing the crystal to oscillate very slowly or not at all. This phenomenon is not particularly obvious during power-on reset. The reason is that when the circuit is powered on, there is enough disturbance, so it is easy to establish oscillation. When the circuit is woken up from sleep, the disturbance is much smaller than when it is powered on, and it becomes very difficult to oscillate. Some people comment on why the requirements for crystals of PIC microcontrollers are so high. It seems that using 51 has never been so troublesome. Just use whatever you can get.
Previous article:PIC microcontroller interrupt program example
Next article:Several skills to master in single chip microcomputer development
Recommended ReadingLatest update time:2024-11-16 14:29
- Popular Resources
- Popular amplifiers
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- Modern Product Design Guide
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- EEWORLD University Hall----Electromagnetic Compatibility Principles and Design
- MSP430 realizes access card function (RFID) through RC522
- Several key performance characteristics of the MSP432P401R MCU 14-bit ADC
- Pin-regulated 8mA output amplifier
- Problems with adding vias to PCB boards
- 2G communication project - power consumption test comparison and analysis of IoT small size modules M26 and M6315 - waiting for suggestions online!
- (Reward: 5000 RMB) ADS1220 cannot collect data
- EEWORLD University ---- Intelligent Control
- EEWORLD University Hall----Design and optimization of buck-boost charging chip compatible with USB-PD protocol
- Self-wound coil inductance calculation assistant