Hardware debugging steps in the MCU development process

Publisher:逍遥游侠Latest update time:2014-01-22 Source: dqjswKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In the process of single-chip microcomputer development, from hardware design to software design, almost all of them are completed by the developer himself according to the characteristics of the system. Although this can reduce system costs and improve system adaptability, the debugging of each system takes up 2/3 of the total development time, which shows that the workload of debugging is relatively large. The hardware debugging and software debugging of the single-chip microcomputer system cannot be separated. Many hardware errors are discovered and corrected during software debugging. However, it is usually necessary to eliminate obvious hardware faults first, and then combine with software debugging to further eliminate the faults. It can be seen that hardware debugging is the foundation. If the hardware debugging fails, software design cannot be started. This article discusses the skills of hardware debugging based on the author's experience in the process of single-chip microcomputer development.

When the hardware design is completed from wiring to welding and installation, it enters the hardware debugging stage. The debugging is generally divided into the following steps.

1 Hardware static debugging

1.1 Eliminate logical failures

This type of failure is often caused by process errors during the design and processing of the board. It mainly includes wrong wiring, open circuit, and short circuit. The method to eliminate it is to first carefully compare the processed printed circuit board with the schematic diagram to see if the two are consistent. Special attention should be paid to the power system inspection to prevent power short circuit and polarity errors, and focus on checking whether the system bus (address bus, data bus and control bus) is short-circuited with each other or with other signal lines. If necessary, use the short-circuit test function of the digital multimeter to shorten the troubleshooting time.

1.2 Eliminate component failure

There are two reasons for this type of error: one is that the components are broken when they are purchased; the other is that the components are burned out due to installation errors. You can check whether the components are consistent with the model, specifications and installation requirements of the design. After ensuring that the installation is correct, use the replacement method to eliminate the error.

1.3 Eliminate power failure

Before powering on, be sure to check the amplitude and polarity of the power supply voltage, otherwise it is easy to damage the integrated circuit. After powering on, check the potential of the pins on each plug-in. Generally, check the potential between VCC and GND first. If it is between 5V and 4.8V, it is normal. If there is high voltage, the emulator will be damaged during online emulator debugging, and sometimes the integrated circuit in the application system will be heated and damaged.

2 Online simulation debugging

Online simulation must be done with the help of simulation development devices, oscilloscopes, multimeters and other tools. These tools are the most basic tools for single-chip microcomputer development.

The signal line is the link between 8031 ​​and external devices. If the signal line is connected incorrectly or the timing is incorrect, it will cause read and write errors in the peripheral circuit. The signal lines of the 51 series microcontrollers are generally divided into several categories, such as read and write signal lines, chip select signal lines, clock signal lines, external program memory read select signal (PSEN), address latch signal (ALE), reset signal, etc. Most of these signals are pulse signals. It is difficult to observe pulse signals with the help of an oscilloscope (here refers to a general oscilloscope) using conventional methods, and certain measures must be taken to observe them. This should be achieved using software programming methods. For example, for the chip select signal, running the following small program can detect whether the decoded chip select signal is normal.

MAIN:MOVDPTR,#DPTR

; Send the address to DPTR

MOVXA,@DPTR

; Send the contents of RAM outside the decoded address to ACC

NOP; appropriate delay

SJMPMAIN; loop

After executing the program, you can use an oscilloscope to observe the chip select signal pin of the chip (use an oscilloscope scanning time of 1μs/each grid). At this time, you should see a negative pulse waveform with a period of several microseconds. If you cannot see it, it means that there is an error in the decoding signal.

It is easier to observe level signals. For example, you can directly use an oscilloscope to observe the reset signal. When the reset button is pressed, you can see that the reset pin of 8031 ​​will become high level; once it is released, the level will become low.

In a word, for pulse trigger signals, we need to use software to cooperate, and compile the program into an infinite loop, and then observe it with an oscilloscope; for level trigger signals, you can directly observe it with an oscilloscope.

The following is an explanation of the debugging process of the keyboard and display part in the automatic batching control system. The keyboard and display parts in this system are expanded from the parallel port chip 8155. 8155 is a programmable device, so it is difficult to divide hardware and software. Often during debugging, even if the circuit is installed correctly, there is no certain instruction to direct it to work, and it is impossible to find hardware failures. Therefore, some simple debugging programs should be used to determine whether the hardware is assembled correctly and whether the functions are complete. In this system, the display is debugged first, and then the keyboard is debugged.

