AnsweredAssumed Answered

LPTMR does not count.

Question asked by Evgeny Erenburg on Jun 14, 2018
Latest reply on Jun 17, 2018 by Evgeny Erenburg

I set the LPTMR

 

SIM_SCGC5 |= SIM_SCGC5_LPTIMER_MASK;

 

    /* Reset LPTMR settings */
    LPTMR0_CSR=0;      

    /* Set up LPTMR to use 1kHz LPO with no prescaler as its clock source */
    LPTMR0_PSR = LPTMR_PSR_PCS(1) | LPTMR_PSR_PBYP_MASK;

    /* Set the compare value to the number of ms to delay */
    LPTMR0_CMR = 0xFFFF;

    LPTMR0_CSR |= LPTMR_CSR_TCF_MASK | LPTMR_CSR_TIE_MASK | LPTMR_CSR_TFC_MASK;

    /* Start the timer */
    LPTMR0_CSR |= LPTMR_CSR_TEN_MASK;  

    enable_irq(85);

And I check

time = LPTMR0_CNR;

It's always 0. When I set break point and watch the registers - LPTMR0_CNR = 0x0000.

Outcomes