cancel
Showing results for 
Search instead for 
Did you mean: 

Temperature errors on STM32F303RC ADC

DBank.2
Associate II

We have implemented a single ended ADC input to measure a voltage on our board. At low temperatures there is a significant error in the measurement.

Going from +20C to -20C, the value we get from the ADC is ~92mV (114 counts) lower than it should be. We have measured the voltages of the pins on the board and they change by no more than 2mV (input pin; VCC is rock steady), or 2.5 counts.

We're using STM32CubeMX to configure the part. I'm assuming that we must be doing something wrong with the ADC but I cannot see anywhere in the manual, data sheet or errata that points to an obvious problem. There is also an error as temperature increases, but it is much smaller.

Any insights would be appreciated. Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Yes - increasing the sampling time fixed the problem.

For anyone wanting detail. We were measuring from a potential divider with a source resistance of about 10k. This was well within the spec from the hardware point of view and I didn't initially see an issue. What I had not known was that the sampling time is set by software. It was hidden by the CubeMX ADC configuration under "Rank", which needed expanding. It looks like it defaults to the shortest sampling time.

There is a table on the data sheet (Table 69 Maximum ADC RAIN, DS9118 Rev 14) that tells you what sampling time you need to set for various source resistances. I changed the sampling time up to the required value and everything was great.

Working at home, I got the temperature down by leaving the board in the freezer compartment of my refrigerator. Worked a treat. I hadn't realised that the compartment got that cold. Freezer spray is also available, but I didn't have any of that to hand.

Thanks TDK for the pointer.

View solution in original post

5 REPLIES 5
TDK
Guru

What are you using as a voltage reference? Does increasing sampling time have an effect?

If you feel a post has answered your question, please click "Accept as Solution".
TDK
Guru

The ADC needs calibrated prior to use and if conditions change significantly (e.g. temperature). If you recalibrate at -20C, is the result better?

If you feel a post has answered your question, please click "Accept as Solution".

We implemented calibration. Recalibrating at -20C does not improve the results (we only get a very small change in the value).

I believe it is using VDDA as the reference. I am not intimate with the code so I would have to spend some time to triple check that this is being set up right.

I was wondering about sampling time. As far as I can tell we're well within all the timings listed, but the ADC is being driven by a 66.3552MHz clock which sounds fast to me (again, though, looks OK from the manuals).

I'm working from home and have to manage testing remotely, consequently I can't go through the usual trial and error process as smoothly as usual. So I am trying to get some solid things to try based on other people's experience, to try and reduce the amount of trial and error required. (Otherwise I would have been in the lab fiddling with all sorts of things).

If you think sampling time is a good point to start, I will dig a bit further into that.

Yes - increasing the sampling time fixed the problem.

For anyone wanting detail. We were measuring from a potential divider with a source resistance of about 10k. This was well within the spec from the hardware point of view and I didn't initially see an issue. What I had not known was that the sampling time is set by software. It was hidden by the CubeMX ADC configuration under "Rank", which needed expanding. It looks like it defaults to the shortest sampling time.

There is a table on the data sheet (Table 69 Maximum ADC RAIN, DS9118 Rev 14) that tells you what sampling time you need to set for various source resistances. I changed the sampling time up to the required value and everything was great.

Working at home, I got the temperature down by leaving the board in the freezer compartment of my refrigerator. Worked a treat. I hadn't realised that the compartment got that cold. Freezer spray is also available, but I didn't have any of that to hand.

Thanks TDK for the pointer.