Quadrature encoder interface on dspic