PWM using Input Capture
embedded systems tutorial