Author Topic: Building a poor man's Time Domain Reflectometer  (Read 27486 times)

0 Members and 1 Guest are viewing this topic.

Offline KrampmeierTopic starter

  • Regular Contributor
  • *
  • Posts: 90
  • Country: de
Building a poor man's Time Domain Reflectometer
« on: April 02, 2016, 11:39:05 am »
Hi everybody! I thought it would be nice to introduce a project I have been working on for some time, and which may be interesting for some other members as well. Along the way, I am hoping to get to get some support at the Keysight "Test to impress" contest - more on that later on  8).

Usual TDRs need expensive high-speed components to measure the pulse run time on a cable. They send a short pulse down the cable and measure the time until the reflection of that pulse comes back to the same ("near") cable end. For that, they sample the voltage on the near end of the cable with high frequency. A resolution of about 10 cm on coax cable is common for low-end devices, which corresponds to about 1 ns time resolution and 1 GHz sampling rate for the ADC. The pulses must be so short that they do not overlap with their reflection even at the shortest permitted cable length.

My approach for a super cheap, super simple TDR is different. Instead of sending a short pulse with constant duration, I send pulses with variable length, and the overlap of the reflected pulse is my indicator that the pulse length is greater than the (electrical) cable length.
The overlap of pulse and reflection can easily detected, because when that happens, the peak voltage on the cable increases significantly. A high-speed diode and a capacitor are good enough to hold the peak voltage for measurement with a DMM or the built-in ADC of a microcontroller.



I described this concept in a video for the Keysight "Test to impress" contest already, and it very easy to understand once you see the oscilloscope plots there:



Now, how to generate the pulses with variable (and well known) length? Easy! I use an ECL logic XOR gate which gets a trigger signal on both inputs. One of the two inputs is delayed by a low pass filter, so the output is only "high" for a small moment. That low pass filter consists of a fixed capacitor (actually, switcheable for range selection) and a digital 8-bit potentiometer. As the time constant of the low pass filter depends on the the resistance in a linear manner, the resulting pulse length goes also in a pretty linear fashion with the potentiometer setting.


To prove my concept, I have built a prototype. The parts cost less than 50 Euro, even in single quantities. The STM32 Nucleo board made it easy to attach the Microcontroller, and creating the firmware online with MBED worked was surprisingly convenient (even though I missed the JTAG debugging and some other features I have with the IAR compiler at work).  I suppose the whole thing could be built in quantities for less than 10 Euro, and in the size of a matchbox, if somebody really wanted.

The prototype has two ranges:
  • 12 - 107 ns (approx. 1 m to 110 m, depending on cable type)
  • 72 - 1028 ns (approx. 6.5 m to 1100 m, depending on cable type)


The resolution is 4 cm on the short range and about 40 cm on the long range (8 bit). However, I already have an idea how I could get the full resolution (4 cm) over the full  range (100+ m), without physical range switching. Accuracy has not yet been proven (would need a temperature chamber and a load of cables with well known velocity factors), but the repeatability of the measurements is very good, and when I connect some cables in series the results are fairly consistent as well. LAN cables (CAT5, CAT 6) seem to come with a wide range of velocity factors, so I get up to 10% error with some of these. RG58 and RG216 can be measured very well.

Here are image of my "prototpe":





You can see I did not care much about shielding, current return paths, crosstalk, impedance matching, or other important things which must be considered when doing a true HF design. The circuit works anyway, as the real "high speed" section is very small and the most important parasitic effects can be compensated in software. Of cause, there are still some oddities and the performance could surely be be improved by putting more effort on a line driver with a faster slew rate, but that is beyond the limits of my small lab at home, especially the 25 years old 40 MHz Kikusui scope.

