I'm trying to use the three input XOR function of FTM2 in input capture mode on a KV11Z128 to measure the speed of a BLDC motor. I have the three hall effect sensor signals wired to PT_A1, PT_A2, and PT_D7. Those three ports are configured to be internally connected to the FTM2_CH0, FTM2_CH1, and FTM1_CH1 inputs. The bit in SIM_SOPT4 is set. FTM2 is configured for input capture on both edges of the input signal. I'm getting captures and the associated interrupts on only 4 of the 6 transitions of the hall inputs. I have verified that all three signals are present and sequencing correctly both with an oscilloscope and by examining the GPIO port bits when the debugger breaks after advancing the motor one phase of the six phase sequence. The behavior is slightly different depending on the sequence direction.
The sequence on the inputs (D7/A2/A1) with CW rotation is 1,5,4,6,2,3 and I get a capture on the transitions between phases except from 2 to 3 and from 5 to 4. With CCW rotation the sequence is reversed and all transitions except 3 to 2 and 4 to 5. The problem occurs no mater what speed the motor is running including about one magnetic rotation per second and several hundred RPS. The missing captures and channel interrupts are very consistent.#
I even verified that the Port Pin Control Register Mux values are correct for the three inputs I'm using and I checked that none of the other possible ports that can connect to FTM2_CH0, FTM2_CH!, and FTM2_CH1 are in conflict.
The program is running on a FRDM-KV11Z board which has a MKV11Z128 processor and I'm using KDS 3.2 with SDK 1.3 and Processor Expert.
The functionality I'm trying to used was discussed (for a KV58) here: Hall Sensor implementation with KV5x
What could be causing this?