added code for next generation fading and 16-bit PWM