You might find this helpful also.

http://ww1.microchip.com/downloads/e...hapter%208.pdf

Regards