Skip to main content
vielster
Associate
October 16, 2019
Question

STM32F302 ADC Pin Negative Injection Current

  • October 16, 2019
  • 7 replies
  • 1999 views

Recently started working on an STM32F302, and am having a really odd issue with the ADC. It seems that there is current coming out of the ADC pin. We have a 10k resistor with an anti-aliasing filter feeding the channel, and we see current flowing out from the ADC through the resistor. This manifests as voltage "surges" on the ADC channel. We can measure this electrically with a DMM or o-scope on the pin.

If we add channels multiple times to the sequence, the current increases, and if we remove the channel from the sequence entirely, the current goes to zero. Additionally, it does appear to be worse, not dependent on the channel, but where the channel falls in the sequence of samples.

The current values seem small (on the order of 20μA), so this can be alleviated somewhat by decreasing the impedance of the sensed input, and eliminated completely by buffering the input, but obviously this is not ideal. Do you have any recommendations on ways to address this that don't involve major hardware changes?

    This topic has been closed for replies.

    7 replies

    TDK
    October 16, 2019

    Sounds like charge injection when the multiplexer switches channels.

    You can sample for a longer time which will mitigate it. No solution to avoid it other than buffering which you’ve mentioned.

    Also see AN2834 in the event your input drops below ground.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    vielster
    vielsterAuthor
    Associate
    October 16, 2019

    That was our initial thought as well. However, we have updated the sequence to simply stay on a single channel, and increased to the max sample time, and rather than improving, it actually gets worse. We also updated the sequence to have a channel with high voltage inserted between sampled channels (which if it is current coming through the mux when switching, we assumed should make this worse) and the behavior stayed the same.

    waclawek.jan
    Super User
    October 17, 2019

    > This manifests as voltage "surges" on the ADC channel.

    The ADC behaves as a 6-10pF capacitor, which during conversion (i.e. ADC clock / (number of samples + a few cycles)) is disconnected from the input pin and charged internally to VREF/2, and then when conversion finishes, connected to the input pin for the duration of sampling period through a few tens of ohms switch. So, from a high impedance source with zero voltage, you'll see pulses at the rate of the sampling, flowing out of the pin; if the source is at VREF, current should flow into the pin; and if the source is approximately at VREF/2, pulses should diminish.

    Is this what you observe?

    JW

    vielster
    vielsterAuthor
    Associate
    October 17, 2019

    With our 10k input impedance, even at 10pf, I'd expect that to settle out very quickly. At 1MHz, that's still 10 time constants, and we're only sampling at something on the order of 15KHz (slowest setting).

    waclawek.jan
    Super User
    October 18, 2019

    Did you actually look at the pin using a fast enough oscilloscope?

    JW

    vielster
    vielsterAuthor
    Associate
    October 18, 2019

    Yes, we've been using a 50MHz scope for capture. We took a brief look yesterday, and do see obvious pulses on the o-scope at the sampling rate, but they are not even close to the magnitude we are seeing in the samples (we see 10s of mV of drift).

    We've been able to limit this effect by reducing the frequencies as much as plausible, so not sure how much time we're going to spend on this in the near term, but we'll undoubtedly get back to it when we go through our re-spin discussions, at which point I'll try and get some more detailed captures and such up for more discussion.