2021-03-09 11:46 PM
I'm using an STM32L4 for a solar inverter control project to control some H-bridges and sense some voltage and current. I run into this particular issue that when the environment is noisy (the DC input to the H-bridge is high), the ADC sometimes will freeze. I setup the ADC in DMA mode and the DMA buffer will be filled with the same value despite changes in the analog pin voltage. Interestingly, no error flags of the ADC has been raised and the ADC complete interrupt is still entered regularly. Moreover, all the rest of the program seems to be executing just fine, just that the ADC no longer updates it value. And if I reset the ADC with HAL_ADC_Start_DMA, the ADC will resume the normal updating.
I tried to look at the ADC documentation and GPIO input protection schemes, but nothing seems to point to what I'm seeing. Any thoughts?
Thanks,
Francis
2021-03-10 12:19 AM
> I'm using an STM32L4 for a solar inverter control project to control some H-bridges and sense some voltage and current.
I suspect EMI issues, with the ADC getting spikes beyond VDD.
> I tried to look at the ADC documentation and GPIO input protection schemes, ...
Which supposedly means the MCU is not galvanically isolated.
2021-03-10 10:18 AM
The MCU is not isolated. However the layout is done carefully so that the power ground and digital ground is connected at the connector input far from the MCU. Also, I can scope the ADC input and no amount of noise/spike seem to come close to Vdd. Unless the spike is so high frequency that the scope can't capture it, I don't see how that can affect the MCU.
Either way, I can add some snubber / slow down the switching and the problem will go away. Just curious what's the mechanism behind the ADC value being frozen? And any ways to better protecting the MCU (the power path layout has already been optimized to be pretty tight and the switching ringing really isn't that high)?
2022-05-11 04:38 AM
Hi,
did you find any reason, why it happens ?
The same effect happens in my system too. But only one ADC freezes!
Sometimes the ADC doesn't freeze but only one measurement is out of range being acceptable.