A single chip microcomputer port testing method

By using the combination of the main control chip and diode in the microcontroller port test method, the on-voltage drop of the microcontroller port is quickly measured, which solves the problem of low testing efficiency in the existing technology, and achieves fast and accurate microcontroller port testing.

CN115453947BActive Publication Date: 2025-02-25SHENZHEN JINGZHE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211195436.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2025-02-25
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

The existing microcontroller port testing methods are relatively inefficient, and it takes about 2 minutes to test a 20-pin chip on average.

Method used

Using a microcontroller port testing method, through the combination of the main control chips MCU1, MCU2, MCU3, MCU4, diodes D1, D2 and resistor R8, the forward conduction voltage drop of the diode is quickly measured using the AD sampling function, and with the preset data range Compare, output normal or wrong results.

Benefits of technology

It realizes the rapid measurement of the forward conduction voltage drop of diodes to the power supply and ground of each port of the microcontroller, improving the testing efficiency of the microcontroller port and shortening the test time to 5 seconds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115453947B_ABST
    Figure CN115453947B_ABST
Patent Text Reader

Abstract

This invention discloses a method for testing microcontroller ports, comprising: obtaining the forward voltage drop of diode D1; obtaining the forward voltage drop of diode D2; comparing the measurement results of the forward voltage drops of diodes D1 and D2 with a preset data range; if the measurement results are within the preset data range, outputting a normal result; if the measurement results are outside the preset data range, outputting an error result. This invention enables rapid measurement of the forward voltage drops of diodes at various ports of a microcontroller to power and ground, improving the efficiency of microcontroller port testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of single-chip microcomputer testing, and in particular to a universal single-chip microcomputer port testing method. Background Art

[0002] At present, the fields of using single-chip microcomputers are becoming more and more extensive, and the corresponding situations that require the use of single-chip microcomputer failure analysis are increasing. In the single-chip microcomputer failure analysis, port failure is the most likely situation. The current method to determine whether the single-chip microcomputer port is damaged is to use the diode range of the multimeter to test the diode forward conduction voltage drop of each port of the single-chip microcomputer to the power supply and ground one by one, and record it. After the test is completed, it is compared with the data of the normal chip. This method has low testing efficiency. It takes about 2 minutes on average to test a 20-pin chip. Summary of the invention

[0003] The main purpose of the present invention is to provide a single-chip microcomputer port testing method, aiming to improve the single-chip microcomputer port testing efficiency.

[0004] To achieve the above-mentioned purpose, the present invention provides a single-chip microcomputer port testing method, which is applied to a single-chip microcomputer port tester. The single-chip microcomputer includes a diode D1, a diode D2, a main control chip MCU1, a main control chip MCU2, a main control chip MCU3, a main control chip MCU4 and a resistor R8. The cathode of the diode D1 is connected to VCC and one end of the main control chip MCU1, the anode of the diode D2 is grounded and one end of the main control chip MCU4, the anode of the diode D1 and the cathode of the diode D2 are respectively connected to one end of the resistor R8 through the main control chip MCU2, and the other end of the resistor R8 is connected to the main control chip MCU3. The single-chip microcomputer port testing method comprises the following steps:

[0005] Step S10, the main control chip MCU1 outputs a low level, the main control chip MCU2 outputs a high level, the main control chip MCU4 is set as an input, and after waiting for the signal to be stable for a first preset time, the AD sampling function of the main control chip MCU2 is turned on to obtain the forward conduction voltage drop of the diode D1;

[0006] Step S20, the main control chip MCU4 outputs a high level, the main control chip MCU3 outputs a low level, the main control chip MCU1 is set as input, and after the signal is stable for a second preset time, the AD sampling function of the main control chip MCU2 is turned on, and the forward conduction voltage drop of the diode D2 is obtained according to the sampling result;

[0007] Step S30, comparing the measurement results of the forward conduction voltage drops of the diode D1 and the diode D2 with a preset data range;

[0008] Step S40, if the measurement results of the forward conduction voltage drops of the diode D1 and the diode D2 are within the preset data range, outputting a normal result;

[0009] Step S50: if the measurement results of the forward conduction voltage drops of the diodes D1 and D2 are not within the preset data range, an error result is output.

[0010] A further technical solution of the present invention is that the first preset time length in step S10 is 10 ms, and the second preset time length in step S20 is 10 ms.

[0011] A further technical solution of the present invention is that before step S10, the following steps are included:

[0012] The external 12V electricity is converted into 5V electricity to power the single chip microcomputer.

