PWM frequency and duty cycle using input capture on ATmega2560