Skip to main content
Graduate II
September 15, 2025
Solved

STM32G0x ADC CFGR1 clears Resolution bits on EXTSEL bit modification

  • September 15, 2025
  • 2 replies
  • 301 views

Hi, 

 

When I clear the EXTSEL bits in the ADC1 CFGR1 register, my resolution bits also get cleared ?. My ADC randomly changes resolution. Below is screenshots of the code. 

danielbathtub_0-1757929118143.png

 

Why does this happen ?, I can disable the ADC to write the RES bits to what they were. Don't really want to do that unless I have to. 

    This topic has been closed for replies.
    Best answer by KDJEM.1

    Hello @danielbathtub ;

     

    When you writing any bits in the ADC_CFGR1 register of STM32G0x while the ADC is enabled (ADEN bit set), the RES[1:0] (resolution) bits are reset. This behavior is documented in STM32G0 errata sheets like as in STM32G050 errata sheet.

    KDJEM1_0-1757942377138.png

     

     

    Thank you.

    Kaouthar

     

    2 replies

    KDJEM.1Answer
    Technical Moderator
    September 15, 2025

    Hello @danielbathtub ;

     

    When you writing any bits in the ADC_CFGR1 register of STM32G0x while the ADC is enabled (ADEN bit set), the RES[1:0] (resolution) bits are reset. This behavior is documented in STM32G0 errata sheets like as in STM32G050 errata sheet.

    KDJEM1_0-1757942377138.png

     

     

    Thank you.

    Kaouthar

     

    ST Employee
    September 15, 2025

     

    Hi danielbathtub,                                                                                                                                                           The issue is already documented in Errata sheet ES0545 - Rev 3 that when modifying the ADC_CFGR1 register while ADEN bit is set  will resets RES[1:0] bit . A workaround is proposed for that.                                                          Mariem