http://ww1.microchip.com/downloads/e...Doc/01146B.pdf
Read this documento, tip 13.1 and tip 13.2 seem a good solution to your application.

Cheers

Al.