Hi Reena Patel ,
You can realize 1 minute, because the LPTMR is 16 bit counter, the max counter is 65536, and you choose LPO=1ms as the LPTMR clock source, then the max time you can realize is 1ms*65536=1.09 minute.
So, if you want to increase the time, it's easy, you totally can use the LPTMRx_PSR[PRESCALE]=16, then your clock source will be 16*1ms=16ms. Then the mas time should be:16*65536=17.47 minute, larger than your 15 minutes.
If you want to get 15minutes, you can define the compare register CMR.
(CMR+1)*16=15*60*1000=>CMR=56249
So, now, please modify your code:
LPTMR0_PSR[PRESCALE] =3:Prescaler divides the prescaler clock by 16; glitch filter recognizes change on input pin after 8 rising clock edges.
LPTMR0_CMR[COMPARE]= 56249;
You can try it on your side.
Wish it helps you!
If you still have question about it, please kindly let me know.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------