Skip to main content
GFont.1
Associate III
July 19, 2020
Question

Setting register to restart counter

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

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
July 19, 2020

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
waclawek.jan
Super User
July 19, 2020

Doesn't appear to be avalable on 'L431.

0693W000001tA3sQAE.png

JW