i recall microchip having a sample ranging program and app notes on the web site. michael