Skip to main content
user 143
Associate III
February 2, 2022
Question

STM32L4 ADC does not stop

  • February 2, 2022
  • 2 replies
  • 1040 views

Hello,

According to the Reference Manual of the STM32L431 controller, the ADSTP in the ADC_CR register must be set to 1 to stop the ADC. Additional condition is that both ADSTART=1 and ADDIS=0 must be. Once the ADC is stopped, the ADSTP bit is cleared from the hardware.

The problem with me is that this sporadically does not work. The ADSTP bit never becomes 0, no matter how long I wait. Since the L431 has only one ADC, but I have two different measurement situations, I have to reconfigure the ADC again and again. This works e.g. 1000x, but then at the 1001st attempt the ADC does not stop.

Does anyone have an idea what this could be?

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
February 2, 2022

Read out and check/post ADC registers content when this happens.

JW

user 143
user 143Author
Associate III
February 3, 2022

So, I already found the mistake. I thought, the ADSTART bit was set, but it was not set. So now I check first if the bit is set, and stop then when neccesary.