2024-07-16 06:26 PM
STM32G431RB is in use. If you add frequency: 100KHz, offset: 1V, amplitude: 1V as a function generator and proceed with ADC using MATLAB, the signal is output in offset: 2V and amplitude 2V.
It's a picture of the function generator parameter settings, and when I ran it, I extracted the graph from the matlab like the picture on the right.
If you look at the ADC, FFT graph, the waveform does not fluctuate at 1V, but it fluctuates at 2V, and even though Vpp = 1V, it fluctuates as if Vpp = 2V.
I don't know the cause, can you tell me?
2024-07-16 07:03 PM
So, just to understand: you use an external signal generator. You use MATLAB in order to let generate the FW for your MCU, right? The ADC is from the MCU FW (FW generated via Matlab? Or how is Matlab here involved?).
You try to feed a sine signals, 100KHz, with 1Vpp and offset of 1V and you see this as result?
"hmmm", seems to be more a question about "how to setup the signal generator?" (not related to STM32 and MCU).
I think, your signal generator is not set properly (not generating a signal as + and - around GND = balanced, instead just all as + from GND, unbalanced), not a GND symmetrical signal, instead "GND referenced" for lowest (negative) value).
Check your setup of the signal generator (and make sure your STM32 can take negative voltages as input).