Introduction to the design method of PIC microcontroller low power consumption system

Publisher:RadiantEnergyLatest update time:2019-12-25 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.


Introduction to the design method of PIC microcontroller low power consumption system

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.

[1] [2]
Reference address:Introduction to the design method of PIC microcontroller low power consumption system

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

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号