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??
Solved! Go to Solution.
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
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
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.