How to change resolution of LPTMR

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

How to change resolution of LPTMR

455 Views
alexwilson
NXP Employee
NXP Employee

I have a customer with the following question for the KV31, but it may be a more generic Kinetis question:  "

The LPTMR timer is limited to 1ms resolution. It has a minimum value of 4ms (tick_count <= 1 test).  The CPU_LPO_CLK_HZ is currently 1000U.

I need to reconfigure the LPTMR time for 0.5ms resolution with a minimum value 2ms.

What is the best way to do this?"

Labels (1)
0 Kudos
1 Reply

310 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Alex,

The resolution of LPTMR is dependent on the clock source frequency which the LPTMR counts.

I have checked the LPTMR clock source, the maximum clock source for LPTMR is 25mhz, pls refer to setion 2.3.1 Device clock specifications in data sheet of KV31. Obviously, if you have the LPTMR to count tick which is less than 25MHz, it is okay.

Pls refer to section 3.8.4.1 LPTMR prescaler/glitch filter clocking options, the clock source of LPTMR can be:

MCGIRCLK: 4MHz internal clock

LPO:1khz clock

ERCLK32K: 32KHz external clock

You can select the MCGIRCLK, ERCLK32K(if you use external 32KHz external crystal or 32KHz clock source) as clock source. Furthermore, you can use external clock source and connect the external clock source to LPTMR_ALT1 or LPTMR_ALT2 or LPTMR_ALT3, it is okay.

Hope it can help you

BR

XiangJun Rong

0 Kudos