Hi,
Easiest way is to use one of the motor control modules:
1. FlexPWM
2. eTimer
You can find example codes here:
https://community.nxp.com/docs/DOC-329623
regards,
Peter