[0013] A further technical solution of the present invention is that in the step S20, the AD sampling function of the main control chip MCU2 is turned on, and the step of obtaining the forward conduction voltage drop of the diode D1 includes:

[0014] The forward conduction voltage drop of the diode D1 is obtained by subtracting the AD sampling result of the main control chip MCU2 from 5V.

[0015] A further technical solution of the present invention is that the single-chip microcomputer port tester includes a display module for displaying the model of the single-chip microcomputer currently being tested and the test result.

[0016] A further technical solution of the present invention is that the single-chip microcomputer port tester also includes a locking module for fixing the single-chip microcomputer.

[0017] A further technical solution of the present invention is that the single-chip microcomputer port tester also includes a key module for switching and starting the test.

[0018] A further technical solution of the present invention is that the single chip microcomputer further comprises an LDO module for converting a 12V voltage of an external adapter into a 5V voltage to supply power to the single chip microcomputer.

[0019] The beneficial effect of the single-chip microcomputer port testing method of the present invention is as follows: through the above technical scheme, the present invention sets the main control chip MCU1 to output a low level, sets the main control chip MCU2 to output a high level, sets the main control chip MCU4 to input, waits for the signal of the first preset time length to be stable, turns on the AD sampling function of the main control chip MCU2, and obtains the forward conduction voltage drop of the diode D1; sets the main control chip MCU4 to output a high level, sets the main control chip MCU3 to output a low level, sets the main control chip MCU1 to input, waits for the signal of the second preset time length to be stable, and turns on the main control chip MCU 2, and obtain the forward conduction voltage drop of the diode D2 according to the sampling result; compare the measurement results of the forward conduction voltage drops of the diodes D1 and D2 with the preset data range; if the measurement results of the forward conduction voltage drops of the diodes D1 and D2 are within the preset data range, output a normal result; if the measurement results of the forward conduction voltage drops of the diodes D1 and D2 are not within the preset data range, output an error result, thereby realizing the rapid measurement of the forward conduction voltage drops of the diodes of each port of the single-chip microcomputer to the power supply and the ground, and improving the single-chip microcomputer port test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0021] Figure 1 It is a schematic diagram of the circuit structure of the display module in the single-chip microcomputer port tester;

[0022] Figure 2 It is a schematic diagram of the structure of the locking module in the single-chip microcomputer port tester;

[0023] Figure 3 It is a structural diagram of the key module in the single-chip microcomputer port tester;

[0024] Figure 4 It is a schematic diagram of the structure of the LDO module in the microcontroller port tester;

[0025] Figure 5 It is a structural diagram of the main control module in the single-chip microcomputer port tester;

[0026] Figure 6 It is a structural diagram of the IO port of the microcontroller;

[0027] Figure 7 It is a flow chart of a preferred embodiment of the single chip microcomputer port testing method of the present invention;

[0028] Figure 8 It is a schematic diagram of the principle of the testing method for a single port of a microcontroller.

[0029] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] Please refer to Figures 1 to 8 The present invention proposes a single-chip microcomputer port testing method, which can quickly measure the diode forward conduction voltage drop of each port of the single-chip microcomputer to the power supply and the ground, and mark which ports are abnormal. The whole process takes only 5 seconds, and a rapid analysis is achieved. The single-chip microcomputer port testing method is applied to a single-chip microcomputer port tester.

[0032] In this embodiment, the single-chip microcomputer port tester includes a display module, a locking module, a button module and an LDO module.

[0033] Wherein, the circuit structure of the display module is as follows Figure 1 As shown, the display module is used to display the model of the currently tested single-chip microcomputer and the test results.

[0034] The structure of the locking module is as follows Figure 2 As shown, the locking module is used to fix the single-chip microcomputer and measure, and connect the single-chip microcomputer to be tested and the circuit board.

[0035] The structure of the key module is as follows Figure 3 As shown, the button module is used to switch and start the test.

[0036] The structure of the LDO module is as follows Figure 4 As shown, the LDO module is used to convert the 12V voltage of the external adapter into a 5V voltage to power the single-chip microcomputer.

[0037] In this embodiment, the single chip microcomputer includes a diode D1, a diode D2, a main control chip MCU1, a main control chip MCU2, a main control chip MCU3, a main control chip MCU4 and a resistor R8. The cathode of the diode D1 is connected to VCC and one end of the main control chip MCU1, the anode of the diode D2 is grounded and one end of the main control chip MCU4, the anode of the diode D1 and the cathode of the diode D2 are respectively connected to one end of the resistor R8 through the main control chip MCU2, and the other end of the resistor R8 is connected to the main control chip MCU3.

