cancel
Showing results for 
Search instead for 
Did you mean: 

Enabled ADC is influencing input magnitude from a signal generator.

noname
Associate II

Greetings,

Disclaimer: I have started learning about programming MCUs a couple of weeks ago, so my qustion might seem ridiculous, please don't blame.

I'm working on spectrum analyzer project based on a noname board with STM32F103RBT6 mcu.

The shematic of the board is as follows:

0693W000000WXVaQAO.jpg

I observe some weird signal distortion when I connect a signal generator to the ADC input of the board and read values from it. The oscilloscope I own has a built in signal generator which is used for debugging purposes. The generator is configured as follows: 0693W000000WXVzQAO.jpg

So basically it's a sine wave 1kHz, 1.65V magnitude, with a 1.65V offset.

Now the generator probe is connected to then analog pin B0, ADC is enabled. But then if I connect oscilloscope probe to the same pin I observe that the amplitude of the signal is reduced several times:

0693W000000WXWJQA4.jpg

If i don't connect generator output to the ADC port I get correct values on the oscilloscope (oscilloscope connected directly to generator ouput, note the 188mV amplitude vs 1.65V configured):

0693W000000WXWsQAO.jpg

So from the MCU's documentation is looks like ADC is using internal capacitors to perform the conversion.

The question: Is that something that is influencing the signal? If not then what would be the reason for the signal be "shrinked" in aplitide when conneced to an ADC enabled pin? Is there anything I can do to maintain a stable input from the generator? Note that in case ADC is disabled the signal from generator is not influenced.

I have also uploaded the code to GitHub to show the actual MCU setup: https://github.com/KapitonovRoman/TimerBasedAdcFFT. See `Src` and `Inc` folders. Please note that I don't have any kind of debugger, so all the process is done in place, using a tft to output debugging info in real time:0693W000000WXXMQA4.jpg

If any further details are required please feel free to request. Thank you!

4 REPLIES 4
TDK
Guru

> Is that something that is influencing the signal?

The ADC can influence a signal if the strength of that signal is too low.

> Is there anything I can do to maintain a stable input from the generator?

You can buffer the signal by using an op-amp in voltage follower mode, or similar circuitry. This is what oscilloscopes do in order not to influence the signal.

Most function generators have the ability to buffer their output such that small drains like the ADC don't have much of an effect. You might be in Hi-Z mode.

If you feel a post has answered your question, please click "Accept as Solution".
noname
Associate II

Thank you for your answer! I will take a look at the signal buffers you suggested. As far as the output impedance is concerned apparantely the mentioned oscilloscope has a 50Ω output impedance according to the specs http://www.hantek.com/en/ProductDetail_3_4163.html, which is not Hi-Z. Unfortunately there is no way to toggle ouptut impedance, so I guess an op-amp is the only option left. Thanks once again!

The ADC has a pretty high impedance. I wouldn't expect it to drop the signal that much. Might be something else going on. See what happens if you connect a ~50kOhm resistor to the load. Should have similar effect as the ADC.
If you feel a post has answered your question, please click "Accept as Solution".
noname
Associate II

Well, I've tried an LM358 Op Amp in voltage follower mode, and there is still a mess. Something weird happens when op amp's output is connected to the ADC pin. The generator is confgired as previously:

0693W000000WaVdQAK.jpg

When ADC pin is not connected to op amp then the output the oscillogram at the OP Amp ouput pin is this:

0693W000000WaVxQAK.jpg

But once adc is connected to OP amp the signal is cut:

0693W000000WaWbQAK.jpg

Op amp is powered with a 5V line from the board. Op Amp output current is 32mA. Something is happening but I don't understand why.