2025-03-06 2:50 AM
Hi,
I'm working on a custom module based on a STM32L452CCU MCU.
I'm reading the temperature of the MCU (using ADC1 with DMA, temp is updated at 30Hz using a timer)
When I read the ADC value on a regular basis while heating the MCU, I can read a voltage going from 1600 up to 2300 or so (which should be someting like 105°C or so) which is OK
However, when I do the same with some external hardware enabled, while heating the MCU, the voltage suddently drop down when reachin a value of 2100 or so, it drops to 690 / 700 mV leading to a wrong temperature.
What could be the reason of this ?
Thanks
2025-03-06 5:59 AM
Internal temperature shouldn't be more than about 20 C above ambient. 105 C doesn't seem right unless this is in a thermal chamber.
> What could be the reason of this ?
Probably a code bug or misinterpretation of results. Internal temperature doesn't swing wildly.
2025-03-06 6:08 AM
I'm using a Hot air station to reach 105 C. That how I can test over temperature.
2025-03-06 6:09 AM
@TDK wrote:Internal temperature shouldn't be more than about 20 C above ambient. 105 C doesn't seem right unless this is in a thermal chamber.
OP did say that the chip is being heated:
@PierreP wrote:When I read the ADC value on a regular basis while heating the MCU, I can read a voltage going from 1600 up to 2300 or so (which should be someting like 105°C or so) which is OK
2025-03-07 12:07 AM
Hi,
How are you calculating the Temperature from the ADC Data Register ?.
Have you calibrated the Internal Temperature Sensor according to the Reference Manual. ?
2025-03-07 12:12 AM
Are you following the procedure above ?
2025-03-07 1:48 AM
Hi,
Thanks and yes I'm aware of the procedure and went over this several times. My implementation relies on the STM32 HAL.
The point is not about the conversion and calibration (by the way, after conversion I'm seeing temperature around 20-23C at ambiant so no issue there) but realy about the temperature sensor voltage that increase until 2100mV or so when I heat the sensor (which is expected) but then switch ti 690-700 when I continue to heat the sensor.
IF I only enable ADC and read the temperature in a loop, I can see values up to 2300 (which is around 105C); but IF I enable other HW subsystem on my module, I can't go above 2100mV, however, the system / FW works weel, only the value read from the sensor becomes incorrect when I heat the MCU; so really wierd ...
2025-03-07 5:48 AM
@PierreP wrote:the temperature sensor voltage that increase until 2100mV or so when I heat the sensor (which is expected) but then switch ti 690-700 when I continue to heat the sensor. ...
Sounds like a problem with an arithmetic overflow somewhere?
@PierreP wrote:IF I enable other HW subsystem on my module, I can't go above 2100mV, .
What "other HW subsystem" ?
Is it the actual raw reading - direct from the ADC data register - which changes, or your calculated value?
2025-03-07 7:16 AM
A plot of ADC temperature counts vs time would be helpful here. With the "other HW subsystem" enabled and you heat the chip, it goes to 2100 and then drops to 690 when it exceeds a certain temp? Similar to what you'd see in an overflow? Or does it drop smoothly.
> temperature sensor voltage
We're still talking about the internal temperature ADC channel, yes? So you're converting counts to voltages.
Can't see any reason it would drop. Perhaps a bug in the test setup.
This is a STM32L452CCU3, yes?
2025-03-10 12:27 AM
-My implementation relies on the STM32 HAL.
The problem with HAL is that you don't know what they do in their predefined functions. To do proper Firmware development you need to check the registers and verify everything is correct as I already previously pointed out. I also have a few questions for you due to the lack of detail you presented your issues with here.
How do you know that you are using the Temperature channel ADC conversion to calculate the Temperature ?.
How do you know that the temperature you are heating the chip to is below 150 degrees Celsius ? Maximum operating temperature of the MCU ?.
-"The point is not about the conversion and calibration (by the way, after conversion I'm seeing temperature around 20-23C at ambiant so no issue there) "
Have you actually measured the ambient temperature to back the assumption you've made ?. Does your method of calculating temperature in your firmware give the correct results for 10C or 50C or 90C?.
If you haven't verified the above, then your assumption is wrong. Then you can't assume you did things correctly.
How do you know that you're sampling the Temperature Sensor/Internal Channel Slow Enough, have researched these parameters in the Datasheet ?.