Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

High speed A/D

Status
Not open for further replies.

DSGarcia

New Member
I would like to sample an analog signal at 15 MHz (50 MHz would be better) for 50 uSec following a trigger. Unfortunately, a PIC A/D can only convert 500 KSPS which is too slow so I will need to use an external part. Can a PIC read data fast enough from an external part? I have not selected a specific part yet, but there are several capable of over 200 MSPS. What should I consider and how should I approach this?
Thanks,
Dale
 
Assume all you have to do is get the data from the adc and store it. How many cycles will that take ( at least 1 ) So at 15 Mhz the clock of the pic would need to run at 4 * 15 * 1 mhz = 60 mhz. So no, the PIC is not fast enough. Could you give more details on why you need this?
 
If it is anything other than a parallel interface, no the PIC can't read it fast enough. What are you trying to sample? Also, what are you trying to do with the data. It's not enough that it can accept the data fast enough, it also has to process the data fast enough as well which makes your processor have to be at least several times faster.
 
Last edited:
I would like to process the signal from an ultrasonic pulse echo return looking for various reflections. The sample time is very short--less than 50 uSec following the emitted pulse. I will have plenty of time to process the data after acquisition since it is not a continuous process. I can use an 8-bit A/D to reduce the number of bytes read if I can find an A/D chip that is fast enough; so far I have only looked at 12-bit parts.
Thanks,
Dale
 
Ultrasonic is only 40kHz or so. You don't need 50MHz sampling.

I am trying to measure the echo return time once the pulse is transmitted. Time is infinitely divisible (within reasonable argument). I need an accurate measurement of total travel time for various reflections for sub-millimeter measurements. I could probably live with a 10MHz sample rate.

Thanks,
Dale
 
Last edited:
And you probably do not need ADC, as you do not really care what the wave form is.

Russ,
I considered that, but there is no guarantee that a particular return will have a particular minimum signal strength. If I set the threshold too low, I will have extra (false) returns with no way to discern true returns.

Since the echo returns may not necessarily be really strong or consistent, I will need to look at relative amplitude instead of absolute amplitude to separate valid returns from noise.
Thanks,
Dale
 
Russ,
I considered that, but there is no guarantee that a particular return will have a particular minimum signal strength. If I set the threshold too low, I will have extra (false) returns with no way to discern true returns.

Since the echo returns may not necessarily be really strong or consistent, I will need to look at relative amplitude instead of absolute amplitude to separate valid returns from noise.
Thanks,
Dale

Maybe, but information in the time domain may be enough. You could also have detectors at a couple of different sensitivities and monitor them all. You would need some sort of input conditioniting for each input but could then just use digitil IO which is simple and fast. Try it the simple way first.

You might google for the microchip app note: AN597 Implementing Ultrasonic Ranging
 
you just need a ccp in capture mode .. you ping and then start timer and capture the echo.

here's the easy to use project that does just that:
A PIC sonar (ultrasonic) range finding project.

you do not need to display the result on 7seg's ... you can store the result and use however you want .. the actual range finder is using 2 pins, one to output ping and other to capture echo

edit: btw, you can modify the demodulator to fetch different signal strenght, and change software a bit so you can get reflection from more then just a first surface (so you can see trough walls) anyhow you do not need adc, 10MHz is more then enough uC speed to get decent resolution, even 8MHz should be enough.
 
Last edited:
Bill, btw, that PIC sonar I posted link for ... I made it some time ago, modified software completely and hardware slightly (used mcp602 instead of those comparators, used different trasistors .. but all in all similar desigh) ... using 40KHz I got some 5m range with ~0.5cm precision

I also adopted it to fetch "multiple echoes" to "look trough walls" :) that killed the precision a bit (~1cm) and I was able to "look" trough few cm thick wooden board. I was unable to "look" trough concrete wall (not even the brick one) ... the different driver should be used for "more penetration" as I used 2x BC546B ... not enough :( .. also some EST should be implemented in software so you do multiple pings and then overlay results ... I do not remember why I gave up on that project :)
 
Didn't know sonar could look through walls, that's cool.
The sound bounce of all edges .. there's also change of speed trough different materials .. but then it becomes complex :D

If you have a ~40KHz transducer (20-80KHz will do) and a scope, give it a ping and watch the response on scope :) you will see bunch of echoes if you put few thin obstacles ... (paper, cardboard, board) in front of it ... (the amplitude of the response drops quickly with amount of obstacles and distance)

Here's a popular Sonar schematic.
very inventive way to use max232 charge pump :) to drive the transducer
 
Thanks for the input everyone, but perhaps a few more details are in order.