[0038] like Figure 5 As shown, the single-chip microcomputer port tester also includes a main control module, and pins 8, 9, 10, and 11 of the main control module are respectively connected to the other ends of the main control chips MCU1, MCU2, MCU3, and MCU4. The VDD and GND pins of the single-chip microcomputer are pre-set in the corresponding main control chip.

[0039] It should be noted that all IO ports of the microcontroller have Figure 6 The structure shown in the figure has a diode D1 to VDD and a diode D2 to GND to prevent the voltage of the microcontroller port from exceeding the voltage of the VDD pin and being lower than the voltage of the GND pin, thereby damaging the microcontroller pin and improving the microcontroller's anti-interference ability against static electricity and abnormal voltage. The two diodes allow a small current to pass through. Once high voltage or high current occurs, the diodes will burn out. After the diodes burn out, the ports will also burn out. In other words, the damage of these two diodes means that the microcontroller port is damaged.

[0040] Please refer to Figure 7 As shown, a preferred embodiment of the single chip microcomputer port testing method of the present invention includes the following steps:

[0041] Step S10, the main control chip MCU1 outputs a low level, the main control chip MCU2 outputs a high level, the main control chip MCU4 is set as an input, and after waiting for the signal to be stable for a first preset time, the AD sampling function of the main control chip MCU2 is turned on to obtain the forward conduction voltage drop of the diode D1;

[0042] Step S20, the main control chip MCU4 outputs a high level, the main control chip MCU3 outputs a low level, the main control chip MCU1 is set as input, and after the signal is stable for a second preset time, the AD sampling function of the main control chip MCU2 is turned on, and the forward conduction voltage drop of the diode D2 is obtained according to the sampling result;

[0043] Step S30, comparing the measurement results of the forward conduction voltage drops of the diode D1 and the diode D2 with a preset data range;

[0044] Step S40, if the measurement results of the forward conduction voltage drops of the diode D1 and the diode D2 are within the preset data range, outputting a normal result;

[0045] Step S50: if the measurement results of the forward conduction voltage drops of the diodes D1 and D2 are not within the preset data range, an error result is output.

[0046] The first preset time length in step S10 is 10 ms, and the second preset time length in step S20 is 10 ms.

[0047] In this embodiment, the step before step S10 includes:

[0048] The external 12V electricity is converted into 5V electricity to power the single chip microcomputer.

[0049] In the step S20, the AD sampling function of the main control chip MCU2 is turned on to obtain the forward conduction voltage drop of the diode D1, including:

[0050] The forward conduction voltage drop of the diode D1 is obtained by subtracting the AD sampling result of the main control chip MCU2 from 5V.

[0051] In this embodiment, MCU1, MCU2, MCU3, and MCU4 are all ports of the main control chip, wherein the main control chip MCU2 has an AD sampling function.

[0052] The following combination Figure 8 The working principle of the single chip microcomputer port testing method of the present invention is further explained.

[0053] Step 1 (first test the forward conduction voltage drop of D1):

[0054] MCU1 outputs a low level, MCU3 outputs a high level (5V), and MCU4 is set as input; wait for 10mS for the signal to stabilize, turn on the AD sampling function of MCU2, and the obtained AD voltage is the forward conduction voltage drop of diode D1.

[0055] Step 2 (First test the forward conduction voltage drop of D2)

[0056] MCU4 outputs a high level (5V), MCU3 outputs a low level, and MCU1 is set to input; wait for 10mS for the signal to stabilize, turn on the AD sampling function of MCU2, and the result of subtracting the AD voltage from 5V is the forward conduction voltage drop of diode D2.

[0057] Step 3 (Compare the results)

[0058] Compare the measurement results of the forward conduction voltage drop of diodes D1 and D2 with the data stored inside the main control chip. If they are within a reasonable range, the indicator light outputs a normal result (the indicator light corresponding to the port is always on). If the data is not within a reasonable range, the indicator light outputs an incorrect result (the indicator light corresponding to the port flashes quickly).

[0059] To measure all ports of the entire microcontroller, the above process is repeated.

[0060] The complete operation process of the single chip microcomputer port testing method of the present invention is as follows:

[0061] 1. Supply 12V power to the microcontroller port tester;

[0062] 2. Use the button to select the MCU model and pin position to be tested, and the indicator light will indicate the MCU model and pin position. After selecting, press the button to enter the test mode;

[0063] 3. Place the chip to be tested on the lock and fix it;

[0064] 4. Press the test button, and the MCU port tester starts testing according to the above method;

