2010-04-22 09:37 AM
STM8L Internal temperature Sensor
#stm8l-temperature-sensor2011-05-17 06:08 AM
The ADC uses the VREF input as its reference in my case AVDD (+3V3).
The device has an internal bandgap which can be connected to the input for scaling measurements. This is 1.23v nom so no I would not expect fullscale.
I have discovered two things :-
1) You need to wait 10uS after powering up the internal VRef before it is stable. This delay gives me sensible readings.
2) The datasheet has a typographical error. The temperature sensor produces 1.62mV / Deg K not 1.62mV/DegC. When calculating the temperature you need to subtract 273.15 !
2011-05-17 06:08 AM
That's a 12-bit A/D, right? Which would make your A/D counts range 0 - 4095. Wouldn't you expect to see maximum counts when you apply your Vref+ to the A/D? The A/D values that you got back don't seem correct.
2012-05-28 05:08 AM
Hello
I have searched for any application note to calculate microcontroller temperature but I have not found any information.Does anybody have a function to get the microcontroller temperature?, in that case could anybody share the source code?.Thank you un advance.Regards