Skip to main content
Explorer
April 20, 2024
Solved

STM32F7 reads 4095 on all ADCs for the first 2.3 seconds after power on but not after reset

  • April 20, 2024
  • 2 replies
  • 1705 views

Hi, I'm using STM32F767ZG on a development board (Fusion for STM32 V8 by Mikroelectronica).

 

My problem is that all ADCs will read 4095 for the first 2.3 seconds after power on. If I perform a reset on the uC, they read correctly from the first read. Also, if I power down, hold the reset button, then power on and wait ~3 second and then release the reset button, they will read fine immediately.

 

I suspect that the analog reference voltage on the uC on the board has an issue stabilizing quick enough, but 2.3 seconds seems waaaay too big.

 

Sample code:

ADC_ChannelConfTypeDef sConfig = {0};
hadc1.Instance = ADC1;
hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2;
hadc1.Init.Resolution = ADC_RESOLUTION_12B;
hadc1.Init.ScanConvMode = DISABLE;
hadc1.Init.ContinuousConvMode = ENABLE;
hadc1.Init.DiscontinuousConvMode = DISABLE;
hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
hadc1.Init.NbrOfConversion = 1;
hadc1.Init.DMAContinuousRequests = DISABLE;
hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV;
HAL_ADC_Init(&hadc1);

sConfig.Channel = ADC_CHANNEL_TEMPSENSOR;
sConfig.Rank = 1;
sConfig.SamplingTime = ADC_SAMPLETIME_3CYCLES;
HAL_ADC_ConfigChannel(&hadc1, &sConfig);

HAL_ADC_Start(&hadc1);
HAL_ADC_PollForConversion(&hadc1, HAL_MAX_DELAY);
voltage_adc = HAL_ADC_GetValue(&hadc1); // Always 4095 for the first 2.3 seconds

    This topic has been closed for replies.
    Best answer by Tech_Engineer

    Yup is the analog reference voltage as I suspected. I can't believe a development board has an issue like this. Case closed.

    2 replies

    Super User
    April 20, 2024

    Hi,

    did you check ( with a scope ) the AVDD and AREF voltages and their rise time ?

    +

    same for ADC input (at pin) you convert .

    Tech_EngineerAuthorAnswer
    Explorer
    April 21, 2024

    Yup is the analog reference voltage as I suspected. I can't believe a development board has an issue like this. Case closed.