[0065] 5. After the test is completed, the indicator light will display the test result.

[0066] The beneficial effect of the single-chip microcomputer port testing method of the present invention is as follows: through the above technical scheme, the present invention sets the main control chip MCU1 to output a low level, sets the main control chip MCU2 to output a high level, sets the main control chip MCU4 to input, waits for the signal of the first preset time length to be stable, turns on the AD sampling function of the main control chip MCU2, and obtains the forward conduction voltage drop of the diode D1; sets the main control chip MCU4 to output a high level, sets the main control chip MCU3 to output a low level, sets the main control chip MCU1 to input, waits for the signal of the second preset time length to be stable, and turns on the main control chip MCU 2, and obtain the forward conduction voltage drop of the diode D2 according to the sampling result; compare the measurement results of the forward conduction voltage drops of the diodes D1 and D2 with the preset data range; if the measurement results of the forward conduction voltage drops of the diodes D1 and D2 are within the preset data range, output a normal result; if the measurement results of the forward conduction voltage drops of the diodes D1 and D2 are not within the preset data range, output an error result, thereby realizing the rapid measurement of the forward conduction voltage drops of the diodes of each port of the single-chip microcomputer to the power supply and the ground, and improving the single-chip microcomputer port test efficiency.

[0067] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.

Claims

1. A single chip microcomputer port testing method, characterized in that: The single-chip microcomputer port testing method is applied to a single-chip microcomputer port tester, wherein the single-chip microcomputer includes a diode D1, a diode D2, a main control chip MCU1, a main control chip MCU2, a main control chip MCU3, a main control chip MCU4 and a resistor R8, wherein the cathode of the diode D1 is connected to VCC and one end of the main control chip MCU1, the anode of the diode D2 is connected to the ground and one end of the main control chip MCU4, the anode of the diode D1 and the cathode of the diode D2 are respectively connected to one end of the resistor R8 through the main control chip MCU2, and the other end of the resistor R8 is connected to the main control chip MCU3, and the single-chip microcomputer port testing method includes the following steps: Step S10, the main control chip MCU1 outputs a low level, the main control chip MCU2 outputs a high level, the main control chip MCU4 is set as an input, and after waiting for the signal to be stable for a first preset time, the AD sampling function of the main control chip MCU2 is turned on to obtain the forward conduction voltage drop of the diode D1; Step S20, the main control chip MCU4 outputs a high level, the main control chip MCU3 outputs a low level, the main control chip MCU1 is set as input, and after the signal is stable for a second preset time, the AD sampling function of the main control chip MCU2 is turned on, and the forward conduction voltage drop of the diode D2 is obtained according to the sampling result; Step S30, comparing the measurement results of the forward conduction voltage drops of the diode D1 and the diode D2 with a preset data range; Step S40, if the measurement results of the forward conduction voltage drops of the diode D1 and the diode D2 are within the preset data range, outputting a normal result; Step S50: if the measurement results of the forward conduction voltage drops of the diodes D1 and D2 are not within the preset data range, an error result is output.

2. The single chip microcomputer port testing method according to claim 1, characterized in that: The first preset time length in step S10 is 10 ms, and the second preset time length in step S20 is 10 ms.

3. The single chip microcomputer port testing method according to claim 1, characterized in that: The step S10 includes: The external 12V electricity is converted into 5V electricity to power the single chip microcomputer.

4. The single chip microcomputer port testing method according to claim 3, characterized in that: In the step S20, the AD sampling function of the main control chip MCU2 is turned on to obtain the forward conduction voltage drop of the diode D1, including: The forward conduction voltage drop of the diode D1 is obtained by subtracting the AD sampling result of the main control chip MCU2 from 5V.

5. The single chip microcomputer port testing method according to claim 1, characterized in that: The single-chip microcomputer port tester comprises a display module for displaying the model of the single-chip microcomputer currently being tested and the test result.

6. The single chip microcomputer port testing method according to claim 5, characterized in that: The single-chip microcomputer port tester also includes a locking module for fixing the single-chip microcomputer.

7. The single chip microcomputer port testing method according to claim 6, characterized in that: The single-chip microcomputer port tester also includes a key module for switching and starting the test.

8. The single chip microcomputer port testing method according to claim 7, characterized in that: The single chip microcomputer also includes an LDO module for converting a 12V voltage of an external adapter into a 5V voltage to power the single chip microcomputer.

Citation Information

Patent Citations

  • Switching power circuit and control method

    CN102594124A

  • Port detection system and vehicle possessing same

    CN105093048A