cancel
Showing results for 
Search instead for 
Did you mean: 

ADC on the STM32WL5MOC module not working

JoeGordon
Associate

Hi Community!

Currently working with the STM32WL5MOC module on my custom board.

I'm trying to work with the ADC but getting values like the fallowing and not changing even when i connect the ADC signal to ground. 

light: 1366
light: 1367
light: 1367
light: 1366
light: 1367

I'm using default configuration for the ADC, and using the STM32cube

this is the code I'm using 

  while (1)
  {
  HAL_ADC_Start(&hadc);
  HAL_ADC_PollForConversion(&hadc, HAL_MAX_DELAY);
     lux = HAL_ADC_GetValue(&hadc);
     sprintf(msg, "light: %hu \r\n",lux);
     HAL_UART_Transmit(&huart2, (uint8_t *)msg, strlen(msg), HAL_MAX_DELAY);
     HAL_Delay(500);
  }

 

Thanks in advance

1 REPLY 1
STTwo-32
ST Employee

Hello @JoeGordon 

Are you using our B-WL5M-SUBG1 or another design. If another design, please take care of any potential design issues. If it is our design, please send your full project here.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.