fixed PWM generation and capture