Right now I am waiting for Keysight to put my video online at the contest site. My plan is to release the schematic, some additional comments on the interesting details and the firmware here in the forum a soon as the contest is over. Of cause, I would be glad to get some votes at http://www.keysight.com/main/editorial.jspx?cc=DE&lc=ger&ckey=2677452 from the members who like my idea (without wanting to take votes away from other forum members who also take part in the contest).

Comments are welcome!
 
The following users thanked this post: continuo

Offline HighVoltage

  • Super Contributor
  • ***
  • Posts: 5528
  • Country: de
Re: Building a poor man's Time Domain Reflectometer
« Reply #1 on: April 02, 2016, 12:08:10 pm »
w2aew did a great video on this, using a simple square wave and the overlapping.
#37: Use a scope to measure the length and impedance of coax




There are 3 kinds of people in this world, those who can count and those who can not.
 
The following users thanked this post: iarakis

Offline KrampmeierTopic starter

  • Regular Contributor
  • *
  • Posts: 90
  • Country: de
Re: Building a poor man's Time Domain Reflectometer
« Reply #2 on: April 02, 2016, 12:32:49 pm »
Yep, this video explains the theory behind it very well. But I never saw someone use the overlap to measure the cable length without using an oscilloscope (or other high-speed DAC). The sleight used by my concept is that a DC measurement is enough if the pulse duration can be controlled well enough, and I built the suitable pulse generator (with sub-nanosecond resolution) with components for the price of a fast-food menu.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14666
  • Country: de
Re: Building a poor man's Time Domain Reflectometer
« Reply #3 on: April 02, 2016, 03:33:53 pm »
Just to measure cable length to simple setup with adjusting the pulse length might work. However this only gives one aspect of DTR - if it is about finding a defect in a cable you essentially need the curve. Also with a not so perfect system there can be multiple reflections that can upset a simple DC measurement.

So the low cost version would be to build a kind of low cost sampling scope. As the trigger source is the pulse and the signal level is relatively high this might be relatively easy compared to a full scope. Still it takes a little more than just measuring DC.

If only the first slope is what you are interested in one might still get away with measuring the delay with different trigger levels, e.g. using a DAC and a comparator. So a simple DAC (e.g. in µC) a fast comparator (likely the most expensive part). For limited resolution the µC timer might be used - though limited to something like 10 ns, unless there is an additional fine delay (some µC have this) or an analog time to analog circuit is used.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Building a poor man's Time Domain Reflectometer
« Reply #4 on: April 02, 2016, 04:26:23 pm »
For the poor hobbyists:

"Design low-cost, high-resolution time measurement app"
http://www.eetindia.co.in/STATIC/PDF/201206/EEIOL_2012JUN06_CTRL_AMP_TEST_TA_01.pdf?SOURCES=DOWNLOAD

- Accuracy 1ns or better (I have seen Microchip application note which claims accuracy of 350ps and better)
- Cost around $10

Parts used:

PIC24FJ32GA106 16bit MCU $2.12
LMH6559 Buffer $0.95 each
LT1712 Dual Comparators $3.35 each
BNC Connector $1.58 each
Misc. Components Resistors, Capacitors, etc. $1.00
Total $9.00

Microchip TDR demo:

 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20354
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Building a poor man's Time Domain Reflectometer
« Reply #5 on: April 02, 2016, 04:53:59 pm »
There are other techniques, which don't cost much either. My first version is at https://entertaininghacks.wordpress.com/2015/07/27/poor-mans-homebrew-tdr-with-4cm-resolution-part-1/

I also have an improved technique with slightly better results, butI haven't finished writing them up. So little time, so many interesting things to do.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline KrampmeierTopic starter

  • Regular Contributor
  • *
  • Posts: 90
  • Country: de
Re: Building a poor man's Time Domain Reflectometer
« Reply #6 on: April 02, 2016, 07:53:46 pm »


@Kalvin: That Microchip implementation is really nice, I have not heard or read about that yet. It should have roughly the same limitations as my approach, but is more elegant and should be more stable. Thanks!

