Change software pwm method to fix blink issue