add twi pwm code