cancel
Showing results for 
Search instead for 
Did you mean: 

Reading ADC with STM32H750 Discovery Kit

RHerg.1
Associate

i want to read out a single ADC (temperature sensor) via polling method and want to display the result on the Display. On the backside of the board are some standard arduino connectors, i used them to connect the temperature sensor (CN7 -> A0 -> PC0 ).

The problem is, that it is not working despite i used only standard code in the default task for reading it:

0693W00000QKRjXQAX.png

void StartDefaultTask(void *argument)
{
  /* USER CODE BEGIN 5 */
    uint16_t adcvalue;
  /* Infinite loop */
  for(;;)
  {
 
 
      HAL_ADC_Start(&hadc1);
      HAL_ADC_PollForConversion(&hadc1, 100);
      adcvalue = HAL_ADC_GetValue(&hadc1);
      HAL_ADC_Stop(&hadc1);
 
    
 
      int resolution = 4096;
 
 
     resistance1 =  10000*((adcvalue/(double)resolution)/(1-(adcvalue/(double)resolution)));
 
 
      Temp1 = 1/((1/298.15)+((double)1/3435)*log((double)resistance1/10000));
 
 
 
      Temp1 = Temp1 - 273.15;
 
 
    
      osDelay(20);
  }
  /* USER CODE END 5 */
}

1 REPLY 1
RHerg.1
Associate

Hello, i don't want to read out the internal temperature Sensor. I want to read 3 external Sensors, but first i started with 1 sensor.