2017-11-05 10:38 AM
Hey folks!
I�m trying to calculate the impedance and current draw of the ADC in an STM32F4 that�s on the Netduino. The data sheet says that the max External Input Impedance is
50K?
, but gives the following equation for calculating the actual impedance:I�ve having a hard time tracking down some of these variables, though. For instance, k is supposed to be the number of sampling periods, but I don�t know where that register is defined. I can�t find it anywhere in the firmware source. However, I have found some of the other things:
Hoping that you folks can help clear up the ADC Clock value based on the other items so I can do the calculation. Or, if there's some other value I need to know, please let me know so I can track it down.
thanks!!
#stm32f4-adc #adc2017-11-05 11:54 AM
There should be a low impedance drive to the ADC, so where do you need that info.
2017-11-05 11:56 AM
I recommend you read ST's Application Note AN2834 How To Get Best ADC Accuracy to get an understanding of the difference between a literal interpretation of 'I’m trying to calculate the impedance and current draw of the ADC' and your use of the RAIN formula. In particular, read Section 3.2.6 of the AN.
If you have questions after that, perhaps we can help.
Cheers, Hal
2017-11-05 02:14 PM
Heh. I've been through that AN over and over. But I'm not sure why you're referring me to that section. Even the equation presented in there still requires that RAIN must be calculated; see: Rmax = (RAIN + RADC)max(2). I understand that sampling time is important, but I'm not really there yet.
Perhaps you can explain to me what you think I'm missing? I have no formal background in EE, but I've been reading a ton and understand many of the concepts.
Maybe if I provide some context here, it will help. I'm trying to use a voltage divider to level shift a 5V sensor to 3.3V for the ADC input. Since the ADC represents part of the bottom half of the voltage divider, I need to have an understanding of how much resistance/impedance it provides, as well as the current draw, so I can calculate the resistors for voltage division.
2017-11-05 02:18 PM
The ADC clock frequency is limited, so a clock divider is used when the MCU clock is greater.
ADC sampling time is a multiple of ADC clocks and is a programmable choice, longer sampling time is used for higher impedance signal sources to get the sample and hold capacitor charged up close enough to the input voltage as explained in 3.2.6. The 28 cycles in ST's examples meets ST's example needs, your needs may vary.
I suspect that to get a small enough RAIN you will end up with resistor divider resistance values drawing too much current from the sensor. You can use higher divider resistors if you feed the divider tap to the + input of an operational amplifier. The amplifier will then present infinite impedance to the divider and near zero impedance to the ADC. Mich Lei hinted at this in his response.
Cheers, Hal
2017-11-05 03:27 PM
So is there no practical way to use a voltage divider with a 5V sensor output to the ADC without an OpAmp on the Vout, even for prototyping purposes?
2017-11-05 05:13 PM
Pick the smallest value resistors for the divider that your sensor can drive (remember to include the 6K ADC S&H resistor in the load calculation). If more than the maximum available sampling time is needed to meet your accuracy requirement, then you need the buffer amplifier.
Cheers, Hal
2017-11-05 06:59 PM
Right. So, back to my first post; I still need to calculate the load of the ADC.
2017-11-06 06:58 AM
For the ADC input impedance, assume the S&H capacitor side of the S&H 6K resistor is connected to ground.
Cheers, Hal
2017-11-14 08:04 PM
Incidentally, i used the following
Cadc = 5pf
Radc = 6kΩ
n = 12
k = 28
Fadc = 33MHz (i guess at this, because it had to be 30-36MHz on a 2.5-3.3V signal)
and it basically comes out to 6kΩ no matter what, because the front half of the equation, the division, winds up being an insignificant number. 0.0156 in this case, so it becomes -5,999.98Ω.
not sure why the minus is there, but basically, 6kΩ is the answer.