Detection circuit in PCB reverse design system

When electronic engineers carry out the reverse design or repair work of electronic equipment, they first need to understand the connection relationship between the components on the unknown printed circuit board (PCB), so the connection relationship between the component pins on the PCB needs to be measured and recorded.

The easiest way is to switch the multimeter to the “short-circuit buzzer” file, use two test leads to measure the connection between the pins one by one, and then manually record the on/off status between the “pin pairs”. In order to obtain the complete set of connection relations between all “pin pairs”, the tested “pin pairs” must be organized according to the principle of combination. When the number of components and pins on the PCB is large, the number of “pin pairs” that need to be measured will be It will be huge. Obviously, if manual methods are used for this work, the workload of measurement, recording and proofreading will be very large. Moreover, the measurement accuracy is low. As we all know, when the resistive impedance between the two meter pens of a general multimeter is as high as about 20 ohms, the buzzer will still sound, which is indicated as a path.

ipcb

In order to improve the measurement efficiency, it is necessary to try to realize the automatic measurement, recording and calibration of the component “pin pair”. To this end, the author designed a path detector controlled by a microcontroller as a front-end detection device, and designed a powerful measurement navigation software for back-end processing to jointly realize the automatic measurement and recording of the path relationship between the component pins on the PCB. . This article mainly discusses the design ideas and technology of automatic measurement by the path detection circuit.

The prerequisite for automatic measurement is to connect the pins of the component under test to the detection circuit. For this, the detection device is equipped with several measuring heads, which are led out through cables. The measuring heads can be connected to various test fixtures to establish connections with the component pins. The measuring head The number of pins determines the number of pins connected to the detection circuit in the same batch. Then, under the control of the program, the detector will incorporate the tested “pin pairs” into the measurement path one by one according to the principle of combination. In the measurement path, the on/off status between the “pin pairs” is shown as whether there is resistance between the pins, and the measurement path converts it into a voltage, thereby judging the on/off relationship between them and recording it .

In order to enable the detection circuit to select different pins in sequence from the numerous measuring heads connected to the component pins for measurement according to the principle of combination, the corresponding switch array can be set, and different switches can be opened/closed by the program to switch the component pins. Enter the measurement path to obtain the on/off relationship. Since the measured is an analog voltage quantity, an analog multiplexer should be used to form a switch array. Figure 1 shows the idea of ​​using an analog switch array to switch the tested pin.

The design principle of the detection circuit is shown in Figure 2. The two sets of analog switches in the two boxes I and II in the figure are configured in pairs: I-1 and II-1, I-2 and II-2. . .. . ., Ⅰ-N and Ⅱ-N. Whether the analog multiple switches are closed or not is controlled by the program through the decoding circuit shown in Figure 1. In the two analog switches I and II, only one switch can be closed at the same time. For example, to detect whether there is a path relationship between measuring head 1 and measuring head 2, close the switches I-1 and II-2, and form a measuring path between point A and ground through measuring heads 1 and 2. If it is a path, Then the voltage at point A VA=0; if it is open, then VA>0. The value of VA is the basis for judging whether there is a path relationship between the measuring heads 1 and 2. In this way, the on/off relationship between all the pins connected to the measuring head can be measured in an instant according to the combination principle. Since this measurement process is carried out between the pins of the component clamped by the test fixture, the author calls it the in-clamp measurement.

If the pin of the component cannot be clamped, it must be measured with a test lead. As shown in Figure 2, connect one test lead to an analog channel and the other to ground. At this time, the measurement can be performed as long as the control switch I-1 is closed, which is called pen-pen measurement. The circuit shown in Figure 2 can also be used to complete the measurement between all the clampable pins of the measuring head and the non-clampable pins touched by the grounding meter pen in an instant. At this time, it is necessary to control the closing of the switches of No. I in turn, and The switches of Route II are always disconnected. This measurement process can be called pen clamp measurement. The measured voltage, theoretically, it should be a circuit when VA=0, and it should be an open circuit when VA>0, and the value of VA varies with the resistance value between the two measurement channels. However, since the analog multiplexer itself has a non-negligible on-resistance RON, in this way, after the measurement path is formed, if it is a path, VA is not equal to 0, but equal to the voltage drop on RON. Since the purpose of measurement is only to know the on/off relationship, there is no need to measure the specific value of VA. For this reason, it is only necessary to use a voltage comparator to compare whether VA is greater than the voltage drop on RON. Set the threshold voltage of the voltage comparator to be equal to the voltage drop on RON. The output of the voltage comparator is the measurement result, which is a digital quantity that can be directly read by the microcontroller.

