10 years ago.

Reading the temperature sensor and the internal voltage reference

Is it possible to use AnalogIn() or some other high level API to read the temperature sensor, or do I need to access the registers directly? AnalogIn() takes a pin name as a value, but there are no pins for the temp sensor and VREFINT.

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F030R8T6 microcontroller.

Which temp sensor do you plan to use ? I use LM35 and LM60 using analogIn(AnalogPin) and it works. I used Nucleo and FRDM. Both gave me the correct temp reading.

HTH

posted by samira samilan 01 Apr 2014

I plan to use the STM32F030R8T6's internal temp sensor. It is connected to ADC Channel 16.

posted by Pekka Ahmavuo 02 Apr 2014

I decided to publish an example of how to do this. I am working on a mod that will simplify the declarations within mbed and make it more user friendly. My code is here: https://developer.mbed.org/users/sixBase3/code/Nucleo_read_analog_value_intADCch/

posted by Bill Bellis 31 Mar 2016

1 Answer

10 years ago.

The ST processors have a internal temp sensor connected to the ADC. You can use the cmsis interface. Much easier than direct register access. Load the mbed-src lib and look into stm32f0xx_adc.c There you can find ADC_TempSensorCmd(ENABLE); ...

Accepted Answer

Thanks! The internal temp sensor was what meant, although I didn't clearly express that in my question.

posted by Pekka Ahmavuo 02 Apr 2014