Here is an idea: You come up with some fast analog circuitry that generates the pulse, starts charging a capacitor, then stops charging the capacitor when the pulse reflection is sensed, and running that signal to a sample-and-hold op-amp. The analog stuff would have to be really fast to avoid adding signifigant delays to the measurement. Then the PIC can simply measure the voltage on the capacitor and process it at it's leisure. -- Lawrence Lile Senior Project Engineer Toastmaster, Inc. Division of Salton, Inc. 573-446-5661 voice 573-446-5676 fax "Robert B." Sent by: pic microcontroller discussion list 05/19/2004 08:52 PM Please respond to pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: Subject: [PIC:] Measuring nanoseconds Does anybody know of a way to make a PIC measure time intervals shorter than it's instruction cycle? I need to measure the time between a transmitted and a reflected radio pulse in the 3 ns range, and would like to do it with a PIC. Doing it directly is pretty much out of the question due to the slow instruction cycles (200ns) , but maybe there's a trick that would make it possible? The overall code execution speed can take as long as needed, but the nanosecond resolution must be reasonably accurate (+/- 1ns). Ideas? Has anybody faced a similar problem? I'd love a point in the right direction. It seems this must have been solved for radar applications or other wave-propagation measurements, but searching on Google doesn't turn up much. The application (so far) is just a thought experiment regarding medium-distance ranging accurate to within a meter (about 1ns for speed-of-light radio reflections), but it's something I'm pretty fascinated with and if I can come up with a viable system I'd love to build it as an educational project. Thanks in advance! -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu