speed of sound

BillO

Joined Nov 24, 2008
990
Choose the right processor, and these count-capture units will be built in. They'd be doing snapshots of a free-running 16 bit counter, and none of them would start it from zero. But it would be trivial to turn the 3 or 4 captured quantities into differences from whichever one triggered first. Having a processor and then building external hardware is like "buying a dog and then barking yourself".
Yes, most of the MCUs today have built-in counter-timers. The problem I see is keeping them synchronized. With a single clock, you don't have that issue. Also, if you start the clock on the fist detection, you know which detector fired first. With 3 or 4 free-running clocks, you'd have a nightmare synching them and determining which started first.

I know building a clock out of logic chips seems a little archaic, but sometimes old-school is the best way. My main schooling is in physics and I spent a lot of time in the lab. Because of this I look for solutions that try to eliminate sources of error and that reduce procedural complexity, even if they appear to be a lot more initial work. Experience has taught me, the hard way, that it is far easier in the long run to reduce error and complexity in the design than try to fix it in the data later.

I'd put the analogy more like 'Having a processor and then building external hardware is like having a car and buying a trailer to haul a big load rather than try to stuff it all in the car.'
 

John P

Joined Oct 14, 2008
1,892
Yes, most of the MCUs today have built-in counter-timers. The problem I see is keeping them synchronized. With a single clock, you don't have that issue...
I'm afraid this means that (I shall be modest) I haven't explained my point well. What I meant was certainly not to use multiple processors--that would be buying a whole pack of dogs and expecting them to bark in unison--but get a single processor with the capture-on-transition function available on several pins. When this feature is used, a transition on a particular pin immediately grabs and holds (sic 'em, Fido) the current count of a clock register, and sets a flag to say the event has occurred. So in this application, when all the flags have become set, the capture registers are examined and the differences in time can be read. No need for any external counters or latches, but I'm skeptical about a perfectly consistent transducer sending a signal to the processor when the impact occurs. Any slight variation among the different sensors will have a big effect on the result.
 

Thread Starter

schultz1978

Joined Nov 5, 2011
5
Choose the right processor, and these count-capture units will be built in. They'd be doing snapshots of a free-running 16 bit counter, and none of them would start it from zero. But it would be trivial to turn the 3 or 4 captured quantities into differences from whichever one triggered first. Having a processor and then building external hardware is like "buying a dog and then barking yourself".
What would be the correct processor in this case? I'm sorry but I'm not that familiar with pics.

To summarize:
It seems you would recommend using Pizo "mics" to avoid echo,
a free running count-capture. If i can find the correct pic i'd only need one of these. Otherwise one for each mic and using the pic to reset all one a hit is registered and data polled.
 

thatoneguy

Joined Feb 19, 2009
6,359
What would be the correct processor in this case? I'm sorry but I'm not that familiar with pics.

To summarize:
It seems you would recommend using Pizo "mics" to avoid echo,
a free running count-capture. If i can find the correct pic i'd only need one of these. Otherwise one for each mic and using the pic to reset all one a hit is registered and data polled.
You would need one with three CCP (Capture/Compare/PWM) Ports, You would be using the Capture function.
 

John P

Joined Oct 14, 2008
1,892
What would be the correct processor in this case? I'm sorry but I'm not that familiar with pics.
You started off saying, "pic18 / pic24 those are what i have available".

If you'd consider the 16F series, the PIC16F1939 has 5 capture/compare inputs.
In the 18F series, there's the PIC18F25K22 or PIC18F25K20, and the PIC18F26J13 has 10 capture registers!

Microchip makes these searches easy. You go to http://www.microchip.com/en_US/family/8bit/, then click on "PIC16 Family" or "PIC18 Family" and then get the full listing of features by use of the "Show All Specs" button, then just scroll through looking at the number listed under "Capture/Compare/PWM Peripherals".
 
Top