2020-08-04 02:30 AM
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.
Thanks to everyone!
2020-08-17 04:00 PM
Update to this: I have now tried with 4 different STM32f303CB chips, on 3 different boards. They all fall short on the output voltage. Some by more than others, but all well short (minimum 70mV short, one was 150mV short).
I guess the first one with 600mV offset might have been damaged, the other 3 definitely were not.
Currently I have one programmed with the ST FOC setup, and it runs OK, but the "All FETs disabled" output is 1.55V, when it should be 1.63.
As long as it's stable, I can shrug and say "Meh", less than 100mV can just be subtracted out for this application, but it's a bit disappointing really, and strongly limits the applicability to applications where it's possible to do compensation.
David
2020-08-18 02:19 AM
Hi David,
Thanks for coming back with the results.
You might want to contact ST through the web support form or through FAE. They probably would like to have you to produce a minimum program reproducing the problem on a Nucleo/Disco. I'd really like to hear their explanation.
JW
2020-08-18 03:53 AM
I have a 'F303RBT6 (datecode 905) in one setup. Tried to set OPAMP4 to follower OPAMP4->CSR=0x1070006d and measured voltage between OPAMP4's VP and output (PB10 and PB12). That changed from 0mV to cca 4mV while VP changed from 0mV to 2V. Then I set it to gain 2 and took the following measurements:
VP Vout
1,000V 1,9807V
0,5004V 0,9876V
0,2022V 0,3952V
From this the input offset appears to be around 3.5mV.
Not perfect, but viable (in our application, there will be an independent calibration - we are using combination of internal and external feedback, user-configurably; and the purpose of our application requires calibration after reconfiguration anyway).
I'll try to keep an eye on the issue, maybe adding a check of the offset to the production test procedure. I admit your findings do scare me a bit.
JW
2020-09-04 01:53 AM
I soldered an F303CB onto a breakout board and programmed it. The results were... mediocre.
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.
2020-09-04 02:42 AM
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
2020-09-04 05:18 PM
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.
2021-03-17 03:46 PM
Hi David,
was there any response from ST on this issue?
Thanks,
JW