Hi,
I'm currently working on a project using a MKE14Z128 and want to measure the RPM of two fans. Tach output of fan 1 is connected on FTM2_CH0 input pin while fan 2 tach output is connected to FTM2_CH2 input pin. I've configured FTM2 CH0/CH1 and FTM2 CH2/Ch3 in dual edge capture.
I'm getting tach readings from fan 1 with no issues but tach reading from fan 2 always reads 0. After some ruling out HW problems I've investigated the initialization procedure and realized that the COMBINE register is configured configured correctly for CH0/CH1 dual edge capture, CH2/CH3 is not:
The following codes is called to do the initialization:
If I single step into the second FTM_SetupDualEdgeCapture() method call (for kFTM_Chnl_2) it seems that the upper 16bits of the COMBINE register do not change at all. Even if I'm using MCUXpresso debugger to manually change any bits in the 15:31 interval of the COMBINE register it always comes back as 0. Hence, dual edge capture cannot be enabled for CH2/CH3. Is this how it is suppose to be, i.e., dual edge capture can only be done from CH0/CH1 of the FTM2 module and not using CH2/CH3 ?
Thx,
LM
Hi isa_leo,
FTM channel pair used for the dual-edge capture, channel pair 1(kFTM_Chnl_1) uses channels 2 and 3
Do not use kFTM_Chnl_2
chnlPairNumber | The FTM channel pair number; options are 0, 1, 2, 3 |
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.
-------------------------------------------------------------------------------