How to count external events with flex timer Module [K64F+KDS]

cancel
Showing results for 
Search instead for 
Did you mean: 

How to count external events with flex timer Module [K64F+KDS]

Jump to solution
1,470 Views
hunt
Contributor II

Good morning,

I don't know if this is the correct section fow asking this question.

 

I have a FRDM k64F board and I wanted to count external event (the rising edges of an external square-wave).

I wanted to connect it to FTM2_CH0  (also PTB18) as input, so I tried with processor Expert to instantiate the component EventCntr_LDD but is impossible to select such pin,

I can only select the clock_in pins (PTB16, PTB17, PTA18, PTA19)....

How can I do it??

 

16606_16606.jpg1.jpg

Labels (1)
0 Kudos
1 Solution
263 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello hunt.

If you want to count external events (rising edges of a signal) you must use an FTM counter with an external clock pin selected. The FTM channels contain compare registers only (there are not counters) and these channels cannot be used for counting external events (you can use FTM channel in input capture mode only - the counter value is capture on external event - see the detailed description in the K64 Sub-Family Reference Manual).
Therefore you can use the EventCntr_LDD component and select one of the Counter input pin only (PTB16, PTB17, PTA18, PTA19) to count external events (FTM channels are not used in this mode). This is the standard functionality that is provided by the FTM.



====================================

if this answer helps, please click on "Correct Answer " button. thanks!



Best Regards,

Zhang Jun

View solution in original post

0 Kudos
2 Replies
264 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello hunt.

If you want to count external events (rising edges of a signal) you must use an FTM counter with an external clock pin selected. The FTM channels contain compare registers only (there are not counters) and these channels cannot be used for counting external events (you can use FTM channel in input capture mode only - the counter value is capture on external event - see the detailed description in the K64 Sub-Family Reference Manual).
Therefore you can use the EventCntr_LDD component and select one of the Counter input pin only (PTB16, PTB17, PTA18, PTA19) to count external events (FTM channels are not used in this mode). This is the standard functionality that is provided by the FTM.



====================================

if this answer helps, please click on "Correct Answer " button. thanks!



Best Regards,

Zhang Jun

0 Kudos
263 Views
hunt
Contributor II

Thank you very much, for your help.

The problem of the clock pins (it was my first choice) is that any of these pins, is connected to the output connector (please correct me if I'm wrong)

I solved using the LPTMR unit that allows counting events using the PTC5 pin (LPTMR0_ALT2).

Anyway, thank you again for your help. 

0 Kudos