STM32F1 ADC Weirdness


That one had me scratching my head for a while.
Depending on the speed of the ADC, there is a small current being eaten by the ADC itself,
in the range of 0.5uA to 3 uA.

Why is that a problem ?

1- It happens even if the ADC is not sampling, which is really weird. When using high current ( a few mA), it is not visible at all.
2- But when using a large resistor (i.e. 300kOhm), that small current is enough to cause a voltage drop of sever tenth of a volt, ruining the measures.
For reference, with the 300 kOhm (or 2x300 kOhm) the current is ~ 10 uA (or 5uA) , so a ADC leaking 2uA is not neglectable at all.

At the fastest speed (worse effect), it causes the capacitor to cap at 3v (or 2.5v) rather than ~3.3v which ruins the estimation.

To confirm, i cut the ADC wire and voila, back to ~ 3.3 v

The estimation of the current is as follows (the different rates/scales of the ADC clock can yield different result for the same sampling period) :


Samp period (us)i (ua)
2.1666666672.966666667
2.8888888892.6
3.4166666672.366666667
4.5555555562
4.52.033333333
61.7
73.333333333
9.3333333331.266666667
210.6333333333
280.5733333333

I really dont understand why.
Oh well, time to put a small op-amp in the middle as a follower and hope it will not cause more problems than it solves.

Let's try first with a LMV324i to avoid messing with 5v and voltage inverter.

Edit : did a quick test with LMV324i, seems to work fine

Comments

  1. Does the GD32F1 ADC also draw some current? Thanks for your work and posts on the STM32 component tester. I am looking forward to try it!

    ReplyDelete
  2. yes, it is due to the way it works i.e. charge an internal cap , disconnect, then measure that cap.
    That cap is very small ( a few pF) but depending on what you do, it might be a problem if a very small current is a problem.

    ReplyDelete
  3. in other words : GD32F1, GD32F3 and STM32F1 all behave the same, just the internal cap differs a bit

    ReplyDelete

Post a Comment

Popular posts from this blog

Component tester with STM32 : Part 1 ADC, Resistor

Fixing the INA3221

INA3221, weird wiring