embassy icon indicating copy to clipboard operation
embassy copied to clipboard

stm32:`degrade_adc` drops `OpAmpInternalOutput` turning `opampen` off

Open Wassasin opened this issue 4 months ago • 0 comments

The trait AdcChannel method degrade_adc consumes self, and in the case of op-amps causes set_opampen(false) to be called in Drop. When then sampling the internal line you get noise.

To work around this you can turn the opamp back on after degrading like so

  embassy_stm32::pac::OPAMP1
      .csr()
      .modify(|w| w.set_opampen(true));

Already discussed in Matrix, this is just an issue to keep track and help others googling for it.

Wassasin avatar May 30 '25 13:05 Wassasin