Thank you Ruben, It has been observed and modified see line 72.
FTM2-> CONTROLS [4] .CnV = FTM_CnV_VAL (period [3]);
Where I get the value that would go to channel 3 and send to channel 4 that is associated with pin 8 of tssop. This code works, debug and enable the reset and run option after programming the microcontroller.
However it does not execute without giving the reset and run by command of the debug. The problem must be in the way I'm handling the timer and pwm. I'll be making changes in this deal.