Skip to main content
DMolo
Associate III
August 4, 2020
Question

Why does my Opamp PGA seem to be 10, not 16?

  • August 4, 2020
  • 16 replies
  • 3054 views

Hi,

I have a board, with STM32f303. It generally works fine, but I am using the opamps and they are causing me trouble. I have set them up to have PGA of 16, and be internally connected to the ADC, and have test points on my board where I can measure the opamp output voltage. I can read the input voltage on the resistor-capacitor feeding it.

I observe that the opamp has almost exactly 100mV in (actually 102mV generated from a 4k7 pullup to 3v3 and 150ohm to ground, but only 1V out. It seems to be quite poorly defined on output, going between 0.8V and 1.35V. Obviously I expect 1.633V from 100mV*16 gain.

Registers are set as below, read out from the chip by the debugger while running; i.e. the actual values.

The opamp is actually being used to amplify the current on a 1mohm shunt. If I pass current through the shunt (driving a motor in open loop...), I can see the value change, but the opamp out is centred on ~1V

What is wrong? Is the chip just toasted?

I have tried setting calibration values, to no avail, manually setting TRIMOFFSETP and TRIMOFFSETN to the extreme values, but it doesn't get anywhere near central.

I also ran :

hopamp1.Init.Mode = OPAMP_STANDALONE_MODE ;
HAL_OPAMP_Init(&hopamp1);
HAL_OPAMP_SelfCalibrate(&hopamp1);
HAL_Delay(50);
 
hopamp1.Init.Mode = OPAMP_PGA_MODE;
HAL_OPAMP_Init(&hopamp1);

in the startup bit of main, and this generated different trim values, but still stayed near 1V.

My last resort will be to desolder and replace the chip... but I really can't think what I've done that could be nuking it. The analogue inputs are pretty gently loaded. The behaviour is the same on all 3 opamps I'm using, and given the rest of the chip works, I am disinclined to think static.

0693W000003C1qsQAC.png0693W000003C1qJQAS.png Thanks to everyone!

This topic has been closed for replies.

16 replies

DMolo
DMoloAuthor
Associate III
September 4, 2020

I soldered an F303CB onto a breakout board and programmed it. The results were... mediocre.0693W000003QlKbQAK.png0693W000003QlJTQA0.png

Vin (mv) Vout(mv)

95.5, 1449

196.5, 3054

145.9, 2250

44.9, 645

So the offset seems to be ~4.25mV on this one. Better, but still very much on the high end. Slightly higher than your measurements Jan

Seems there is something systematically dragging the voltage on these chips down.

I'm not concerned about the actual offset so much as the stability - it's 16x gain with a 1mOhm shunt, so that's like 4A offset with 4.25mV offset... I already take a zero current reading on startup (time averaged over 250 samples by exponential decay method) and then subtract that from the later results, which seems to make things work OK...

I've been blundering on regardless with the rest of things, assuming it will all just work out. I guess worst case I end up dropping in some dedicated opamps which I'd rather not have to do since it would take away my PGA, but meh.

waclawek.jan
Super User
September 4, 2020

David,

Thanks for coming back with the results.

I understand that this is a cheap massively digital circuit with slapped-on analog, thus a compromise; but these results appear to be at the edge or slightly beyond of what's promised in the DS.

Also, as you've said, stability still remains as a question.

I still would love to hear some qualified comment from ST. Care to pester them through the web support form or in some other way?

JW

DMolo
DMoloAuthor
Associate III
September 5, 2020

I opened a case on their web support just now. Hopefully someone from ST will answer in this forum.​

The price of the part shouldn't play a part in whether the data sheets right or not, even if it's cheap (and I do admit it's an incredible part for the 2.2$asking price)​ it's got to work as specified otherwise you could end up with tens of thousands of not quite working thingies.

Slightly sad that it really doesn't seem to have a higher powered equivalent. Would be nice to have the embedded opamp on the h7 series or a high clocking f4. I understand the g4 series​ had/has serious ADC issues so isn't really a nice contender.

waclawek.jan
Super User
March 17, 2021

Hi David,

was there any response from ST on this issue?

Thanks,

JW