An update from previous comment.
I have narrow it down to the following:
PWM (100Hz period, variable duty cycle and initial polarity set to HIGH).
PWM has events: OnEnd, BeforeNewSpeed and AfterNewSpeed.
Microprocessor having two speeds (high = 4.2 MHz, low = 1.05 MHz).
Every time a change of speed is required (Cpu_SetHighSpeed or Cpu_SetLowSpeed), after adjusting CPU registers, it goes to the PWM code:
void Pulse_SetHigh(void)
{
(void)TPM2SC; /* Start clearing sequence of TOF bit */
/* TPM2MOD: BIT15=1,BIT14=0,BIT13=1,BIT12=0,BIT11=0,BIT10=0,BIT9=1,BIT8=1,BIT7=1,BIT6=1,BIT5=0,BIT4=1,BIT3=0,BIT2=1,BIT1=1,BIT0=0 */
setReg16(TPM2MOD, 0xA3D6U);
SetRatio(); /* Calculate and set up new values of the compare according to the selected speed CPU mode */
HWEnDi(); /* Enable/disable device according to status flags */
}
where it is reseting the clock to the new clock ticks counter, adjusting the Ratio to the new values according to the new clock speed and then... resets the PWM.
Looks like it does not matter if the PWM is enabled or not, there is a time where the output pin is set to the default value (HIGH) and then it is taken to the current value (LOW).
This time when the output is in HIGH and later goes back to LOW does not generate an interrupt. It is happening without control.
Hope this helps to clarify.
(I created a simple project with CW 10,3 using only the microprocessor and some code to show this behavior)