We are reading Internal Temperature Sensor reading of STM32-F410RB - NUCLEO 64 Board.
Problem:
Getting the reading of Temperature sensor every 1 second as programmed, but the same readings are got. Only when Reset is done, the Temperature Reading get updated
Current Setup
- Windows 10 64bit
- STM32 Nucleo 64 - F410RB
- Using CubeMX IDE
- PuTTy for Serial Monitoring
STM32 CUBE MX IDE Configurations Done
- System Core - Serial Wire
- Analog - ADC1 - Enabled Temperature Sensor Channel
Parameter Settings - ADC Setting - Scan Conversion & Continues Conversion Enabled Rank - Sample Time - 480 Cycles - USART2 - 9600 Baud Rate
CODE Snippet of Main
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_USART2_UART_Init();
MX_ADC1_Init();
HAL_ADC_Start(&hadc1);
while (1)
{
uint16_t readValue;
float tCelsius;
readValue = HAL_ADC_GetValue(&hadc1);
tCelsius = ((float)readValue) * 3300.0 / 4095.0; // To mV
tCelsius = (tCelsius - 500.0) / 10.0; // To degrees C
UART_SEND_TXT(&huart2, "Temperature = ", 0);
UART_SEND_FLT(&huart2, tCelsius, 1);
HAL_Delay(1000);
}
}
Please kindly help. Thanks in Advance.