STM32L431RCT6 internal temperature value too high when using DMA
- January 2, 2023
- 3 replies
- 1462 views
I have an STM32L431RCT6. I'm trying to read the internal temperature sensor using DMA, but I get temperature values > 130 °C.
I can read the temperature without the DMA just fine. And the other channels can be read fine using regular conversion or DMA.
I now first read the VREF channel, then ADC channel 1 and then the Temperature sensor. But I've tried putting the internal temperature sensor at different ranks (first, last, multiple times in a row), but that didn't help.
The values are pretty consistent and I set ADC cycles to 640.5 for each channel. My CPU is clocked at 80MHz and my ADC at 5MHz. I've tried lower and higher clocks.
ADC is calibrated after initialization.
My ADC temperature calibration values are 1034 and 1370 for 30°C and 130 °C respectively, but I get ADC values > 1500 @ 20°C when using DMA!
My VDDA is 3.3V instead of the calibration value of 3.0V, so I would expect lower ADC values than the calibration values, not 50% higher.
Without the DMA I get values between 21 °C and 23 °C, which is what I expect.
In the errata sheet I've read that the first conversion can be faulty, but even taking multiple samples doesn't change anything.
What am I doing wrong?
