Hello,
There would seem little point in attempting to increment the PWM value before the previous value has taken effect. If you are trying to achieve a ramp output, you would need to pace the PWM increment with the PWM period, i.e. the timer overflow rate. The most efficient way of doing this is to update the next PWM value within the timer overflow ISR (but this would not actually take effect until the next overflow occurred).
I would suggest not directly incrementing the timer register, but writing the incremented value to the register.
e.g. within the timer overflow ISR -
if (counter < 100) {
counter++;
TPMC0V = counter;
}
Regards,
Mac