cancel
Showing results for 
Search instead for 
Did you mean: 

U5 ENCODER in STOP2 does not update count

amoli.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Sarra.S
ST Employee

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.

View solution in original post

4 REPLIES 4
Sarra.S
ST Employee

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.

WORKS!!!!!!!

Thank you so much

 

Alex

Question:

Is there a check in CUBE_MX that can help to make this option automatically available or settable in CUBE_MX?

 

Alex

Sarra.S
ST Employee

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.