Hi, Shaul,
If you develop FTM code, it is okay to use PE, SDK or writting FTM register directly as an5142, all of them can implement your application. But If you want to use SDK, I suggest you use the latest SDK2.0 instead of SDK1.3, the SDK2.0 is simpler and easy to understand.
for capture function, you should connect the external signal to FTM_CHx pin, and use the following function to configure the FTM pin in capture mode. in the ISR of FTM, you can read the FTM_CnV register. When the predefined edge of external signal on the FTM_CHx is detected, the current FTM counter value is latched to FTM_CnV register, at the same time, an interrupt of FTM happens.
Hope it can help you.
BR
Xiangjun rong
SDK2.0 capture function:
@brief Enables capturing an input signal on the channel using the function parameters.
*
* When the edge specified in the captureMode argument occurs on the channel, the FTM counter is
* captured into the CnV register. The user has to read the CnV register separately to get this
* value. The filter function is disabled if the filterVal argument passed in is 0. The filter
* function is available only for channels 0, 1, 2, 3.
*
* @param base FTM peripheral base address
* @param chnlNumber The channel number
* @param captureMode Specifies which edge to capture
* @param filterValue Filter value, specify 0 to disable filter. Available only for channels 0-3.
*/
void FTM_SetupInputCapture(FTM_Type *base,
ftm_chnl_t chnlNumber,
ftm_input_capture_edge_t captureMode,
uint32_t filterValue);