Skip to main content
amoli.1
Associate II
December 5, 2023
Solved

U5 ENCODER in STOP2 does not update count

  • December 5, 2023
  • 4 replies
  • 1353 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.

4 replies

Sarra.SBest answer
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.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
amoli.1
amoli.1Author
Associate 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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.