(1) Debugging of the display part In order to make the debugging go smoothly, first separate the 8155 from the LED display, so that the LED display can be tested first with a static method, and the specified level is added to the pins that control the digital tube segment and the bit display to see if the digital tube display is consistent with the theory. Inconsistency is generally caused by poor contact of the LED display. The fault must be found and eliminated before testing whether the 8155 circuit works normally. When programming and debugging the 8155, there are two steps: first, after initializing it (that is, writing the command control word, it is best to define it as output mode), send #0FFH to the three ports PA, PB, and PC respectively. At this time, you can use a multimeter to test the bit voltage of each port to be about 3.8 V. If #00H is sent, the bit voltage of each port should be 0.03 V; second, combine the 8155 with the LED, and debug it by compiling a program (preferably using an "8" word loop program) with the help of a development machine. If the debugging passes, you can compile an application program.

(2) Keyboard debugging Generally, after the display debugging is passed, keyboard debugging is relatively simple, and you can use the display to debug the program. Use the development device to set breakpoints for the program. Through the breakpoints, you can check the changes in the key values ​​before and after the breakpoints, so that you can know whether the keyboard is working normally.

The above discusses methods of debugging MCU hardware with the help of simple tools. If these methods are used well, the development cycle of MCU can be greatly shortened.

Baidu Button BEGIN
Keywords:MCU Reference address:Hardware debugging steps in the MCU development process

Previous article:MCU program running encryption
Next article:Single chip multi-channel data acquisition assembly source program

Recommended ReadingLatest update time:2024-11-16 10:50

New Energy Vehicle Motor Controller (MCU)
The motor controller, as one of the core components of electric vehicles, is a decisive factor in the vehicle's power performance. It obtains the vehicle's requirements from the vehicle controller, obtains power from the power battery pack, and obtains the current and voltage required to control the motor thro
[Embedded]
STM32F10x MCU Flash write operation causes interrupt unresponsiveness
I encountered a problem yesterday. When writing data to the Flash of the STM32F103 microcontroller, the serial port interrupt reception data was lost. However, I set the serial port reception interrupt priority to the highest, and there was no global interrupt turned off for a long time (except when some kernel codes
[Microcontroller]
51 MCU: Application of timer and interrupt system
#include "regx52.h" void Delay(int time) {     while(time--) //while loop takes 10us     {     } }  void Timer0Init(void) //1 millisecond @ 11.0592MHz {     TMOD &= 0xF0; //Set timer mode     TMOD |= 0x01; //Set timer mode     TL0 = 0x66; //Set the initial timing value     TH0 = 0xFC; //Set the initial timing v
[Microcontroller]
51 MCU: Application of timer and interrupt system
Implementation of Simple Timer with 51 Single Chip Microcomputer
Preface I was bored and didn't want to review even though the final exam was approaching. Suddenly a friend asked me this Use a single-chip microcomputer to control two LED digits, using static link, requiring the two digital tubes to display 00~99 counts, with an interval of 1s (interrupt mode). Design the circuit
[Microcontroller]
Implementation of Simple Timer with 51 Single Chip Microcomputer
51 MCU-Delay 1 second
1. Accurate delay Having learned the software debugging teaching in the previous lecture, we can now use software to debug the code with a delay close to 1 millisecond: for(j=115;j 0;j--); If you want to delay for 1 second, should you loop this statement 1000 times? for(i=0;i 1000;i++) {     for(j=115;j 0;j--); }
[Microcontroller]
51 MCU-Delay 1 second
Talk about the RETI instruction of 51 single chip microcomputer
  Recently, a very strange problem occurred in the process of programming based on 51 single-chip microcomputer : "During program execution, under the conditions of register EA=1, ET0=1, TR0=1, but no interrupt was executed when TF0=1".   Anyone who has experience in single-chip interrupt programming knows that when E
[Microcontroller]
Design of Sunplus MCU Thermometer
Common glass tube thermometers rely on the rise and fall of mercury in the tube to determine the temperature. When the light is dim, the position of mercury cannot be seen clearly, which brings inconvenience to observation. Here we introduce a thermistor thermometer that uses a thermistor to measure temperature and re
[Microcontroller]
Design of Sunplus MCU Thermometer
Waveform generator & DA conversion based on 51 single chip microcomputer (dac0832)
code show as below: #include"reg51.h" #define uchar unsigned char sbit ksaw=P2^0; //Sawtooth wave button. sbit ktran=P2^1; //Triangle wave button. sbit ksquare=P2^2; //Square wave button. sbit ksin=P2^3; //Sine wave button. uchar key1; uchar keya; uchar keyb; uchar keyc; uchar keyd;void delay( ); uchar cod
[Microcontroller]
Waveform generator & DA conversion based on 51 single chip microcomputer (dac0832)
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号