I found the most effective way to synchronize two FTM modules whose moduli are related by an integer multiple is to use the Global Time Base.
For example to synchronize FTM0 (MOD = 4095) and FTM3 (MOD = 65535, free-running):
1. Initialize the FTM counters you wish to synchronize
FTM_Init(FTM_0_PERIPHERAL, &FTM_0_config);
FTM_Init(FTM_3_PERIPHERAL, &FTM_3_config);
where the config struct for both FTM0 and FTM3 includes the following:
const ftm_config_t FTM_0_config = {
// make sure to set the config option:
.useGlobalTimeBase = true
};
2. enable the clock source for both modules
FTM_StartTimer(FTM_0_PERIPHERAL, kFTM_SystemClock);
FTM_StartTimer(FTM_0_PERIPHERAL, kFTM_SystemClock);
(note: this doesn't actually start the FTM counters, it just sets them in a "ready" state to await the Global Time Base start trigger).
3. set the Global Time Base output
FTM_SetGlobalTimeBaseOutputEnable(FTM_0_PERIPHERAL, true);
I found that only FTM0 can serve as the master GTB out source (I am using a K64).