Skip to main content
CBuek.1
Associate II
Oct 5, 2020 7:44 AM UTC
Solved

STM32L433CCU6 ADC problem (China PCBA)

Hi everyone, my project using STM32L433ccu6 MCU (PCBA from china). ADC value read out freeze 2048 (0x0800) , but in my prototype with component from Digikey or Arrow everything ok. And I try to replace MCU I bought from Digikey to PCBA board , It's work !!!!

Who has the same problem?

Thanks,

Chatchai B.

This topic has been closed for replies.
CBuek.1
CBuek.1Best answer
Associate II
Feb 23, 2021 4:31 AM UTC

Hi, I have solved.

Solved by add HAL_ADC_Stop(&hadc1);

But I'm still confused why some parts can work perfectly some parts not work.

HAL_ADC_Start(&hadc1);

if (HAL_ADC_PollForConversion(&hadc1, 1000) == HAL_OK) {

result_adc = (uint16_t) HAL_ADC_GetValue(&hadc1);

HAL_ADC_Stop(&hadc1); // add line for ADC stop

} 

Thanks.

2 replies

TDK
Oct 5, 2020 1:10 PM UTC

Well, if you replace the MCU and run the same code and it gets fixed, the MCU was probably bad. ADC can be damaged by inputs outside the allowable range. Although 2048 is an odd value for it to report. Could be some other hardware issue.

"If you feel a post has answered your question, please click ""Accept as Solution""."
CBuek.1
CBuek.1AuthorBest answer
Associate II
Feb 23, 2021 4:31 AM UTC

Hi, I have solved.

Solved by add HAL_ADC_Stop(&hadc1);

But I'm still confused why some parts can work perfectly some parts not work.

HAL_ADC_Start(&hadc1);

if (HAL_ADC_PollForConversion(&hadc1, 1000) == HAL_OK) {

result_adc = (uint16_t) HAL_ADC_GetValue(&hadc1);

HAL_ADC_Stop(&hadc1); // add line for ADC stop

} 

Thanks.