I've been following this with some interest also having had a bit to do with TDRs (&OTDRs) in a past employment.. It occurs that it should be easy to determine the reflection time to within one clock cycle reasonably easily using an interrupt (for open or shorted lines). The problem is that this only gives a resolution to 1 clock cycle - 1uS for a 4MHz oscillator part. (18 series may improve on this using the 40MHz capability??). Regardless - the resolution will be a lot less than desired. (1uS = 100m of cable go & return time) However, if a means of delaying the transmission linearly within a clock cycle was provided, it should be reasonably easy to adjust the timing so that the reflection is received at a clock cycle transition (or, rather 50% of the interrupts at clock N, and 50% at clock N+1). N would then provide the course reading. This could be acheived in hardware using a PWM output to set a trigger point compared to a ramp generator (RC network ??) triggered at N=0. The end result should allow timing resolution to 1/1024 (10 bit pwm) of a clock cycle - or roughly 1nS for a 4MHz clock. (cable length = 100mm). Good enough for most cases, and better thyan the accuracy of the velocity factor over long cable lengths anyway. The hardware would need a bit more thought but I can't really see too much of a problem with it. Any comments?? Richard P From: "Wagner Lipnharski" To: Sent: Thursday, February 20, 2003 3:42 PM Subject: Re: [PIC]: How would I build a reflectometer? > hehe, again, I take back what I said in the last email, sent seconds ago. > You are in true trying to measure the wire distance. > > If you build a cable loop terminator, simply a connector to make a loop > between the cat-5 wires, lets say, building a 4 pairs loop, so you are > multiplying by 8 the cable distance, and using any low cost thing as I > suggested, a million pulses repeater, measuring the time, you could do it > with less than $10 hardware. I'm going to work on this in my "spare" time. ;-) I recently noticed that a couple of "cheap" tools were available that would measure a cable. Since the time to send a pulse and receive a response is very short (nanoseconds), I had wondered how these tools could do it using an inexpensive micro. michael -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu