LPIT counter reset

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

LPIT counter reset

Jump to solution
1,055 Views
AjRj14
Contributor III

Hi, 

I am generating a 10ms ISR using LPIT. 

Also I am capturing a PWM signal in FTM0 channel. I want to reset the LPIT counter whenever an edge is detected in FTM0 channel.

Could you please tell me how can I reset the LPIT counter.

Thanks in Advance.

0 Kudos
1 Solution
1,036 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

When set TROT, the LPIT timer will reload when a rising edge is detected on the selected trigger input.

Timer Control Register.png

Figure 48-7. Case 3 TSOT 0 TROT 1 TSOI 0 CHAIN 0.png

But the trigger source from FlexTimer are FTMx_INIT_TRIG and FTMx_EXT_TRIG
FTMx_INIT_TRIG: counter initialization trigger
FTMx_EXT_TRIG: channel match trigger
These two trigger source from FlexTimer don’t seem to be suitable for your application.

Writing to MISCTRL1[SW_TRG] generates software trigger to peripherals through TRGMUX.

MISCTRL1[SW_TRG].png

But seems using another FTM may more easier: configure another FTM works as simple timer.

Or using LPTMR, software reset the counter in ISR.

Best Regards,
Robin
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
1,037 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

When set TROT, the LPIT timer will reload when a rising edge is detected on the selected trigger input.

Timer Control Register.png

Figure 48-7. Case 3 TSOT 0 TROT 1 TSOI 0 CHAIN 0.png

But the trigger source from FlexTimer are FTMx_INIT_TRIG and FTMx_EXT_TRIG
FTMx_INIT_TRIG: counter initialization trigger
FTMx_EXT_TRIG: channel match trigger
These two trigger source from FlexTimer don’t seem to be suitable for your application.

Writing to MISCTRL1[SW_TRG] generates software trigger to peripherals through TRGMUX.

MISCTRL1[SW_TRG].png

But seems using another FTM may more easier: configure another FTM works as simple timer.

Or using LPTMR, software reset the counter in ISR.

Best Regards,
Robin
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 Kudos
1,025 Views
AjRj14
Contributor III

Thanks very much Robin. 

0 Kudos