LPTMR and Port Interrupts

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

LPTMR and Port Interrupts

1,241 Views
alejandropérez
Contributor II

Hi everybody,

I have a problem with LPTMR and port Interrupts.

If an LPTMR is correctly working and enabling the interruptions of the ports and immediately after,  the interruption occurs, the LPTMR stops working. On the contrary, if enabling the port interruptions, and I wait a second (real, no delay in code), the LPTMR continues working properly.

Why the LPTMR stops working when the interruption occurs inmediately after they have been enabled?

Note1: Impossible to solve with a delay on the code.

Note2: KW41Z and MCUXpresso.

Thanks in advance,
Alejandro Pérez

3 Replies

1,107 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Alejandro Pérez,

To investegate the problme , could you please share your project , so that we can reproduce it .

BR

Alice

1,107 Views
alejandropérez
Contributor II

Thanks for your answer.

The whole project I can not share because of confidentiality issues, I'm sorry.

The question is: according to the MKW41Z/31Z/21Z Reference Manual, the LPTMR always operates even after a reset, but the function that I use (TMR_StartLowPowerTimer) says: "When the timer goes off, call the callback function in non-interrupt context" so there is a problem with the interrupts. How can I guarantee that the LPTMR calls the callback if an interruption is generated immediately after the enablement? Because the LPTMR works properly If the interrups occurs some secons after enabling...

Very strange!

Thanks!

Alejandro

0 Kudos

1,107 Views
alejandropérez
Contributor II

Hi again Alice,

I think I have solved the problem. Everything had to do with "PWRLib_LLWU_DisableAllWakeupSources()" and their wrong use.

Thanks a million for your time.

Alejandro Pérez

0 Kudos