Determination of threshold voltage

Experiments have found that RON has individual differences and is also related to ambient temperature. Therefore, the threshold voltage to be loaded needs to be set separately with the closed analog switch channel. This can be achieved by programming the D/A converter.

The circuit shown in Figure 2 can be used to easily determine the threshold data, the method is to turn on the switch pairs I-1, II-1; I-2, II-2; …; I-N, II-N; form Path loop, after each pair of switches are closed, send a number to the D/A converter, and the sent number increases from small to large, and measure the output of the voltage comparator at this time. When the output of the voltage comparator changes from 1 to 0 , The data at this time corresponds to VA. In this way, the VA of each channel can be measured, that is, the voltage drop on RON when a pair of switches are closed. For high-precision analog multiplexers, the individual difference in RON is small, so half of the VA automatically measured by the system can be approximated as the corresponding data of the voltage drop on the respective RON of the pair of switches. Threshold data of the analog switch.

Dynamic setting of threshold voltage

Use the threshold data measured above to build a table. When measuring in the clamp, take out the corresponding data from the table according to the numbers of the two closed switches, and send their sum to the D/A converter to form a threshold voltage. For pen clip measurement and pen-pen measurement, because the measurement path only passes through the analog switch of No. I, only one switch threshold data is required.

In addition, because the circuit itself (D/A converter, voltage comparator, etc.) has errors, and there is a contact resistance between the test fixture and the tested pin during actual measurement, the actual threshold voltage applied should be within the threshold determined according to the above method. Add a correction amount on the basis, so as not to misjudge the path as an open circuit. But the increased threshold voltage will overwhelm the small resistance resistance, that is, the small resistance between the two pins is judged as a path, so the threshold voltage correction amount should be selected reasonably according to the actual situation. Through experiments, the detection circuit can accurately determine the resistance between the two pins with a resistance value greater than 5 ohms, and its accuracy is significantly higher than that of a multimeter.

Several special cases of measurement results

The influence of capacitance

When a capacitor is connected between the tested pins, it should be in an open-circuit relationship, but the measurement path charges the capacitor when the switch is closed, and the two measurement points are like a path. At this time, the measurement result read from the voltage comparator is path. For this kind of false path phenomenon caused by capacitance, the following two methods can be used to solve: appropriately increase the measurement current to shorten the charging time, so that the charging process ends before reading the measurement results; add the inspection of true and false paths to the measurement software The program segment (see section 5).

Influence of inductance

If an inductor is connected between the tested pins, it should be in an open-circuit relationship, but since the static resistance of the inductor is very small, the result measured with a multimeter is always a path. Contrary to the case of capacitance measurement, at the moment when the analog switch is closed, there is an induced electromotive force due to the inductance. In this way, the inductance can be correctly judged by using the characteristics of the fast acquisition speed of the detection circuit. But this is in contradiction with the measurement requirement of capacitance.

The influence of analog switch jitter

In the actual measurement, it is found that the analog switch has a stable process from the open state to the closed state, which is manifested as the fluctuation of the voltage VA, which makes the first few measurement results inconsistent. For this reason, it is necessary to judge the results of the path several times and wait for the measurement results to be consistent. Confirm later.

Confirmation and recording of measurement results

Considering the above various situations, in order to adapt to different tested objects, the software program block diagram shown in Figure 3 is used to confirm and record the measurement results.