This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-AM243: Timer ISR Configuration in Compare mode functionality

Part Number: LP-AM243

Hi,

I've configured Timer ISR in compare mode, and expecting ISR to hit every time when TCRR and TMAR value gets matched.

After ISR got hit, what will be the value of TCRR ?

whether TCRR value will be Reloaded/reset to value present in TLDR register or it will keep counting until overflow value(0xFFFF FFFF).

Thank you

  • Hi Kathiravan,

    My understanding is that the TCRR value will keep counting when the ISR hits and the based on the ISR, action can be taken to reset the count in TCRR.

    Thanks,

    Anita

  • Hi,

    How to reset the TCRR value to the value present in TLDR? 

    I tried by writing TTGR register but I'm not able to load the TLDR value into the TCRR value.

    whenever TCRR overflow occurs that time only TCRR is getting loaded by TMAR value. But I want to load the value TCRR value whenever TMAR value getting matched and ISR triggered.

  • Hi Kathiravan,

    In that case, you do not need the TMAR (compare mode) at all. You just need to set the timer to be autoload and the TLDR to 0xFFFFFFFF - TLDR equals to the number of timer counts you preferred. This way, the overflow interrupt will happen every time when the desired period passed, and the autoload will reload the TCRR with TLDR automatically. The process will repeat forever.

    All you need here is the overflow interrupt which happens whenever the specified time period passed. That is actually how the system time for RTOS is implemented.

    Best regards,

    Ming