This is for a simple ultrasonic inspection system of sorts. I am trying to locate the boundaries between layers of materials having differing acoustic impedance. Each boundary will reflect some of the signal to a varying degree. Each layer is not completely homogeneous so there will be some false reflections, but much weaker than the layer boundaries. I will need to pick out the relatively stronger returns from the relatively weaker returns. I would like to measure the distance to the boundaries to the nearest tenth or two of a mm. The total depth of the material being inspected is less than a few cm.
Thanks,
Dale
 
look at the schematic I gave link to ... (direct link to pdf: https://www.electro-tech-online.com/custompdfs/2009/02/pic-sonar.pdf )

C22 have amplified return signal .. from my tests this amplifier (I used BC546B, BC547C might give better amplification or maybe some faster transistors, BC546/546 is "slow" one)...

after C22 you have peak detector with 2 diodes cap and resistor ... use fastest diodes you can find (I used Schottky) as that's fastest I had.

after peak detector is the comparator ... forget the lm311, I got very bad results with it, use some fast rail to rail op amp / comparator (I used mcp602) ... the VR2 is used to set threshold. What I did to "look trough walls" is to use 2 of them (602 is dual anyhow) with different threshold so I fetch "stronger" signals on both outputs and "weaker" ones only on one.

after you send ping (4 periods are enough) you start timer (I used 20MHz clock so timer with prescaler 1:1 is 5000000 counts per sec - that gives you theoretical resolution of 340/5000000 = 0.000068m = 0.068mm) you can use some 18F pic as they can go 40MHz so you will double the precision (in theory) if you need it. The CCP module automatically capture the time when the ping return. you can use prescaler and bit of code to get the "second, third, fourth .... nth" echo.

so, it is not "that easy" but it is more then doable with 18F PIC.

If you really do want to go analog, you can use dsPIC and AD the output from the peak detector .. I saw some project that does 1.5MSps ...
 
Arhi,
Thanks for the advice. However, I need a little more advice on your solution. If I use a timer, I would clearly get the first arrival time (that meets the threshold). I'm a little unsure of how to get the other arrival times. Could you descibe this in a little more detail for me please?

Bill, Thanks for the circuit. I too, like the driver circuit.

Thanks,
Dale
 
If I use a timer, I would clearly get the first arrival time (that meets the threshold).

Yup, that part is easy :)

I'm a little unsure of how to get the other arrival times. Could you descibe this in a little more detail for me please?

Not a problem, but I'm now "remembering what I did" not looking at the actual solution ...

What I did was "one measurement per ping" assuming that I am measuring static environment. I was also measuring only 4 echoes but you could expand using the similar technique.

1st echo is "measure the interval"
2nd echo is "measure the interval" but set the capture postscaler to 1:2
3rd echo is "interrupt on 1st echo then clear interrupt flag and go again" ..this "turn on and do again" cost some cycles that you have to deduct from the total score later on
4th echo same as 2nd one only postscaler 1:4

The 2 OP idea was used only in hardware, I used the second half of the mcp602 to get the "low amplitude echo" but I never implemented any of it in software. The plan was not to use capture timer but to use 40MHz PIC and loop like

Code:
...
x:
   test PINL
   jump if set LL
   test PINH
   jump if set HH
   jump CC
LL:
   inc LOW
   set L[LOW] = CLOCK
   nop
   nop
   nop
HH:
   inc HIGH
  set H[HIGH] = CLOCK
CC:
   inc CLOCK
   jump x
...

the general idea is to have same number of clocks in one loop so it need some work, and some way in / out of the loop need to be defined, using interrupt to set some flag and then check it before "jump x" or if clock is > something or if high > sizeof(H)....

anyhow, the idea was to scan the 2 input pins (assuming if low pin is set that the high one is also set without need to test it) and storing the data in RAM array ... then later on, you can analyze the array ....

I never implemented this so I have no idea if that would be useful at all ... I do not know why I even wanted that (I suspect I wanted to use the other half of mcp602 for something :D )


you can also have timer run (do not set it to stop on capture) and connect echo pin on interrupt and then just copy the timer value into array ... probably better way then what I was doing but .. I did not remember it then :)
 
Arhi,
Thanks, that is what I needed to know....that I would loose some cycles that will have to be added back into the result. I think I could also start multiple timers and use a shift register or counter or something such as ANDing with an output bit to mask the earlier arrivals for the later counters.
Thanks,
Dale
 
for those you can use postscaler you do not loose anything ... but you cannot use postscaler for 3 :) .... there must be a way to do it without loosing cycles (for e.g. hw counter between uC an op) ... but I did not spend too much time thinking about it ...

In any way, it seams to me that it is much easier then doing lot of adc :)
 
Status
Not open for further replies.

Latest threads

Back
Top