set up pwm before clear, edit