cancel
Showing results for 
Search instead for 
Did you mean: 

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

Tech_Engineer
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Tech_Engineer
Associate II

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

View solution in original post

2 REPLIES 2
AScha.3
Chief III

Hi,

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

+

same for ADC input (at pin) you convert .

If you feel a post has answered your question, please click "Accept as Solution".
Tech_Engineer
Associate II

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