LPTMR in K60

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPTMR in K60

960 Views
renka
Contributor II

I've working with TOWERK60.I have a question about  the low power timer.

From the K60P144M100SF2RM i know that LPTRM works in all low power modes and LPTMR compare register alters only when TCF flag is set (if LPTMR is enabled of course).

Could you explain the following phrase from the document: 

"When the LPTMR is enabled, the LPTMR compare register can only be altered when the
timer compare flag is set. When updating the LPTMR compare register, the LPTMR
compare register must be written and the timer compare flag must be cleared before the
LPTMR counter has incremented past the new LPTMR compare value. "

 

My target is  - to set the new value into LPTMR compare register,when LPTMR is enabled and LPTMR counter register NOT equal to current LPMT compare register (in the middle of the way).Is it possible?

Thanks!!!!

0 Kudos
2 Replies

414 Views
alessandromorni
Contributor III

Hi,

I'm trying to achieve the same target (changing the achieve LPTMR compare register in the middle of the way w/o stopping the timer). How did you resolve?

Using the LPTMR as free-running counter, is it possible doing it? From datasheet it seems that the answer is NO: but what would be the side effects?

Alessandro

0 Kudos

414 Views
DarthVader_worl
Contributor I

Hi, you could do that but in order to set the value in the compare register you need to activate the TC flag which will reset the counter. So You will be able to modify the compare but the counter will be reset.

 

I think that if you use the free running mode of the lptmr, instead of being reset once you activate the TC flag, it only is reset when it overflows so maybe you can modify the compare value without reseting the counter.

 

hope it helps!

X.

 

 

0 Kudos