introduction
Since the 1990s, with the continuous reduction of the feature line width of integrated circuits and the corresponding increase in chip density and operating frequency, reducing power consumption has become a major consideration in the design of submicron and deep submicron VLSI. The increase in power consumption will bring a series of problems, such as circuit parameter drift, reduced reliability, and increased chip packaging costs. Therefore, the power consumption of the system is very important in the entire system design, especially in battery-powered systems.
MICroChip's PIC series of microcontrollers provide a good solution for designing high-performance, low-power microcontroller systems. The following introduces the low-power application of PIC microcontrollers from the perspective of low-power design methods and specific examples.
1 Low Power Design Method
In order to make the system work in a low power state, the configuration and working mode of the microcontroller must be set correctly. The following introduces the design method of low power system in combination with the most commonly used microcontrollers such as PIC12 and PIC16.
1.1 Basic design method
There are many technologies that can reduce the power consumption of the system, the most commonly used is the Sleep mode. When the program executes a SLEEP instruction, it enters the Sleep mode. In Sleep mode, the crystal oscillator stops oscillating, and the microcontroller only has 1μA current under 3V power supply conditions. When the system is working, the microcontroller can use a watchdog or external event to periodically wake up the microcontroller, and use an electronic switch to provide power to the system to reduce the system's standby power consumption and extend the battery life.
The relationship between the operating frequency and power consumption of the microcontroller is also very large. The higher the frequency, the greater the power consumption. When using a 32kHz crystal oscillator and a 3V operating voltage, the typical operating current of the PIC12, PIC16 and other series of microcontrollers is only 15μA; when using a 4MHz crystal oscillator and a 5V operating voltage, the typical operating current of the microcontroller reaches several mA. In many low-power occasions, it is very effective to use a low-speed crystal oscillator to achieve low power consumption. If the microcontroller uses RC oscillation, the oscillation resistance can also be changed by operating the I/O port, thereby changing the operating frequency of the microcontroller to achieve energy saving. As shown in Figure 1, an I/O pin can remove the parallel resistor R1 in the waiting state to reduce the operating frequency of the microcontroller. When the microcontroller needs to work, the I/O pin can be set to output and output a high level to increase the oscillation frequency.
1.2 Oscillation circuit design
In the design of single-chip microcomputer system, the design of oscillation circuit is a very important link. The typical oscillation circuit of PIC series single-chip microcomputer is shown in Figure 2.
In general, designers make their choices according to the parameter table provided by the manufacturer. If the system can work normally, no further improvements will be made. In fact, this is inappropriate. Because Microchip's microcontrollers have operating voltages in the range of DC 2.5 to 5.5V and automotive-grade temperatures in the range of -40 to -125°C, depending on the model and version, and the parameter table only gives a limited number of cases. The actual environmental parameters will have a great impact on the performance of the oscillation circuit. For example, high temperature and low voltage can reduce the oscillation loop gain, thereby reducing the oscillation frequency or making it difficult to start; low temperature and high voltage can increase the loop gain, thereby overdriving the crystal oscillator, creating a potential risk of damage or increasing the high-order harmonic frequency of the oscillation circuit, increasing system power consumption. Therefore, it is very necessary to correctly design the system's oscillation circuit. For the PIC series of microcontrollers, the general design steps are as follows:
① Select a crystal oscillator. Select a crystal oscillator based on the oscillation frequency required by the system. In addition, the operating temperature and frequency stability of the crystal oscillator are also very important indicators.
② Select the oscillator type. The PIC series microcontrollers have RC, LP, XT, HS and other oscillation modes. Except for the RC mode, the selection of the oscillation mode is actually the selection of the loop gain. Low gain corresponds to low oscillation frequency, and high gain corresponds to high oscillation frequency. Generally, you can refer to the data sheet to select the operating frequency according to the actual needs.
③ Select C1 and C2. Ideally, the system should be able to work normally at high temperature and minimum operating voltage, so that the capacitance is as small as possible within the range recommended by the data sheet. At the same time, select C2 to be larger than C1 to increase the phase shift, which is conducive to the power-on startup of the oscillation circuit.
④ Select Rs. After the above parameters have been selected, you need to decide the size of Rs. The simple way is to let the system work at the lowest temperature and maximum voltage. At this time, you should get the maximum output amplitude of the clock circuit. Use an oscilloscope to observe the output waveform of pin OSC2 (note that the probe of the oscilloscope will introduce a capacitor into the circuit, generally a few pF). If you find that the peak (at the receiving Vdd) and valley (at the receiving Vss) of the sine wave are flattened or compressed, it means that the drive is overloaded. You need to add a resistor Rs between OSC2 and C2, generally about 1kΩ or less than 1kΩ. Rs should not be too large. If it is too large, the input and output will be isolated, resulting in greater noise. When it is found that a larger Rs is needed to eliminate overdrive, you can increase the load capacitor C2 to compensate. C2 is generally selected between 15 and 33pF.
The design of the system oscillator circuit has a great impact on the stability and power consumption of the system. Generally, when the system wakes up from the sleep state, the oscillator circuit is the most difficult to start (especially when the system is working at high temperature, low voltage and low frequency). At this time, the resistor Rs is conducive to the start-up of the oscillator circuit, because the cheap carbon film resistor is easy to generate white noise, which helps the circuit to start. In addition, choosing C2 slightly larger than C1 to increase the phase shift is also conducive to the circuit starting.
2 Specific application examples
2.1 System composition and block diagram
The system is mainly composed of PIC microcontroller, dual audio decoding dialing circuit, voice integrated circuit, interface circuit, VCC power supply control circuit, RF transmission circuit and EEPROM. It can control household appliances and automatically transmit alarm and rescue voice information, as shown in Figure 3.
2.2 Controller Working Mode
*When the telephone connected to the controller (hereinafter referred to as the local machine) is off-hook, the input voltage of the telephone line changes, causing the output level of pin 2 of CD40106 to change, and the interrupt signal is input to the RB0 port of the CPU to generate an interrupt signal, wake up the CPU, and the controller enters the working state. The various functions of the controller are controlled through the dial of the local machine, such as controlling the power switch of electrical appliances such as televisions, stereos, and lighting.
*When the controller receives a ringing signal, the output level of pin 4 of CD40106 changes, and the input to the RB6 port of the CPU generates an interrupt signal, which wakes up the CPU to enter the working state and counts the ringing signal; when the set number of rings is reached, the controller enters the telephone receiving state and starts to receive the remotely transmitted DTMF signal. The signal demodulated by MT8880 sends an interrupt signal to the microcontroller through IRQ, stores the data in the register, and is run by the CPU to control various functions of the controller.
*When the controller is used as an alarm and is in alert state, the alarm probe always detects the situation in the guarded area; when the probe sends alarm information to the controller, the RB5 interrupt input to the CPU generates a signal, the controller enters the working state, reads the pre-set alarm telephone number from the EEPROM chip, converts it into a DTMF signal through MT8880, automatically dials, and transmits the information to the user in the form of voice or directly alarms.
2.3 Application Circuit
(1) Telephone interface circuit
The telephone and the controller are connected in series, with the controller in front and the telephone in the back, so that the telephone can control various functions of the controller. The interface circuit consists of an overvoltage protection circuit, a polarity conversion circuit and an interrupt request circuit, as shown in Figure 4.
① Overvoltage protection circuit. A varistor R is added to the telephone line loop. Its function is to be in a short-circuit state when the voltage across it is greater than its working voltage, thereby protecting the subsequent circuit from high voltage damage. When the voltage applied to its two ends is less than its working voltage, the varistor is in an open-circuit state and has no effect on the operation of the subsequent circuit. In this design, the working voltage of the varistor is 220V.
② Polarity conversion circuit. Since the signal transmitted on the telephone line is an AC signal, in order to fix the polarity of the signal, a bridge is added to the circuit for full-wave rectification.
Previous article:Design of driving 24X24 dot matrix screen with PIC16F877A microcontroller
Next article:How to select memory bank 0 or 1 for PIC microcontroller
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
- [2022 Digi-Key Innovation Design Competition] Project Sharing Post 3: Emwin Porting Video on the STM32F7 Official Development Board
- Please help me find the current size of this resistor.
- Flyback power supply damages the chip with integrated MOS
- Quadcopter PID Debugging
- How far is RISC-V from competing with Arm?
- Millimeter wave ceiling light
- Let’s talk about when you became interested in electronics and entered the electronics industry.
- Free application: Sipeed BL808 all-round board, RISC-V triple-core, wireless triple-mode, AIoT+Linux+RTOS
- Pioneer official engineer's dry goods: HPM6000 power management system functions and features, power consumption measurement
- EEPROM erase frequency