FTM Dual-Edge Input Capture

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

FTM Dual-Edge Input Capture

729 Views
jefflfree
Contributor III

I am using the frdm-KV11Z board and I am specifically using the FTM to do some measurements.

I have an application where I need to sample 6 inputs consecutively with dual-edge capture mode so that I can measure the pulse width.

I have been able to get three by doing some pin muxing between each measurement. I leveraged the following code from the SDK dual-edge example:

edgeParam.mode                        = kFTM_Continuous;
edgeParam.currChanEdgeMode = kFTM_RisingEdge;
edgeParam.nextChanEdgeMode = kFTM_FallingEdge;
FTM_SetupDualEdgeCapture(FTM0, kFTM_Chnl_1, &edgeParam, 0);
FTM_EnableInterrupts(FTM0, kFTM_Chnl2InterruptEnable);
FTM_EnableInterrupts(FTM0, kFTM_Chnl3InterruptEnable);

Above, I am using 3 channels (1, 2, 3) to do the dual-edge capture.

However, I found that I cannot extend this to other channels combinations for FTM0 (for example: 0,1,2 or 2,3,4).

Any advice?

Jeff

Tags (1)
0 Kudos
1 Reply

566 Views
jefflfree
Contributor III

Nevermind everyone. I figured it out.

The second argument to the FTM_SetupDualEdgeCapture is the channel pair number.

                  Actual

Channel    Channels

Pair           Used

0                0,1

1                2,3

2                4,5

3                6,7

So no need to reply.

Jeff

0 Kudos