cancel
Showing results for 
Search instead for 
Did you mean: 

Setting register to restart counter

GFont.1
Associate III

Hi, I have never work with register. I need to restart counter of LPTIM in stm32l431. The documentation says that I need to set a register to '1'. The image explain this. How I can do that? Thank's a lot.0693W000001t9q0QAA.png

2 REPLIES 2

Look at the LPTIM_CR.RSTARE bit

LPTIM1->CR |= (1 << 4); // RSTATE

rdcnt = LPTIM1->CNT; // Now implicitly clears, ie reads current value and resets

Presumably LPTIM1->CNT = 0 would work too.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Doesn't appear to be avalable on 'L431.

0693W000001tA3sQAE.png

JW