The techniqe presented by tggzz is also very creative and gives some more information about the attached cable. For me it looks like it cannot be used for cables longer than approx. 8 m (without aliasing), as the minimum frequency of the receiver is 24 MHz - correct? Very cool to calculate the pulse response from the spectrum - are you using matlab or octave, or did you implement that deconvulsion by yourself? A thought that makes me shiver... Unfortunately it does not sound like this solution is very portable...

@Kleinstein, you are right, the applications of such a simple setup are very limited compared to a "real" TDR. It cannot detect shorts at all (would just measue "infinite" length) or small mismatches (like a 75 Ohm connector soldered on a 50 Ohm cable).
I actualy did not build this for a specific purpose, but just because I thought it might be a cool idea and I can learn something. And of cause, it is useful to have a device which can tell me how many meters of cable (NYM-J, KNX, loudspeaker cable...) I still have on my drum - and this works quite well.

By the way, of cause I can get curves out of the device I built. Here is an example of a 4.10 m RG58 cable connected to one wire pair of 1.48 m LAN cable via an improvised adaptor:



One nanosecond corresponds to (approximately) 10 cm on both of these cables. We can clearly see that something is "wrong" there and even roughly get the distances.
I still wonder how it can happen that the voltage drops at about 42 and 62 ns. In theory the curve should be monotonic. If I ever get my hands on a fast oscilloscope...  :-/O
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: au
  • Question Everything... Except This Statement
Re: Building a poor man's Time Domain Reflectometer
« Reply #7 on: April 02, 2016, 08:03:55 pm »
To me that looks like you have a small inductance adding at the start of the cable, then a small amount of capacitance on the other end, and clearly an open circuit cable,

http://gwdata.cdn-anritsu.com/images/gw1/products-solutions/appnotes/373-figure03.jpg?la=en-us
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14666
  • Country: de
Re: Building a poor man's Time Domain Reflectometer
« Reply #8 on: April 02, 2016, 08:30:13 pm »
If it's just to estimate/measure cable length, one can also just measure capacitance. 1 m of cable is about 100 pF - surprisingly little difference for NYM, coax or LAN.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20354
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Building a poor man's Time Domain Reflectometer
« Reply #9 on: April 03, 2016, 02:46:58 am »
The techniqe presented by tggzz is also very creative and gives some more information about the attached cable.

Thanks. It amused me, especially since my brother said he hadn't used Fourier Transforms since graduating (in the early 60s), and I was able to reply that I had used them last week :)

Quote
For me it looks like it cannot be used for cables longer than approx. 8 m (without aliasing), as the minimum frequency of the receiver is 24 MHz - correct?

It is too late at night to remember the exact figure, but there is a maximum length based on the lowest frequency, and it is also dependent of the propagation velocity (usually ~0.66c or 0.75c).

Quote
Very cool to calculate the pulse response from the spectrum - are you using matlab or octave, or did you implement that deconvulsion by yourself? A thought that makes me shiver... Unfortunately it does not sound like this solution is very portable...

I'm lazy. I wanted to learn a bit of Python, it was good for displaying graphs, had suitable numerical libraries. I used Python's numpy library, which contains an inverse FFT function ifft(...).
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 9285
  • Country: gb
Re: Building a poor man's Time Domain Reflectometer
« Reply #10 on: April 03, 2016, 10:31:26 am »
For the poor hobbyists:

"Design low-cost, high-resolution time measurement app"
http://www.eetindia.co.in/STATIC/PDF/201206/EEIOL_2012JUN06_CTRL_AMP_TEST_TA_01.pdf?SOURCES=DOWNLOAD

- Accuracy 1ns or better (I have seen Microchip application note which claims accuracy of 350ps and better)
- Cost around $10

Parts used:

PIC24FJ32GA106 16bit MCU $2.12
LMH6559 Buffer $0.95 each
LT1712 Dual Comparators $3.35 each
BNC Connector $1.58 each
Misc. Components Resistors, Capacitors, etc. $1.00
Total $9.00

