FTM Dual-Edge Input Capture

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FTM Dual-Edge Input Capture

751 次查看
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

标记 (1)
0 项奖励
1 回复

588 次查看
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 项奖励