Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hello,
I need to read internal temperature of STM32F767 chip (Nucleo STM32F767 board) using ADC 1. The code is as follows:
include the mbed library with this snippet
#include "mbed.h" Serial pc(SERIAL_TX, SERIAL_RX); AnalogIn int_temp(ADC_TEMP); main() { float voltage = int_temp.read() * 3.3; // temperature =( Measured voltage - voltage at 25 C)/Slope + 25 as mentioned in page 464 of reference manual temp = ((voltage - 0.76)/2.5) + 25; printf("Temp = %f",temp); } /* Temperature (in °C) = {(VSENSE – V25) / Avg_Slope} + 25 Where: – V25 = VSENSE value for 25° C – Avg_Slope = average slope of the temperature vs. VSENSE curve (given in mV/°C or μV/°C) */The temperature reading varies between 25.01 and 25.02 deg C even if the chip is hot. Am I doing anything wrong? How to read the internal temperature?