51 MCU solves the debugging process

Publisher:EnchantedDreamsLatest update time:2021-03-17 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

For a newly designed circuit board, debugging often encounters some difficulties, especially when the board is large and has many components, it is often difficult to start. But if you master a set of reasonable debugging methods, debugging will be twice the result with half the effort. For the new PCB board just brought back, we must first roughly observe whether there are any problems on the board, such as whether there are obvious cracks, short circuits, open circuits, etc. If necessary, you can check whether the resistance between the power supply and the ground wire is large enough.


Then it is time to install the components. If you are not sure that the independent modules are working properly, it is best not to install them all at once, but install them one by one (for smaller circuits, you can install them all at once). This makes it easier to determine the scope of the fault, so as to avoid being at a loss when encountering problems. Generally speaking, you can install the power supply first, and then power on to test whether the output voltage of the power supply is normal. If you are not very sure when powering on (even if you are very sure, it is recommended that you add a fuse just in case), you can consider using an adjustable regulated power supply with current limiting function. First preset the overcurrent protection current, then slowly increase the voltage value of the regulated power supply, and monitor the input current, input voltage and output voltage. If there are no problems such as overcurrent protection during the upward adjustment, and the output voltage has reached normal, it means that the power supply is OK. Otherwise, disconnect the power supply, find the fault point, and repeat the above steps until the power supply is normal.


Next, gradually install other modules. After each module is installed, power it on for testing. Follow the above steps when powering on to avoid overcurrent and component burnout due to design errors and/or installation errors.


There are generally several ways to find the fault:


① Voltage measurement method. First, check whether the voltage of each chip power pin is normal, then check whether various reference voltages are normal, and whether the working voltage of each point is normal. For example, when a general silicon transistor is turned on, the BE junction voltage is about 0.7V, and the CE junction voltage is about 0.3V or less. If the BE junction voltage of a transistor is greater than 0.7V (except for special transistors, such as Darlington, etc.), it is possible that the BE junction is open.


②Signal injection method. Add the signal source to the input terminal, and then measure the waveform of each point in turn to see if it is normal, so as to find the fault point. Sometimes we also use a simpler method, such as holding a pair of tweezers in hand to touch the input terminal of each level to see if there is a response at the output terminal. This is often used in audio, video and other amplification circuits (but be aware that this method cannot be used in circuits with hot base plates or high voltages, otherwise it may cause electric shock). If there is no response when touching the previous level, but there is a response when touching the next level, it means that the problem lies in the previous level and should be checked in detail.


③ Of course, there are many other ways to find the fault point, such as looking, listening, smelling, etc. "Looking" means to see if the component has obvious mechanical damage, such as cracking, burning, deformation, etc.; "Listening" means to listen to whether the working sound is normal, such as some things that should not be ringing are ringing, the places that should be ringing are not ringing or the sound is abnormal, etc.; "Smelling" means to check whether there is any odor, such as the smell of burning, the smell of capacitor electrolyte, etc. For an experienced electronic maintenance personnel, these odors are very sensitive; "Touching" means to use your hands to test whether the temperature of the device is normal, such as too hot or too cold. Some power devices will heat up when working. If they feel cool to the touch, it can basically be judged that it is not working. But if the place that should not be hot is hot or the place that should be hot is too hot, it is not okay. For general power transistors, voltage regulator chips, etc., it is completely fine to work below 70 degrees. What is the concept of 70 degrees? If you press your hand on it and can hold it for more than three seconds, it means that the temperature is about 70 degrees.


If you want to know more debugging methods and experience, you can find some books on home appliance maintenance. A good designer should first be a good maintenance person.


First, you should confirm whether the power supply voltage is normal. Use a voltmeter to measure the voltage between the ground pin and the power pin to see if it is the power supply voltage, such as the commonly used 5V. The next step is to check whether the reset pin voltage is normal. Measure the voltage values ​​when the reset button is pressed and released to see if they are correct. Then check whether the crystal oscillator is oscillating. There are two ways: 1. Generally, use an oscilloscope to view the waveform of the crystal oscillator pin. Note that the "X10" position of the oscilloscope probe should be used. 2. Measure the voltage of the 18th and 19th legs respectively. The voltage of the 18th leg is about 2V, and the voltage of the 18th leg is slightly higher than that of the 19th leg!


Another way is to measure the IO port level in the reset state. Press and hold the reset button, and then measure the voltage of the IO port (except the P0 port that is not connected to the external pull-up) to see if it is a high level. If it is not a high level, it is mostly because the crystal oscillator has not started. Another thing to note is that if you use the on-chip ROM (this is the case in most cases, and now there are very few people who use external expansion ROM), you must pull the EA pin high, otherwise the program will run around. Sometimes it works with the emulator, but it doesn't work when burning into the chip. It is often because the EA pin is not pulled high (of course, the crystal oscillator does not start oscillating is also the only reason). After checking the above points, the fault can generally be eliminated. If the system is unstable, it is sometimes caused by poor power supply filtering. Connecting a 0.1uF capacitor between the power pin and the ground pin of the microcontroller will improve it. If the power supply does not have a filter capacitor, you need to connect a larger filter capacitor, such as 220uF. When the system is unstable, you can try to connect a capacitor (the closer to the chip, the better).


Reference address:51 MCU solves the debugging process

Previous article:Design of Single Chip Microcomputer Control System for Stepping Motor
Next article:The resistance value of the pull-up resistor of the P0 port of the 51 single-chip microcomputer

Latest Microcontroller Articles
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号