Microchip TDR demo:

Microchip's CTMU isn't well known for fantastic resolution. The high resolutions timers primarily made for the ultrasonic flow meter market (e.g. the devices from ACAM and the TI TDC1000), can probably achieve 100ps resolution single shot measurement in a TDR application, and considerably better with some averaging of the jitter.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Building a poor man's Time Domain Reflectometer
« Reply #11 on: April 03, 2016, 11:38:16 am »
For the poor hobbyists:

"Design low-cost, high-resolution time measurement app"
http://www.eetindia.co.in/STATIC/PDF/201206/EEIOL_2012JUN06_CTRL_AMP_TEST_TA_01.pdf?SOURCES=DOWNLOAD

- Accuracy 1ns or better (I have seen Microchip application note which claims accuracy of 350ps and better)
- Cost around $10

Parts used:

PIC24FJ32GA106 16bit MCU $2.12
LMH6559 Buffer $0.95 each
LT1712 Dual Comparators $3.35 each
BNC Connector $1.58 each
Misc. Components Resistors, Capacitors, etc. $1.00
Total $9.00

Microchip TDR demo:
<link to video removed in order to conserve space>
Microchip's CTMU isn't well known for fantastic resolution. The high resolutions timers primarily made for the ultrasonic flow meter market (e.g. the devices from ACAM and the TI TDC1000), can probably achieve 100ps resolution single shot measurement in a TDR application, and considerably better with some averaging of the jitter.
I haven't been using CTMU so I cannot say how well or poorly it performs. The SDR-application just take advantage of the on-chip CTMU block and it should work down to 1ns range as Microchip has demonstrated. Some application note mentioned that 350ps or better could be obtained.

Edit:
This application note states that even 3.5ps resolution ie. 0.02 inch resolution can been obtained:
http://www.edn.com/design/sensors/4433411/Use-Time-Domain-Reflectometry--TDR--for-low-cost-liquid-level-measurement--Part-III

The CTMU uses on-chip 12-bit ADC, but let's assume conservatively that the accuracy of a single-shot pulse measurement is only 6 bits. By measuring multiple pulses and averaging the results, the resolution should double when the measurement count is increased four-folds (ie. gaining one extra bit).

Making four measurements and taking the average of the results we can increase the resolution to 7 bits. Making 16 measurements and averaging the results we have gained 2 bits giving us 8 bit resolution. After 1024 measurements we have gained 5 bits giving us 11 bits of resolution. Making 4096 measurements we can achieve 12-bits of resolution. As each pulse measurement is really fast, the averaging can be increased easily to 4096 or more. Let's assume conservatively that each measurement will take 50us (the CPU can execute 500 or more instructions in that time) and we perform 4096 measurements, the total measurement time will be 200 milliseconds ie. 5 times per second.
« Last Edit: April 03, 2016, 11:55:40 am by Kalvin »
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20354
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Building a poor man's Time Domain Reflectometer
« Reply #12 on: April 03, 2016, 11:43:41 am »
By measuring multiple pulses and averaging the results, the resolution should double when the measurement count is increased four-folds (ie. gaining one extra bit).

In general, that kind of analysis is valid for uncorrelated random noise, not for correlated errors. But I'm sure you know that.

I make no comment on the devices used in this thread.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Building a poor man's Time Domain Reflectometer
« Reply #13 on: April 03, 2016, 11:53:25 am »
By measuring multiple pulses and averaging the results, the resolution should double when the measurement count is increased four-folds (ie. gaining one extra bit).

In general, that kind of analysis is valid for uncorrelated random noise, not for correlated errors. But I'm sure you know that.

I make no comment on the devices used in this thread.

Yes, your comment is very good one. I cannot say I know anything about the measurement error distribution.

