Hi, I want to configure the CMP to compare 2 analog inputs and capture a counter value depending on the comparator output, so i did the following:
1.On one hand, i know how to setup the CMP module and trigger an interrupt / put the result in CMP0_OUT.
2. On the other hand, i know how to set the FTM module (counter) in single edge capture mode to capture the counter value given a configured input.
And now, I want to mix these two things together and capture the FTM counter value when the CMP0_OUT is set.
I know that i can set FTM as a trigger source for CMP0_OUT, using TRGMUX like this:
Solved! Go to Solution.
Hi,
If you want to capture the FTM CNT value on an active edge of the CMP0_OUT trigger signal, you can use SIM_FTMOPT1[FTM2CH0SEL, FTM1CH0SEL] to select CMP0_OUT instead of the FTM2_CH0 input, FTM1_CH0 input.
So, the CMP0_OUT signal will be the FTM IC input signal of the corresponding channel.
FTM0 does not support the feature though.
Regards,
Daniel
Thanks for the reply
Hi,
If you want to capture the FTM CNT value on an active edge of the CMP0_OUT trigger signal, you can use SIM_FTMOPT1[FTM2CH0SEL, FTM1CH0SEL] to select CMP0_OUT instead of the FTM2_CH0 input, FTM1_CH0 input.
So, the CMP0_OUT signal will be the FTM IC input signal of the corresponding channel.
FTM0 does not support the feature though.
Regards,
Daniel