Hi XiangJun,
Thanks for your help. I have been working on this and have got it to the following state. I use FTM0 to carry out edge aligned complimentary pwm on the first 6 channels. I have the ISR for FTM0 set to a priority level of 1. I have a PIT which is interrupted every 100ms. I have a gpio pin set to interrupt on a falling edge with a priority of 4 (I use this as a switch to set a motor running state). The problem I am experiencing now is that when I set the state to motor running the gpio interrupt does not work anymore and the motor keeps running without a way to stop it (other than reset or remove power). When the motor doesnt have any power and I change this gpio state I can keep changing it even though in software the same FTM0 pwm code should be running since the motor running state is being set and reset. I am not sure if this is a priority issue or something else.
Also when commutating the motors I read their state in the FTM0 isr and if the state has changed I commutate using the following function, FTM_UpdatePwmDutycycle(FTM0, 1, kFTM_EdgeAlignedPwm , duty_cycle);
with the channel changing according to the rotor position.
Thanks,
Rahul