Skip to main content
Visitor II
November 25, 2024
Question

ADC on the STM32WL5MOC module not working

  • November 25, 2024
  • 1 reply
  • 515 views

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

STTwo-32
Technical Moderator
December 18, 2024

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