Question
Problem with polling ADC scan mode
Posted on August 10, 2016 at 17:26
Hello.
I have some troubles with ADC scan mode... For example:while (1)
{
uint32_t adc;
HAL_StatusTypeDef err;
HAL_ADC_Start(&hadc1);
for (int i = 0; i < 9; i++)
{
err = HAL_ADC_PollForConversion(&hadc1, 1000);
if (err != HAL_OK)
HAL_Delay(50);
adc = (uint16_t) HAL_ADC_GetValue(&hadc1);
#if (TEST_PRINTS_ADC == 1)
memset(TEST_PRINT, 0, TEST_LENGHT);
sprintf(TEST_PRINT, ''ADC CH%d - %5lu\r\n'', i, adc);
HAL_UART_Transmit(&huart3, (uint8_t*)TEST_PRINT, strlen(TEST_PRINT), 1000);
#endif
}
HAL_ADC_Stop(&hadc1);
}
All pins are configured and ordered in scan rank.
In result I have 2 good convertions and the following gives timeout error.
Does anyone have any clue what might be happening?
https://postimg.org/image/v2rv4661n/
Thank you.
#adc #single-scan #!stm32