ADC sampling deviation due to level matching

The chip used in this article is Huada HC32L110C4, and the adc accuracy is 12 bits

When doing a current sampling calculation, it is found that the adc data has always been deviated. After searching, it is found that the problem lies in the level matching of the serial port, because the voltage signal received by the serial port RX is too high, which causes the adc's power reference to change, causing problems. .

 

table of Contents

 

1. Problems

Two, the solution

3. The root of the problem

Fourth, the final solution


1. Problems

There is a deviation in the data read by adc. After searching, it is found that there will be problems when the RX of the chip serial port is connected, and there will be no problems if it is not connected.

Use an oscilloscope to check that the voltage of each adc channel is 0v when the rx is not connected, but after it is connected, the voltages of the adc 2 and 3 channels are 0.2v and 0.1v respectively. At this time, problems will inevitably occur when the adc signal is collected.

I feel that this kind of problem is more confusing. I measured that the TX signal of the serial port is 4.9v, and the power supply of the chip is 3.3v. It is determined that the voltage signal from the serial port is too high.

Two, the solution

Add a level conversion circuit to the chip serial port RX to solve the problem.

Originally, the signal of the external serial port was directly given to the chip, but now it passes through the conversion circuit to 3.3v and then to the mcu to solve the problem.

3. The root of the problem

What is puzzling is that the serial port transmission circuit is also shipped in batches on the stm8 and stm32 platforms, and there is no problem. Why is there a problem on the BGI chip?

After checking the manual, I found

There is no special description for the serial port pins used by stm8

The serial port pin used by stm32, there is a special description, the pin can be compatible with 5v

 

 

 

Huada’s chip is the same as stm8, and there is no special description.

It can be seen that the same data in the manual, but the adc of Huada chip is interfered by external signals, while the chip of st is not interfered.

 

Fourth, the final solution

Therefore, in comparison, the Huada chip has weaker input anti-interference ability than the St series chip, and then you should pay attention to the signal matching problem.

Guess you like

Origin blog.csdn.net/zhuimeng_ruili/article/details/109564910