The Low-Power Timer in the KM34

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

The Low-Power Timer in the KM34

652 Views
小勇邹
Contributor II

Hi,

I want to use the Low-Power Timer as a period timer in my application.After setting the value of the register LPTMR_CMR, is there any formula to caculate the period time??How to caculate  it??

Labels (1)
0 Kudos
3 Replies

517 Views
mjbcswitzerland
Specialist V

Hi

The value of the delay (in seconds) is
#define LPTMR_S_DELAY(s_delay) (s_delay * LPTMR_CLOCK) - 1)
whereby the value of LPTMR_CLOCK depends on where you configure it to be taken from; it can be 1000 (LPO), 32768Hz, 4Meg or 32kHz MCGIRCLK, external clock value or external clock value divided by a prescaler.

Regards

Mark
Kinetis for professionals: http://www.utasker.com/kinetis.html

0 Kudos

517 Views
小勇邹
Contributor II

Hi,

Thank you.

What is the minimum value of the period time? Is it possible to set the period as 1us?

0 Kudos

517 Views
mjbcswitzerland
Specialist V

The minimum delay depends on your clock.
If you use the LPO (1kHz) the minimum delay is 1ms (with value of 0)
If you use the 4MHz IRC you can set 250ns steps - 1us would be a value of 3 in this case.

Regards

Mark

0 Kudos