cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 ADC Impedance Calculation

bryan costanich
Associate II
Posted on November 05, 2017 at 19:38

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:0690X00000608qxQAA.png

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:

  • MCU Frequency: 168MHz
  • ADC Clock: set to default, which is peripheral clock / 2 (according to the note next to this in source). I�m pretty sure from my reading that the peripheral clock is the same as the MCU clock. So 168MHz / 2 = 84MHz. However, the data sheet says that the ADC Clock Frequency (fADC) is between 30 and 36MHz for VDDA of 2.5V to 3.6V, and the VDDA on the Netduino should be around 3.3V. So what is the actual value here?
  • ADC Sampling Time: 28 cycles (I found this as a note in the source somewhere)
  • N: 12 (because it�s 12 bit resolution)
  • RADC: This is the sampling switch resistance, and is stated to be 6k? in the data sheet.
  • CADC: this is the internal sample and hold capacitor, which has a stated value of between 4 and 7 pF.I assume I can just use 5.5pF for calculations.

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 #adc
12 REPLIES 12
LMI2
Lead
Posted on November 05, 2017 at 20:54

There should be a low impedance drive to the ADC, so where do you need that info.

raptorhal2
Lead
Posted on November 05, 2017 at 20:56

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

Posted on November 05, 2017 at 22:14

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.

raptorhal2
Lead
Posted on November 05, 2017 at 23:18

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

Posted on November 05, 2017 at 23:27

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?

raptorhal2
Lead
Posted on November 06, 2017 at 02:13

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

Posted on November 06, 2017 at 02:59

Right. So, back to my first post; I still need to calculate the load of the ADC.

raptorhal2
Lead
Posted on November 06, 2017 at 15:58

For the ADC input impedance, assume the S&H capacitor side of the S&H 6K resistor is connected to ground.

Cheers, Hal

bryan costanich
Associate II
Posted on November 15, 2017 at 05:04

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.