Portenta ADC Problem

I have found a number of problems with the Portenta ADC. I know analogRead is extremely slow for an STM32H7 and very noisy compared other STM32H7 boards.

Here is the latest problem. If you take a series of reading of a new AA 1.5V battery the values gradually increase. If you delay for one second, the pattern repeats. I suspect the ADC reference voltage droops.

Any way to fix this?

Here is the test program:

const size_t DATA_DIM = 5000;
void setup() {
  Serial.begin(9600);
  uint16_t data[DATA_DIM];
  analogReadResolution(16);
  while (!Serial) {}

  for (size_t i = 0; i < DATA_DIM; i++) {
    if (i%1000 == 0) {
      delay(1000);
    }
    data[i] = analogRead(A0);
  }
  for (size_t i = 0; i < DATA_DIM; i++) {
    Serial.println(data[i]);
  }
}
void loop() {}

Here is a plot of the data

it looks like you are "seeing" the internal stabilization of an ADC ... what happens if you put a delay between each measurement ?

Anything you do changes the problems with Portenta. I used a USB 3.0 port and noise changes. You can create various patterns with different delays.

Here is the same program with a USB 3.0 port incredible noise.

The STM32H7 is a fine processor. Here is a result with a Nucleo H743ZI board. ChibiOS is about 30 times faster for simple ADC reads than Arduino so I over-sampled 64X per point. It's accurate and very low noise. The board is on the same USB 3 port.

Without the over-sampling the range for the Nucleo is about 12 counts, not 2000.

Edit: I think I see the AREF problem. There is a 100k resistor between 3V1 and the VREF+ pin on the STM32H747XIH6. The Nucleo has no resistor. It has a solder bridge bridge to select the VREF source.

The ADC AREF design is flawed.

I ran this loop:

  while (true) {
    for ( int i = 0; i < 50000; i++) {
      analogRead(A0);
    }
    delay(2000);
  }

I measured the AREF pin which is connected directly to VREF+ on the STM32H747XIH6. The voltage drops well over 0.1 volt when the ADC is active which explains over a 1000 count change which is close to the jump on the graph.

Guess connecting AREF to an external reference would fix it.

I am done with Portenta, too many problems.

Edit: I did one more test. I looked at regulation of the 3V3 power.

The 3V3 is not very well regulated. It's about 2.99 V average but fluctuates a lot when running the ADC test program. The USB is supplying an average of 4.96 V at 0.04A.

The voltage rises a lot in the delay call, the CPU must sleep in a low power mode. The USB current drops to almost zero during delay.

The power management chip is really complex.

2 Likes

Yhea I had the same issues. You definitely have to drive that pin by an external voltage source. The connected 3.1 volts only prevents the VRef pin of the STM from floating. So the resistor R31 is kind of a protection circuit.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.