Maker Pro
Maker Pro

time difference calculation

--------------------------------------------------------------------------------

I am developing a circuit for calculation of time spent for the wave to travel from one end of sample to another. The length of sample varies from 0.5 cm to 10 cm.
I have generated sinewave and I want to determine the instance the wave hits the sample and the instance the wave gets out of it. Once, i determine the first instance, i will start the timer and stop it once i determine the next instance. Transducer is used to convert the electrical signal to ultrasonic signal which hits the sample and viceversa.
I am developing this circuit using AVR microcontroller. I found that the inbuilt Timer clock frequency doesnot exceed 8KHz. But I want to operate my timers are higher frequencies around 4 Mhz. Please suggest me inputs.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Something like this might be what you're after.

Note that the device selected has a TTL output.
 
@steve
The link points to various frequency ranges of oscillator. But that is not my requirement.
I want to measure the time spent and the oscillator will not give me that.
I have to connect an external timer which runs at 8MHz and calculates the time which I can read through a microcontroller. I found IC 8253 (programmable counter) but there is a lot of programming and IOs required. I want a simple IC.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Use a PIC. I know their timers go faster (at clock speed if required). I'd be surprised if an AVR microcontroller cant do it as well.

And the obvious answer is that they can.

I presumed you needed a crystal oscillator as an external clock source. If you're doing serious timings then I assume you're already using one (for the obvious reason). The one I pointed you to is *an* option for that.
 
Thanks steve, it was a gr8 tutorial. Just that it mentioned "Now, with only one line of code, we've started the hardware timer 1 counting at 1MHz - the same speed as our AVR. " And the example below was written taking into consideration the clock frequency to be 1Mhz.
But practically it went slightly more than 8MHz(internal RC).
So, it served my requirement as 1MHz would not have done it.
 
Top