Skip to main content
Visitor II
December 5, 2023
Solved

U5 ENCODER in STOP2 does not update count

  • December 5, 2023
  • 2 replies
  • 1320 views

I'm using NUCLEO U575ZI with LPTIM1 configured as Quadrature ENCODER with 32kHz internal clock

In RUN mode peripheral works properly but when I switch in STOP2 mode peripheral doesn't count.

I can assume the peripheral is powered ON because when I exit STOP2 counter value is steel the same before entering STOP2.

I'm also using L4 and it works properly in RUN and STOP2 mode.

Any idea to solve the problem?

 

Alex

    This topic has been closed for replies.
    Best answer by Sarra.S

    Hello @amoli.1 

    Try to set the LPTIM1AMEN bit in the RCC_SRDAMR register to enable autonomous mode in stop mode.

    You can use the __HAL_RCC_LPTIM1_CLKAM_ENABLE() macro to do this.

    2 replies

    Sarra.SAnswer
    ST Employee
    December 5, 2023

    Hello @amoli.1 

    Try to set the LPTIM1AMEN bit in the RCC_SRDAMR register to enable autonomous mode in stop mode.

    You can use the __HAL_RCC_LPTIM1_CLKAM_ENABLE() macro to do this.

    amoli.1Author
    Visitor II
    December 5, 2023

    WORKS!!!!!!!

    Thank you so much

     

    Alex

    ST Employee
    December 5, 2023

    No, that's not implemented in CubeMX

    The thing is if you're using LP peripherals in STOP mode, always check to see if you should be setting bits in the RCC SmartRun domain peripheral autonomous mode register