I edited my posting to include the reference to an application article which claims that even 3.5ps resolution ie. 0.02 inch resolution could be accomplished.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Building a poor man's Time Domain Reflectometer
« Reply #14 on: April 03, 2016, 01:13:14 pm »
Thought about this CTMU a bit more. It should be pretty easy to make a sampling TDR measurement device, too. The system would require an adjustable delay line. The principle is similar to sampling oscilloscopes. I guess that the budget can be still held near $10 range.

The pulse generator will feed to coaxial line to be investigated and the delay line. The CTMU and the ADC's internal sampling capacitor are tracking the transmission line voltage. After the specified delay the delayed trigger pulse will will make the CTMU to stop transmission line sampling, and start the ADC to measure the voltage of the ADC's internal sampling capacitor.

Varying the delay one can "see" the reflection voltage changing as a function of time. Performing averaging over multiple measurements the resolution can be increased. Applying some math to the results one should be able to calculate the transmission line parameters and find the locations and the values of the impedance mismatches.

Edit: The digital delay line costs at least $15, so it will break the $10 budget. For example the Microchip (Micrel) dual channel delay line can provide 5ns delay with 5ps steps: http://www.digikey.com/product-detail/en/microchip-technology/SY89297UMG/576-3706-5-ND/2242459
5ns is only good for 2 meters (6+ feet) of coax. Some additional delay tinkering would be needed for expanding the measurement range.
« Last Edit: April 03, 2016, 01:48:32 pm by Kalvin »
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14666
  • Country: de
Re: Building a poor man's Time Domain Reflectometer
« Reply #15 on: April 03, 2016, 01:22:50 pm »
There are likely easier S&H stages than using the CTMU. Anyway this still leaves the problem of having the adjustable delay line.
The advantage of the sampling system would of cause be that one can also measure the length of a cable up to a short, not just an open cable.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Building a poor man's Time Domain Reflectometer
« Reply #16 on: April 03, 2016, 01:50:31 pm »
There are likely easier S&H stages than using the CTMU. Anyway this still leaves the problem of having the adjustable delay line.
The advantage of the sampling system would of cause be that one can also measure the length of a cable up to a short, not just an open cable.

I just went to Digikey and browsed for the programmable delay lines (see my previous post). That will bust the $10 budget.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Building a poor man's Time Domain Reflectometer
« Reply #17 on: April 03, 2016, 02:08:45 pm »
Edit: The digital delay line costs at least $15, so it will break the $10 budget. For example the Microchip (Micrel) dual channel delay line can provide 5ns delay with 5ps steps: http://www.digikey.com/product-detail/en/microchip-technology/SY89297UMG/576-3706-5-ND/2242459
5ns is only good for 2 meters (6+ feet) of coax. Some additional delay tinkering would be needed for expanding the measurement range.

About the delay tinkering: Maybe a simple RC could be used to create some additional delay. The delayed pulse is fed into a RC-filter which causes the pulse delay. Varying the C will vary the delay. The variable C could be possibly implemented placing few suitable capacitors to microcontroller's I/O-lines. Making the I/O-line floating (hi-z) disconnects the unused capacitors. Making all capacitors floating effectively disables the extra delay feature. Making the relative capacitors values as powers of two, one can create some nice delay increments.

I do not know how well this concept would work, just an idea creating simple delays on a budget.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20354
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Building a poor man's Time Domain Reflectometer
« Reply #18 on: April 03, 2016, 03:02:23 pm »
The system would require an adjustable delay line. The principle is similar to sampling oscilloscopes.

Consider time-to-digital (TTD) devices.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14666
  • Country: de
Re: Building a poor man's Time Domain Reflectometer
« Reply #19 on: April 03, 2016, 03:29:21 pm »
One way to create pulses with a variable delay would be using two slightly different clocks (e.g. 10 MHz and 10.001 MHz), and synchronizing flipflops with these two. This way the phase shift and thus the delay is slowly moving from 0 to 100 ns, more delay could be added by the µC. The good thing is that the delay is predictable when the frequency difference is known / measured, and the zero point is caught.
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 9285
  • Country: gb
