A single chip microcomputer testing device and method
By using locking seats, power modules and multi-function testing circuits in the microcontroller test device, combined with the flexible connection of DuPont wire, the problem of low testing flexibility of existing test devices is solved, and flexibility for different models and number of microcontrollers is achieved. Testing improves testing efficiency.
Patent Information
- Application Number
- CN202110611703.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-02
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-06-02
AI Technical Summary
The existing microcontroller testing devices have low testing flexibility, making it difficult to adapt to the testing needs of microcontrollers of different models and digits, and take a lot of time.
A single-chip microcontroller testing device including a locking seat, a power module and a test circuit is designed. The DC voltage is selected by switching switches, and the DuPont wire is used to connect the pins of the microcontroller with some circuits in the test circuit according to the test requirements to achieve flexible Electrical connection. The test circuit includes a variety of functional circuits, which can perform microcontroller performance detection according to different test requirements.
It improves testing flexibility and can flexibly test microcontrollers of different models and digits, reduces testing time and enhances testing flexibility and adaptability.
Smart Images

Figure CN113189972B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of single-chip microcomputer testing, and in particular to a single-chip microcomputer testing device and method. Background Art
[0002] A single-chip microcomputer is an integrated circuit chip that uses ultra-large-scale integrated circuit technology to integrate multiple functional circuits such as a central processing unit CPU with data processing capabilities, random access memory RAM, read-only memory ROM, multiple I / O ports, interrupt system, timer, counter, display driver circuit, pulse width modulation circuit, digital-to-analog conversion circuit, etc. on a silicon chip to form a small and complete microcomputer system. It is widely used in the field of industrial control. At present, single-chip microcomputers can be divided into 8-bit, 16-bit and 32-bit. After the single-chip microcomputer is produced, a specific test device is required to test single-chip microcomputers of different bits and models. The test flexibility is relatively low and it takes a lot of time. Summary of the invention
[0003] In view of the shortcomings of the background technology, the present invention provides a single-chip microcomputer testing device and method, and the technical problem to be solved is that the existing single-chip microcomputer testing device has low testing flexibility during testing.
[0004] To solve the above technical problems, the present invention provides the following technical solutions: a single-chip microcomputer testing device, comprising a locking seat, on which a wiring terminal is provided. When the single-chip microcomputer is placed on the locking seat, a pin of the single-chip microcomputer is electrically connected to a wiring terminal; and also comprising a power supply module and a test circuit. The power supply module supplies power to the single-chip microcomputer and the test circuit respectively, and the single-chip microcomputer is electrically connected to the test circuit through a wire.
[0005] As a further technical solution, the power supply module outputs two DC voltages respectively, and the power supply module supplies power to the microcontroller and the test circuit through a switching switch, and the switching switch is used to select one DC voltage to be input to the microcontroller and the test circuit.
[0006] Furthermore, the amplitudes of the two DC voltages are 5V and 3V respectively.
[0007] As a further technical solution, the test circuit includes a common anode light emitting diode circuit, a common cathode light emitting diode circuit, an LCD1602 liquid crystal circuit, an LCD12864 liquid crystal circuit, a buzzer circuit, a stepper motor drive circuit, a matrix keyboard circuit, a low level trigger key group circuit, a high level trigger key group circuit, a 138 decoder circuit, an external E2PROM circuit, an infrared receiving circuit, a 2.4G wireless transceiver circuit, an LED dot matrix circuit, a temperature sensor circuit, a common anode digital tube circuit, a common cathode digital tube circuit, a voltage detection circuit and a current detection circuit; the single chip microcomputer is electrically connected to one or more circuits in the test circuit through a wire.
[0008] In actual use, the single-chip microcomputer is placed on the locking seat, and the pins of the single-chip microcomputer can be electrically connected to part of the circuit in the test circuit using DuPont wires according to the test requirements, without designing a specific test device. For example, when the test circuit includes all the above circuits, if you want to test whether the driving ability of the single-chip microcomputer meets the requirements, you only need to use DuPont wires to electrically connect the IO pins of the single-chip microcomputer with the common anode light-emitting diode circuit and the LCD1602 liquid crystal circuit. The entire test is highly flexible, and the single-chip microcomputer and the test circuit can be wired according to different test requirements.
[0009] A single-chip microcomputer testing method uses the above-mentioned single-chip microcomputer testing device, including the following steps: S1: placing the single-chip microcomputer on a locking seat, and using a wire to electrically connect the test pin of the single-chip microcomputer with a test circuit according to the test requirements; S2: writing a test program to the single-chip microcomputer; S3: observing whether the test circuit responds to the single-chip microcomputer when the single-chip microcomputer is running.
[0010] As a further technical solution, in step S2, multiple test programs are written into the single-chip microcomputer in sequence to implement different performance tests of the single-chip microcomputer.
[0011] Compared with the prior art, the beneficial effect of the present invention is that the test circuit of the present invention is not electrically connected to the pins of the single-chip microcomputer or the wiring terminals electrically connected to the pins of the single-chip microcomputer in advance according to a fixed connection line, but is separately arranged with the single-chip microcomputer. When actually testing, the test pins of the single-chip microcomputer can be electrically connected to part of the circuit in the test circuit using DuPont wires according to test requirements for testing. It has high flexibility and can test single-chip microcomputers of different models and different bit numbers. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The present invention has the following accompanying drawings:
[0013] Figure 1 It is a structural schematic diagram of the single chip microcomputer testing device of the present invention;
[0014] Figure 2is a circuit diagram of a DC power supply circuit of the present invention;
[0015] Figure 3 A circuit diagram of a USB power supply circuit of the present invention;
[0016] Figure 4 A circuit diagram of the LCD12864 liquid crystal circuit of the present invention;
[0017] Figure 5 It is a circuit diagram of the LCD1602 liquid crystal circuit of the present invention;
[0018] Figure 6 A circuit diagram of the 138 decoder circuit of the present invention;
[0019] Figure 7 is a circuit diagram of a buzzer circuit of the present invention;
[0020] Figure 8 A circuit diagram of a thermistor and a photoresistor of the present invention;
[0021] Fig. 9 The common anode light emitting diode circuit and the common cathode light emitting diode circuit of the present invention;
[0022] Fig.10 A circuit diagram of an E2PROM circuit of the present invention;
[0023] Fig.11 A circuit diagram of a matrix keyboard circuit of the present invention;
[0024] Fig.12 is a circuit diagram of a stepping motor driving circuit of the present invention;
[0025] Fig.13 A circuit diagram of a high level trigger key group circuit of the present invention;
[0026] Fig.14 A circuit diagram of a common anode digital tube circuit of the present invention;
[0027] Fig.15 is a circuit diagram of a voltage detection circuit of the present invention;
[0028] Fig.16 is a circuit diagram of a current detection circuit of the present invention;
[0029] Fig.17 A circuit diagram of an LED dot matrix circuit of the present invention;
[0030] Fig.18 The circuit diagram of the 2.4G wireless transceiver circuit of the present invention is shown in FIG. DETAILED DESCRIPTION
[0031] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0032] A single-chip microcomputer testing device includes a locking seat 1, on which a wiring terminal is provided. When the single-chip microcomputer is placed on the locking seat 1, a pin of the single-chip microcomputer is electrically connected to a wiring terminal; it also includes a power module 2 and a test circuit 3. The power module 2 supplies power to the single-chip microcomputer and the test circuit 3 respectively. The single-chip microcomputer is electrically connected to the test circuit 3 through a wire.
[0033] Reference Figure 1 In this embodiment, the power module 1 outputs two DC voltages, the amplitudes of which are 5V and 3V respectively. The power module 1 supplies power to the single-chip microcomputer and the test circuit through the switch K1. The switch K1 is used to select a DC voltage input to the single-chip microcomputer and the test circuit, wherein the switch K1 can select a boat-type switch. Figure 1 The power module 1 in this embodiment includes a DC power supply circuit and a USB power supply circuit. The circuit diagrams of the DC power supply circuit and the USB power supply circuit are shown in FIG. Figure 2 and Figure 3 As shown, the DC power supply circuit and the USB power supply circuit can both output 5V DC voltage and 3V DC voltage, and the power supply can be flexibly selected through the DC power supply circuit and the USB power supply circuit.
[0034] Reference Figure 1 In this embodiment, the test circuit 3 includes a common anode light emitting diode circuit, a common cathode light emitting diode circuit, an LCD1602 liquid crystal circuit, an LCD12864 liquid crystal circuit, a buzzer circuit, a stepper motor drive circuit, a matrix keyboard circuit, a low level trigger key group circuit, a high level trigger key group circuit, a 138 decoder circuit, an E2PROM circuit, an infrared receiving circuit, a 2.4G wireless transceiver circuit, an LED dot matrix circuit, a temperature sensor circuit, a common anode digital tube circuit, a common cathode digital tube circuit, a voltage detection circuit and a current detection circuit, wherein the buzzer circuit can adopt a passive buzzer circuit, the voltage detection circuit can adopt a voltmeter, the current detection circuit can adopt an ammeter, the common anode digital tube circuit and the common cathode digital tube circuit can adopt a 7-segment 6-bit digital tube, and the LED dot matrix circuit can adopt an 8*8LED dot matrix; the single-chip microcomputer is electrically connected to one or more circuits in the test circuit through a wire.
[0035] In actual use, the test circuit 3 may include all the above circuits, and then several circuits can be selected from the above circuits according to the test requirements to test a certain performance of the single-chip microcomputer. For example, when testing the driving performance of the single-chip microcomputer, the DuPont line can be used to connect the IO pins of the single-chip microcomputer to the LED dot matrix circuit, the common anode digital tube circuit and the common cathode digital tube circuit in sequence, or when testing whether the iic communication protocol of the single-chip microcomputer is normal, the DuPont line can be used to electrically connect the communication pins of the single-chip microcomputer with the E2PROM circuit and the common anode light-emitting diode. When the single-chip microcomputer communicates successfully with the E2PROMiic, the common anode light-emitting diode can be made to light up as a prompt.
[0036] In actual use, the test circuit 3 can also select part of the above circuits according to the test requirements to complete one or more performance tests of the single chip microcomputer.
[0037] A single-chip microcomputer testing method uses the above-mentioned single-chip microcomputer testing device, including the following steps: S1: placing the single-chip microcomputer on a locking seat, and using a wire to electrically connect the test pin of the single-chip microcomputer with a test circuit according to the test requirements; S2: writing a test program to the single-chip microcomputer; S3: observing whether the test circuit responds to the single-chip microcomputer when the single-chip microcomputer is running.
[0038] When detecting the power supply voltage, the testing method of the present invention can use a DuPont line to connect the ground terminal of the power module to the ground terminal of the single-chip computer and the voltmeter respectively, and use a DuPont line to connect the positive terminal of the power module to the power terminal of the single-chip computer and the voltmeter respectively, and detect the power supply voltage of the power module through the voltmeter.
[0039] The testing method of the present invention is to connect the negative electrode of the adjustable voltage-stabilized power supply to the ground terminal of the single-chip computer when testing the port characteristic voltage flip point of the single-chip computer, connect the positive electrode of the adjustable voltage-stabilized power supply to the power terminal of the single-chip computer, connect the ammeter in series between the positive electrode of the adjustable voltage-stabilized power supply and the power terminal of the single-chip computer, and connect the test IO pin of the single-chip computer to the common cathode light-emitting diode circuit through the DuPont line. Fig. 9The left circuit in the figure is a common anode light emitting diode circuit, and the right circuit is a common cathode light emitting diode circuit. When the single-chip microcomputer is placed on the locking seat, write the test program into the single-chip microcomputer to make the test IO pin of the single-chip microcomputer output a high-level signal, and then adjust the output voltage of the adjustable voltage-stabilized power supply from 0V to 5V in sequence, increasing by 0.1V each time. When the common cathode light-emitting diode lights up, record the values of the voltmeter and ammeter at this time, then adjust the output voltage of the adjustable voltage-stabilized power supply from 5V to 0V, decreasing by 0.1V each time. When the common cathode light-emitting diode goes out, record the values of the voltmeter and ammeter at this time. Repeat the action for each IO port of the single-chip microcomputer more than three times to complete the port characteristic voltage reversal point test of the single-chip microcomputer. When the common cathode light-emitting diode changes from off to on or from on to off, the voltage value displayed by the voltmeter is the reversal voltage, and the value displayed by the ammeter is the power consumption current of the single-chip microcomputer. If the value of the ammeter is between 100uA-1mA, it is normal power consumption.
[0040] When testing the driving performance of a single-chip microcomputer, the method of the present invention first uses a DuPont line to sequentially connect a power module 1, an ammeter and a single-chip microcomputer in series, then uses the DuPont line to sequentially connect the port of the single-chip microcomputer to an LED dot matrix circuit, a common anode digital tube circuit and a common cathode digital tube circuit, and then inputs a test program into the single-chip microcomputer to sequentially light up LEDs in the LED array circuit, and to display the common anode digital tube circuit and the common cathode digital tube circuit from 000001 to 999999. When the single-chip microcomputer runs the test program, it is observed whether the brightness of the LED lamps in the LED array circuit, the digital tubes in the common anode digital tube circuit and the common cathode digital tube circuit are uniform, and it is observed whether the value tested by the ammeter is within a normal test range.
[0041] When testing the sleep current of the single-chip microcomputer, the test method of the present invention uses a DuPont line to connect an ammeter in series to the power module 1 to supply power to the single-chip microcomputer, and a voltmeter monitors the supply voltage of the power module. It is normal that the current in the conventional sleep mode is below 1uA, the power consumption in the watchdog wake-up sleep mode is below 6uA, and the power consumption in the RTC (TCC) sleep wake-up mode is below 25uA. A conventional sleep program, a watchdog wake-up sleep program, and an RTC (TCC) wake-up sleep program are written into the single-chip microcomputer respectively to test the sleep current of the single-chip microcomputer.
[0042] When testing the built-in pull-up of the port of the single-chip microcomputer, the test method of the present invention comprises the following steps: the power module 1 supplies power to the single-chip microcomputer via the DuPont line, the port of the single-chip microcomputer is connected to the low-level trigger button group circuit via the DuPont line, the voltmeter is connected in parallel to the GND port and the button port of the single-chip microcomputer, a low-level trigger button configuration program is written into the single-chip microcomputer, so that one bit of the IO port is set as input to open the pull-up, and the others are outputs, and so on until all the pull-up IO ports of the chip are tested, the voltmeter displays a high level when the button is not pressed, and the voltmeter displays a low level when the button is pressed, and the current value is observed by an ammeter connected in series with the pull-up port to the ground: 2V is below 15uA, 3V is below 40uA, 4V is below 75uA, 5V is below 120uA, and 6V is below 170uA, which is normal.
[0043] When testing the built-in pull-down of the port of the single-chip microcomputer, the method of the present invention supplies power to the single-chip microcomputer via the DuPont line, the port of the single-chip microcomputer is connected to the high-level trigger button group circuit via the DuPont line, the voltmeter is connected in parallel to the VCC port and the button port of the single-chip microcomputer, and the high-level trigger button configuration program is written into the single-chip microcomputer to set the input of one IO port to open the pull-down, and the others are outputs. This process is repeated in this way until all the pull-down IO ports of the chip are tested. When the button is not pressed, the voltmeter displays a low level, and when the button is pressed, the voltmeter displays a high level. The pull-down port is connected to the VCC in series with an ammeter to observe the current value: 2V is below 8uA, 3V is below 20uA, 4V is below 40uA, 5V is below 60uA, and 6V is below 85uA, which are normal;
[0044] When the method of the present invention tests the built-in E2PROM, the power module supplies power to the single-chip microcomputer via the DuPont line in series with the ammeter, the single-chip microcomputer port is connected to the high-level trigger button group circuit and the common anode light-emitting diode circuit via the DuPont line, wherein one IO port of the single-chip microcomputer is set as the button input, and three IO ports are output to LEDs, when the button is pressed once, one LED light is on, and the single-chip microcomputer writes data to the E2PROM, when the button is pressed twice, two LEDs are on, and the single-chip microcomputer writes data to the E2PROM, when the button is pressed three times, three LEDs are on, and the single-chip microcomputer writes data to the E2PROM, in the state of the second button pressing, power is off and then powered on again to detect whether it is maintained in the second pressing state, and in the state of the third button pressing, power is off and then powered on again to detect whether it is maintained in the third pressing state, and it is observed whether the value of the ammeter during the test is between 100uA and 2mA.
[0045] When testing the LCD segment output resource of the single-chip computer, the power module supplies power to the single-chip computer through the Dupont line and then connects the ammeter in series, the LCD port of the single-chip computer is connected to the LCD1602 liquid crystal circuit and the LCD12864 liquid crystal circuit in sequence through the Dupont line, the IO port is connected to the matrix keyboard circuit through the Dupont line, the matrix keyboard is a 4*4 matrix keyboard, corresponding to 0-9, +, -, *, / , ., = respectively, the test program is input into the single-chip computer, the white screen is initialized, the LCD1602 liquid crystal screen and the LCD12864 liquid crystal screen have no display, then the matrix keyboard is scanned by a simple computer keyboard scanning program, the random combination operation (for example: 1+1=2) corresponding to the key pressing is displayed on the LCD liquid crystal screen, and whether the LCD segment output resource of the single-chip computer is qualified is judged by observing whether the LCD liquid crystal screen corresponding to the key pressing is complete, whether the brightness is uniform, and whether the display value of the ammeter is between the normal range;
[0046] When the method of the present invention tests the square wave pulse signal sent by the IO port of the single-chip computer in sequence, the power module supplies power to the single-chip computer via the DuPont line in parallel with the voltmeter, the IO port of the single-chip computer is connected to the stepper motor drive module and the common cathode light emitting diode circuit via the DuPont line, the common anode light emitting diode circuit includes a green LED light, a yellow LED light and a red LED light, the IO port is connected to a low-level trigger button via the DuPont line, the single-chip computer is placed (the IO port connected to the button is set as input, and the IO port connected to the motor drive module and the common cathode light emitting diode circuit is set as output. The first button is pressed to rotate forward, and the green LED light is on. The second button is pressed to stop, and the yellow LED light is on. The third button is pressed to reverse, and the red LED light is on. The fourth button is pressed to reduce the speed by one gear, and the fifth button is pressed to increase the speed by one gear. (Total 5 gears)), whether the corresponding action of pressing the button works normally, and whether the voltmeter fluctuates when it is straightened and the speed is increased, and no fluctuation is normal;
[0047] When testing the output frequency square wave performance of the single-chip microcomputer, the power module supplies power to the single-chip microcomputer via the DuPont line, the IO port of the single-chip microcomputer is connected to the buzzer circuit via the DuPont line, and the single-chip microcomputer (the IO port of the single-chip microcomputer outputs a square wave frequency to play a simple music program) is placed. When there is no oscilloscope, whether the output frequency square wave performance of the single-chip microcomputer is qualified is judged by whether there is obvious abnormality in the sound played by the buzzer.
[0048] When testing the anti-interference performance of the built-in RC oscillator LDO reference of the single-chip microcomputer, the power module supplies power to the single-chip microcomputer via the DuPont line, the IO port of the single-chip microcomputer is connected to the infrared receiving circuit and the 138 decoder circuit via the DuPont line, the single-chip microcomputer is placed (the remote control controls the action of the LED in the 138 decoder circuit), and the corresponding LED is observed to work normally after the remote control is pressed;
[0049] When the method of the present invention tests the iic communication protocol of the single-chip microcomputer, the power module supplies power to the single-chip microcomputer through the Dupont line connected in series with the ammeter, the single-chip microcomputer port is connected to the E2PROM circuit, the high-level trigger button group circuit and the common anode light-emitting diode circuit through the Dupont line, the one-bit IO port of the single-chip microcomputer is set as the button input, the three-bit IO port is set as the LED output, when the button is pressed once, one-way LED lamp is on, and the single-chip microcomputer writes data to the E2PROM, after the button is pressed twice, two-way LED lamps are on, and the single-chip microcomputer writes data to the E2PROM, after the button is pressed three times, three-way LED lamps are on, and the single-chip microcomputer writes data to the E2PROM, when the button is pressed twice, the power is turned off and then powered on to detect whether it is maintained in the twice-pressed state, and when the button is pressed three times, the power is turned off and then powered on to detect whether it is maintained in the three-pressed state; in the whole process, it is judged whether the single-chip microcomputer can normally perform iic communication by observing whether the value of the ammeter during the test is between the normal range;
[0050] The method of the present invention tests the serial port resources of the single-chip microcomputer; the power module supplies power to the single-chip microcomputer via a DuPont line in parallel with a voltmeter, the serial port of the single-chip microcomputer is connected to an external 2.4G wireless transceiver circuit via a DuPont line, the IO port of the single-chip microcomputer is connected to a stepper motor drive circuit and a common cathode light emitting diode circuit, the common cathode light emitting diode circuit includes a green LED light, a yellow LED light and a red LED light, the single-chip microcomputer is placed, and the single-chip microcomputer is used to send motor forward, stop, reverse, accelerate and decelerate instructions to the motor first, when the single-chip microcomputer receives the motor forward instruction, the green LED light is on, when the single-chip microcomputer receives the motor stop instruction, the yellow LED light is on, and when the single-chip microcomputer receives the motor reverse instruction, the red LED light is on. When the remote control is pressed, the serial port resources of the single-chip microcomputer are judged to be qualified by observing the light emission of the common cathode light emitting diode circuit and whether the display value of the voltmeter fluctuates when the motor increases the speed;
[0051] When the method of the present invention tests the ADC resources of the single-chip microcomputer, the power module supplies power to the single-chip microcomputer via the DuPont line, the single-chip microcomputer is connected to the LCD12864 liquid crystal circuit via the DuPont line, the AD channel of the single-chip microcomputer is selected, the internal references 2V, 3V, 4V and VDD are selected, the channel input voltage is gradually increased from 5mV to 5000mV, and each time it increases by 5mv, and the high eight-bit and low four-bit hexadecimal values collected in each step are displayed on the LCD12864 liquid crystal screen. Each AD acquisition channel must select the internal reference 2V, 3V, 4V and VDD, and each step is collected 4 times, and so on until each AD acquisition channel of the tested single-chip microcomputer is tested. If the error range between the collected value and the input value is one thousandth, the ADC resource of the single-chip microcomputer is qualified. In addition, in this embodiment, the test circuit 3 also includes the following Figure 8 The circuit diagram of thermistor and photoresistor shown in the figure, because the resistance value of thermistor Rz and photoresistor Rg changes with temperature and light intensity, Figure 8The circuit shown can output two analog signals to test the ADC resources of the microcontroller.
[0052] Therefore, the present invention can write multiple test programs to the single-chip microcomputer in sequence to implement different performance tests of the single-chip microcomputer. When writing different test programs, it is only necessary to use DuPont wires to electrically connect the corresponding test ports of the single-chip microcomputer and the relevant test circuits.
[0053] In summary, the test circuit of the present invention is not electrically connected to the pins of the microcontroller or the wiring terminals electrically connected to the pins of the microcontroller in advance according to a fixed connection line, but is separately arranged from the microcontroller. When actually testing, the test pins of the microcontroller can be electrically connected to part of the circuit in the test circuit using DuPont wires according to test requirements for testing. It is highly flexible and can test microcontrollers of different models and different bit numbers.
[0054] The above is based on the present invention as an inspiration. Through the above description, relevant staff can make various changes and modifications without departing from the technical idea of this invention. The technical scope of this invention is not limited to the content in the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A single chip microcomputer testing method, characterized in that , implemented by a single-chip microcomputer testing device, the single-chip microcomputer testing device includes a locking seat, the locking seat is provided with a wiring terminal, when the single-chip microcomputer is placed on the locking seat, a pin of the single-chip microcomputer is electrically connected to a wiring terminal; also includes a power module and a test circuit, the power module supplies power to the single-chip microcomputer and the test circuit respectively, and the single-chip microcomputer is electrically connected to the test circuit through a wire; The power supply module outputs two DC voltages respectively, and the power supply module supplies power to the single-chip microcomputer and the test circuit through a switching switch, and the switching switch is used to select one DC voltage to be input to the single-chip microcomputer and the test circuit; The amplitudes of the two DC voltages are 5V and 3V respectively; The test circuit includes one or more circuits of a common anode light emitting diode circuit, a common cathode light emitting diode circuit, an LCD1602 liquid crystal circuit, an LCD12864 liquid crystal circuit, a buzzer circuit, a stepper motor drive circuit, a matrix keyboard circuit, a low level trigger key group circuit, a high level trigger key group circuit, a 138 decoder circuit, an external E2PROM circuit, an infrared receiving circuit, a 2.4G wireless transceiver circuit, an LED dot matrix circuit, a temperature sensor circuit, a common anode digital tube circuit, a common cathode digital tube circuit, a voltage detection circuit and a current detection circuit; the single chip microcomputer is electrically connected to one or more circuits in the test circuit through a wire. The method comprises the following steps: S1: placing a single chip microcomputer on a locking seat, and electrically connecting the test pin of the single chip microcomputer with the test circuit using a wire according to the test requirements; S2: writing a test program into the single chip microcomputer; S3: observing whether the test circuit responds to the single chip microcomputer when the single chip microcomputer is running; When testing the port characteristic voltage flip point of the single-chip microcomputer, connect the negative pole of the adjustable regulated power supply to the ground terminal of the single-chip microcomputer, connect the positive pole of the adjustable regulated power supply to the power terminal of the single-chip microcomputer, connect the ammeter in series between the positive pole of the adjustable regulated power supply and the power terminal of the single-chip microcomputer, and connect the test IO pin of the single-chip microcomputer to the common cathode light-emitting diode circuit through the DuPont line. When the single-chip microcomputer is placed on the locking seat, write the test program into the single-chip microcomputer to make the test IO pin of the single-chip microcomputer output a high-level signal, and then adjust the output voltage of the adjustable regulated power supply from 0V to 5V in sequence, increasing by 0.1V each time. When the common cathode light-emitting diode When the cathode light-emitting diode is on, record the values of the voltmeter and ammeter at this time, then adjust the output voltage of the adjustable voltage-stabilized power supply from 5V to 0V, reducing it by 0.1V each time. When the common cathode light-emitting diode is off, record the values of the voltmeter and ammeter at this time. Repeat the action for more than three times for each IO port of the microcontroller to complete the port characteristic voltage reversal point test of the microcontroller. When the common cathode light-emitting diode changes from off to on or from on to off, the voltage value displayed by the voltmeter is the reversal voltage, and the value displayed by the ammeter is the power consumption current of the microcontroller. If the value of the ammeter is between 100uA-1mA, it is normal power consumption. When testing the driving performance of the single-chip microcomputer, first use the DuPont line to connect the power module, the ammeter and the single-chip microcomputer in series in sequence, and then use the DuPont line to connect the ports of the single-chip microcomputer to the LED dot matrix circuit, the common anode digital tube circuit and the common cathode digital tube circuit in sequence, and then input the test program into the single-chip microcomputer to make the LEDs in the LED dot matrix circuit light up in sequence, and make the common anode digital tube circuit and the common cathode digital tube circuit display from 000001 to 999999. When the single-chip microcomputer runs the test program, observe whether the brightness of the LED lights in the LED dot matrix circuit, the digital tubes in the common anode digital tube circuit and the common cathode digital tube circuit are uniform, and observe whether the value tested by the ammeter is within the normal test range; When testing the sleep current of the MCU, the power module supplies power to the MCU through the DuPont line in series with the ammeter, and the voltmeter monitors the supply voltage of the power module. The current in the normal sleep mode is below 1uA, the power consumption in the watchdog wake-up sleep mode is below 6uA, and the power consumption in the RTC / TCC sleep wake-up mode is below 25uA, which is normal. Write the normal sleep program, watchdog wake-up sleep program, and RTC / TCC wake-up sleep program to the MCU respectively to test the sleep current of the MCU; When testing the built-in pull-up of the port of the single-chip microcomputer, the power module supplies power to the single-chip microcomputer through the DuPont line, the single-chip microcomputer port is connected to the low-level trigger button group circuit through the DuPont line, the voltmeter is connected in parallel to the GND port and the button port of the single-chip microcomputer, and the low-level trigger button configuration program is written into the single-chip microcomputer to set the input of the IO port to open the pull-up, and the others are outputs, and so on until all the pull-up IO ports of the chip are tested. When the button is not pressed, the voltmeter displays a high level, and when the button is pressed, the voltmeter displays a low level. The current value is observed through the ammeter connected in series with the pull-up port to the ground: 2V is below 15uA, 3V is below 40uA, 4V is below 75uA, 5V is below 120uA, and 6V is below 170uA, which is normal; When testing the built-in pull-down of the port of the single-chip microcomputer, the power module supplies power to the single-chip microcomputer through the DuPont line, the single-chip microcomputer port is connected to the high-level trigger button group circuit through the DuPont line, the voltmeter is connected in parallel to the single-chip microcomputer VCC port and the button port, and the high-level trigger button configuration program is written into the single-chip microcomputer to set the input of the IO port to open the pull-down, and the others are outputs; and so on until all the pull-down IO ports of the chip are tested; when the button is not pressed, the voltmeter displays a low level, and when the button is pressed, the voltmeter displays a high level; the pull-down port is connected to the VCC in series with an ammeter to observe the current value: 2V is below 8uA, 3V is below 20uA, 4V is below 40uA, 5V is below 60uA, and 6V is below 85uA, which is normal; When testing the built-in E2PROM, the power module supplies power to the single-chip microcomputer through the DuPont line in series with the ammeter, and the single-chip microcomputer port is connected to the high-level trigger button group circuit and the common anode light-emitting diode circuit through the DuPont line, wherein one IO port of the single-chip microcomputer is set as the button input, and 3 IO ports are output to the LED. When the button is pressed once, 1 LED light is on, and the single-chip microcomputer writes data to the E2PROM. After the button is pressed twice, two LEDs are on, and the single-chip microcomputer writes data to the E2PROM. After the button is pressed three times, three LEDs are on, and the single-chip microcomputer writes data to the E2PROM. In the state of the second button press, power off and then power on to detect whether it is maintained in the second press state. In the state of the third button press, power off and then power on to detect whether it is maintained in the third press state. Observe whether the value of the ammeter during the test is between 100uA and 2mA. When testing the LCD segment output resources of the single-chip microcomputer, the power module supplies power to the single-chip microcomputer after connecting the ammeter in series via the Dupont line. The LCD port of the single-chip microcomputer is connected to the LCD1602 liquid crystal circuit and the LCD12864 liquid crystal circuit in turn via the Dupont line. The IO port is connected to the matrix keyboard circuit with the Dupont line. The matrix keyboard is a 4*4 matrix keyboard, corresponding to 0-9, +, -, *, / , ., = respectively. The test program is input into the single-chip microcomputer to initialize the white screen, so that the LCD1602 liquid crystal screen and the LCD12864 liquid crystal screen have no display. Then, the matrix keyboard is scanned by a simple computer keyboard scanning program, and the random combination operation corresponding to the key pressing is displayed on the LCD screen. By observing whether the LCD screen corresponding to the key pressing is complete, whether the brightness is uniform, and whether the display value of the ammeter is between the normal range, it is judged whether the LCD segment output resources of the single-chip microcomputer are qualified; When testing the square wave pulse signal sent by the IO port timing of the single-chip computer, the power module supplies power to the single-chip computer through the DuPont line in parallel with the voltmeter, the IO port of the single-chip computer is connected to the stepper motor drive module and the common cathode light-emitting diode circuit through the DuPont line, the common anode light-emitting diode circuit includes a green LED light, a yellow LED light and a red LED light, the IO port is connected to the low-level trigger button with a DuPont line, the single-chip computer is placed, the IO port connected to the button is set as input, and the IO port connected to the motor drive module and the common cathode light-emitting diode circuit is set as output. The first button is pressed to rotate forward, and the green LED light is on. The second button is pressed to stop and the yellow LED light is on. The third button is pressed to reverse and the red LED light is on. The fourth button is pressed to reduce the speed by one gear, and the fifth button is pressed to increase the speed by one gear. Whether the corresponding action of pressing the button works normally, observe whether the voltmeter fluctuates when it is straightened and the speed is increased. No fluctuation is normal; When testing the output frequency square wave performance of the single-chip microcomputer, the power module supplies power to the single-chip microcomputer through the DuPont line, and the IO port of the single-chip microcomputer is connected to the buzzer circuit through the DuPont line. The single-chip microcomputer is placed. When there is no oscilloscope, the output frequency square wave performance of the single-chip microcomputer is judged by whether there is obvious abnormality in the sound played by the buzzer to determine whether it is qualified; When testing the anti-interference performance of the built-in RC oscillator LDO reference of the single-chip microcomputer, the power module supplies power to the single-chip microcomputer through the DuPont line, and the IO port of the single-chip microcomputer is connected to the infrared receiving circuit and the 138 decoder circuit through the DuPont line. The single-chip microcomputer is placed, and the remote control controls the LED action in the 138 decoder circuit. After the remote control is pressed, observe whether the corresponding LED works normally; When testing the iic communication protocol of the single-chip microcomputer, the power module supplies power to the single-chip microcomputer through the Dupont line in series with the ammeter, the single-chip microcomputer port is connected to the E2PROM circuit, the high-level trigger button group circuit and the common anode light-emitting diode circuit through the Dupont line, the one-bit IO port of the single-chip microcomputer is set as the button input, and the three-bit IO port is set as the LED output. When the button is pressed once, 1 LED light is on, and the single-chip microcomputer writes data to the E2PROM. After the button is pressed twice, two LEDs are on, and the single-chip microcomputer writes data to the E2PROM. After the button is pressed three times, three LED lights are on, and the single-chip microcomputer writes data to the E2PROM. When the button is pressed twice, the power is turned off and then on to detect whether it is maintained in the second-press state. When the button is pressed three times, the power is turned off and then on to detect whether it is maintained in the three-press state. During the whole process, it is judged whether the single-chip microcomputer can perform iic communication normally by observing whether the value of the ammeter test is between the normal range; When testing the serial port resources of the single-chip microcomputer; the power module supplies power to the single-chip microcomputer through the DuPont line in parallel with the voltmeter, the serial port of the single-chip microcomputer is connected to the external 2.4G wireless transceiver circuit through the DuPont line, the IO port of the single-chip microcomputer is connected to the stepper motor drive circuit and the common cathode light emitting diode circuit, the common cathode light emitting diode circuit includes a green LED light, a yellow LED light and a red LED light, the single-chip microcomputer is placed, and the remote control is used to send the motor forward, stop, reverse, accelerate and decelerate instructions to the single-chip microcomputer. When the single-chip microcomputer receives the motor forward instruction, the green LED light is on, when the single-chip microcomputer receives the motor stop instruction, the yellow LED light is on, and when the single-chip microcomputer receives the motor reverse instruction, the red LED light is on; when the remote control is pressed, the serial port resources of the single-chip microcomputer are judged to be qualified by observing the light emission of the common cathode light emitting diode circuit and whether the display value of the voltmeter fluctuates when the motor increases the speed; When testing the ADC resources of the microcontroller, the power module supplies power to the microcontroller through the DuPont line, the microcontroller is connected to the LCD12864 liquid crystal circuit through the DuPont line, the AD channel of the microcontroller is selected, the internal reference 2V, 3V, 4V and VDD are selected, the channel input voltage is increased from 5mV to 5000mV step by step, and each step increases by 5mv. The high eight-bit and low four-bit hexadecimal values collected in each step are displayed on the LCD12864 liquid crystal screen; each ad acquisition channel must select the internal reference 2V, 3V, 4V and VDD, and each step is collected 4 times, and so on until each ad acquisition channel of the tested microcontroller is tested; if the error range between the collected value and the input value is within one thousandth, the ADC resources of the microcontroller are qualified.
2. A single chip microcomputer testing method according to claim 1, characterized in that: In step S2, a plurality of test programs are sequentially written into the single chip microcomputer to implement different performance tests of the single chip microcomputer.
