2023-02-08 08:50 AM
We've been building a PCB with four STM32F091s on each PCB and we've built about 50 units by now (over about 3 years). I have now seen three PCBs where the ADC readings are 'bad' on two of the four micros. By 'bad' I mean conversion values are 30% ish low.
With the design having been stable for quite a while, the chances of uncovering a new bug seem slim, but chip damage seems even more unlikely. The fault also 'went away' on one of the PCBs, so more evidence that it's not damage.
The ADC reference is VDD 3.3V on all the chips, and they all run the same code.
Anyone got any thoughts?
Solved! Go to Solution.
2023-02-13 02:21 PM
Not sure what you mean bya SW range detection. Results are stable over a couple of hours, just wrong.
2023-02-13 11:10 PM
And when you measure an internal reference source, are the readings stable and correct? Is the measured reference voltage within the range given in the specification? If not and the supply voltage is fine, the MCU must be faulty.
2023-02-14 01:36 AM
The internal reference comes back as 2022 +/- a few codes. This isn't what I expect, because it implies an ADC VRef of 2.49V. Apart from being a really weird failure mode, on one of my PCBs the fault 'went away', so I'm not convinced it's a hardware fault.
2023-02-14 01:53 AM
But have your measured the VDDA/VREF+ voltage when the device is in failure mode? VSSA/VREF- state? Maybe soldering quality problems.
2023-02-14 02:07 AM
VDDA is 3.302V. Soldering is always a consideration but the PCBs were professionally assembled and I'm seeing the same problem on several chips.
2023-02-14 02:59 AM
> The internal reference comes back as 2022 +/- a few codes. This isn't what I expect, because it implies an ADC VRef of 2.49V.
But that's then 30% *higher* than expected. In the initial post you've said the measured (external voltages) values are 30% *lower* than expected.
I don't doubt your words, just that this somewhat increases the mystery.
We don't know how exactly do you perform conversions. So, for example, as S.Ma said above, too short sampling time may have impact - in that case, if you convert in sequence, preceding channel may influence measurement of the subsequent one.
JW
2023-02-14 03:19 AM
The way the ADC scale calibration works is rather ar$e about face in the 091. VDDA is always the fullscale reference, and if you can't trust it implicitly you measure an internal 1.23V reference and get the ratio of VDD to 1.23V. You can scale unknown voltages either to the internal 1.23V or to the inferred VDD.
ADC clocking and sampling times are all set up in the CubeMX synthesised code, so that's on my 'to investigate' list.
2023-02-14 04:06 AM
I would verify the voltage on the VDDA pin directly, if the package it allows.
2023-02-14 04:26 AM
Done that. I've now also enabled the PVD and set it to 2.9V, so the chip thinks the VDD is above that.
2023-02-14 04:26 AM
So, did you measure the internal Vref?
That's always my sanity check for MCU ADCs, not matter what I use as an external reference, VCC or some cheap 1% voltage ref, I always check the internal ref.
I mostly use MCU ADCs for voltage monitoring (up to 8 voltages in our analog front-ends), and I always add the internal reference to the list. So also when that one is off, it counts as power failure because the external ref can't be trusted.