2023-10-26 02:51 AM - edited 2023-10-26 02:53 AM
If this is not the right section of the forum to ask this question, I kindly ask you to move it to the correct one. Thank you!
I need an ADC with differential input but I only have STM32F407 (which doesn't have it).
I was thinking of sending the differential signal (2 wires) to 2 inputs of the ADC... and then doing the subtraction via software. In this way I should have "created" the differential ADC I need.
But I don't think the 2 ADC ports work exactly at the same time! So maybe I could have problems with this "coarse" solution of mine and therefore produce an untrue result from the ADC.
What do you think? Does this make sense?
The differential input signal is a sinusoid (not perfect!) of a few Hz whose frequency can vary from 0.5Hz to 4Hz
Solved! Go to Solution.
2023-10-26 07:15 AM
Yes, your intuition is correct--two channels on the same ADC do not sample at the exact same time. But even so, that measurement should get you close.
You can use ADC1 and ADC2 in dual mode to sample at the same time and subtract values that way.
For a signal of 4 Hz and less, taking samples at the exact same time is probably not critical.
2023-10-26 07:15 AM
Yes, your intuition is correct--two channels on the same ADC do not sample at the exact same time. But even so, that measurement should get you close.
You can use ADC1 and ADC2 in dual mode to sample at the same time and subtract values that way.
For a signal of 4 Hz and less, taking samples at the exact same time is probably not critical.
2023-10-30 01:07 PM
"dual mode" is a setting that I set in the .ioc file during ADC initialization?
2023-10-30 02:08 PM
Yes. Enable ADC1 and ADC2 and set the dual mode in ADC1 settings.
I don't use CubeMX for ADC much, but I'm sure it's one of the settings in there. There should be dual mode examples in CubeMX repository.