Re: Building a poor man's Time Domain Reflectometer
« Reply #20 on: April 03, 2016, 03:36:51 pm »
One way to create pulses with a variable delay would be using two slightly different clocks (e.g. 10 MHz and 10.001 MHz), and synchronizing flipflops with these two. This way the phase shift and thus the delay is slowly moving from 0 to 100 ns, more delay could be added by the µC. The good thing is that the delay is predictable when the frequency difference is known / measured, and the zero point is caught.
Using 2 slightly different clocks can be pain, because the phase relationship between them is uncontrolled. Using a FET to switch a cap that nudges a crystal is a better behaved approach. Wherever you are when you switch that cap, you know the next cycle of the clock is going to behave well.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Building a poor man's Time Domain Reflectometer
« Reply #21 on: April 03, 2016, 03:50:44 pm »
One way to create pulses with a variable delay would be using two slightly different clocks (e.g. 10 MHz and 10.001 MHz), and synchronizing flipflops with these two. This way the phase shift and thus the delay is slowly moving from 0 to 100 ns, more delay could be added by the µC. The good thing is that the delay is predictable when the frequency difference is known / measured, and the zero point is caught.

How about using a PLL with adjustable phase difference so that the edges will lock with specified time delay. Then only one reference oscillator is needed and the PLL's VCO will lock to the reference with specified phase offset ie. delay.
 

Offline KrampmeierTopic starter

  • Regular Contributor
  • *
  • Posts: 90
  • Country: de
Re: Building a poor man's Time Domain Reflectometer
« Reply #22 on: April 03, 2016, 07:50:28 pm »
Nice to see how the ideas are coming in!

Of cause, it would be nice to derive the delay from a crystal oscillator for stability, but my experience with the simple R-C lowpass is not too bad. Instead of a capacitance decade, I use a digital potentimeter (AD8400), which gives 8 bits of resolution for the delay (or pulse width, in my application). It looks like this now.



Note: The diode is there to suppress the pulse which occurs on the falling edge of the trigger line (PA4). It does not work perfectly, but good enough for my purpose.
With a small modification, the analog delay would be used to add an small delay (let's say, with 0.1 ns resolution) to a larger delay, which is generated by the µC. 255*0.1 ns = 25.5 ns, so f the µC can generate precise delays with the resolution of  something like 20 ns, we'd have the full resolution at infinite range. It could look a bit like that:
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3639
  • Country: us
  • If you want more money, be more valuable.
Re: Building a poor man's Time Domain Reflectometer
« Reply #23 on: April 03, 2016, 08:36:13 pm »
This looks like a fun project - just wanted to join in so I get notices now.  Carry on.

I did some experiments after watching W2aew videos and have an actual daily use for the technique if I made one. I love practical projects that I can use after the learning is done.
« Last Edit: April 03, 2016, 09:56:46 pm by rx8pilot »
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline KrampmeierTopic starter

  • Regular Contributor
  • *
  • Posts: 90
  • Country: de
Re: Building a poor man's Time Domain Reflectometer
« Reply #24 on: April 03, 2016, 09:56:08 pm »
I just did some quick soldering and a program change, and the method with the addition of a delay from the controller and the analog circuit does seem to work. Unfortunately, the mbed online compiler seems to create a very slow code, despite using #pragma Otime.
Because of that, the smallest possible delay from the controller is about 120 ns with my program, even though the µC should be running at 100 MHz. No idea why a simple port access is so slow. Maybe I can find a way to get better resolution.
Edit:
That was easy, mbed also supports direct access like GPIOC->BSRR = (1<<9);. I'll try to integrate the new technique into my firmware tomorrow and to some tests.


« Last Edit: April 03, 2016, 10:10:35 pm by Krampmeier »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf