Hardware debugging skills in the development process of single chip microcomputer

In the development process of the MCU, the hardware design to the software design is almost completely developed by the developer for the characteristics of the system. Although this can reduce the system cost and improve the adaptability of the system, 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 MCU system cannot be separated. Many hardware errors are found and corrected in software debugging. However, it is usually after the obvious hardware failure is eliminated, and then combined with the software to debug to further troubleshoot. It can be seen that the debugging of the hardware is the foundation. If the hardware debugging does not pass, the software design is impossible. This article combines the author's experience in the development of the microcontroller, discusses the skills of hardware debugging.

When the hardware design is completed from wiring to soldering, it begins to enter the hardware debugging phase. The debugging is roughly divided into the following steps.

1 hardware static debugging

1.1 Troubleshooting logic

Such failures are often caused by technical errors in the design and processing of the board. Mainly including wrong lines, open circuits, short circuits. The method of elimination is to first carefully compare the processed printed board with the schematic to see if the two are consistent. Special attention should be paid to the power system check to prevent short-circuit and polarity errors, and to check whether the system bus (address bus, data bus, and control bus) are shorted to each other or to other signal lines. If necessary, use the short-circuit test function of the digital multimeter to shorten the troubleshooting time.

1.2 Exclusion of component failure

There are two reasons for this type of error: one is that the component is broken when it is bought; the other is caused by the installation error, causing the device to burn out. It is possible to check whether the components, design specifications, and installation requirements are the same. After ensuring that the installation is correct, use the replacement method to eliminate the error.

1.3 Troubleshooting Power Failures

Before powering on, be sure to check the magnitude and polarity of the power supply voltage, otherwise it will easily cause damage to the integrated block. Check the potential of the pins on each plug-in after power-on. 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 damage the emulator when it is debugged, and sometimes the integrated block in the application system will be damaged by heat.

2 online simulation debugging

Online simulation must rely on tools such as simulation development devices, oscilloscopes, and multimeters. These tools are the most basic tools for microcontroller development.

The signal line is the link between the 8031 ​​and the external device. If the signal line is connected incorrectly or the timing is incorrect, it will cause reading and writing errors to the peripheral circuit. The signal lines of the 51 series MCUs are roughly divided into read and write signal lines, chip select signal lines, clock signal lines, external program memory read strobe signals (PSEN), address latch signals (ALE), reset signals, etc. class. Most of these signals belong to pulse signals. For pulse signals, it is difficult to observe by conventional methods using an oscilloscope (here, a general-purpose oscilloscope), and certain measures must be taken to observe them. It should be implemented using software programming methods. For example, for the chip select signal, run the following small program to detect whether the decoded chip select signal is normal.

MAIN: MOVDPTR, #DPTR

; send the address to DPTR

MOVXA, @DPTR

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

NOP; appropriate delay

SJMPMAIN; loop

After executing the program, you can use the oscilloscope to observe the chip select signal pin of the chip (scanning time is 1μs/grid with oscilloscope). At this time, you should see the negative pulse waveform with a period of several microseconds. If you can't see it, you can translate it. The code signal has an error.

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

In summary, for the pulse-triggered signal we need to use software to cooperate, and the program should be programmed into an infinite loop, and then use the oscilloscope to observe; for the level-like trigger signal, you can directly observe with the oscilloscope.

The following is described in conjunction with the debugging process of the keyboard and display portion in the automatic batching control system. The keyboard and display part of the system are all expanded by the parallel port chip 8155. The 8155 is a programmable device, so it is difficult to divide hardware and software. In the debugging, even if the circuit is installed correctly and there is no certain instruction to direct it to work, it is impossible to find the hardware failure. So use some simple debugger to determine if the hardware is assembled correctly and the functionality is complete. In this system, the display is debugged first, and then the keyboard is debugged.

(1) Partial debugging of the display In order to make the debugging smooth, firstly separate the 8155 from the LED display, so that the LED display can be tested first by static method, and the specified level is added to the pin for controlling the digital pipe segment and the bit display. Whether the digital tube display is theoretically consistent. Inconsistent, generally caused by poor contact of the LED display, must find out the fault, and then check whether the 8155 circuit works normally. When the 8155 should be programmed and debugged, it is divided into two steps: First, it is initialized (that is, the command control word is written, preferably defined as the output mode), and then sent to the three ports of PA, PB, and PC respectively. #0FFH, at this time, you can use a multimeter to test the bit voltage of each port is about 3.8 V. If you feed #00H, then the bit voltage of each port should be 0.03 V. Second, combine the 8155 with the LED, with the help of the development machine. , through the programming process (preferably using the "8" word loop program) for debugging. Once the debugging is passed, the application can be compiled.

(2) Keyboard debugging After the general display debugging, the keyboard debugging is relatively simple, and the program can be debugged by means of the display. Use the development device to set a breakpoint for the program, and use the breakpoint to check the key value change of the program before and after the breakpoint, so that the keyboard works normally.

The above discusses the method of debugging the hardware of the microcontroller with simple tools. If these methods are used well,

Can greatly shorten the development cycle of the microcontroller.

XB2-B Series Pushbutton Switch are using controlling circuit of AC voltage up to 660V/AC 50Hz.and DC voltage below 400V.It is used for controlling signal and interlocking purposes.The main body of the push buttons adopts Circuit head,with chromium plated metal bezel,Complete units with screw and captive cable clamp connections.The contact adopts special silver alloy in order to enjoy the benefit of high anti-electrical erosion.The signal lamp series are suitable for electrical applicances circuit of AC voltage up to 380V/50Hz,and DC voltage below 380V.It is ideal for using as indicating signals,warning signals,emergency signals.

XB2 series Pushbutton Switch

XB2-B Series Pushbutton Switch

Push Button On Off Switch,Waterproof Push Button Switch,Micro Push Button On Off Switch,Green Push Button Switch

Ningbo Bond Industrial Electric Co., Ltd. , https://www.bondelectro.com

Posted on