semi working pwm