> thanks!
>
> how about using the built-in comparator?
> since i have a sine wave with zero dc offset, can i simply measure the
> time interval between the zero crossings?
> that is using a reference voltage of o volts?
> and use the time difference to determine my frequency...
>
> or can you think of other?
>
> thanks!
That might work. I would suggest that if you approach the problem this
way, that you use a couple of comparitor / opamps with sufficient
hysteresis to avoid false triggers. The limiting factor you may run
into with this approach is the input resolution of the digital inputs
on your PIC. I believe I read in another post to consider using a
divide by counter. That would be a good idea.
Another approach would be to use a PLL, possibly with a divide by
circuit. The PLL would be a lot more noise immune than a comparitor
and input capture circuit.
Reply by Paul Keinanen●April 7, 20062006-04-07
On 6 Apr 2006 08:55:41 -0700, "electro" <electromagnetic377@yahoo.com>
wrote:
>do i really need an interface between my instanteanous analog 478khz or
>say 296khz sine wave and the ADC port of my pic?isnt it it is an analog
>to digital converter?so why still need an interface?
You have to sample at least twice the Nyquist frequency, in this case
you would need to take over 1 Msample/s. I haven't looked at the PIC
specification, but I very much doubt that it would go that high :-).
However, there are several ways to interface to the ADC. As already
mentioned, the 1 us monostable and a low pass filter would be an
option.
Assuming that the input signal has a constant amplitude (or driving
preamplifier into saturation) and assuming a relatively large
frequency change, just put a steep low pass filter after the signal
source, rectify the signal and feed the DC signal to the ADC. The
rectified signal voltage is now inversely proportional to the
frequency due to the low pass filter. With a high pass filter, the
voltage is proportional to frequency. How strong the dependency is,
depends on the order of the filter.
Apparently the frequency does not change very fast due to the manual
movement of the inductor, so it would be practical to divide down the
frequency, with say a 12 bit CMOS divider chain down to about 100 Hz
and run this into the ADC or preferably to some digital input pin and
from there determine the period and frequency.
Paul
Reply by electro●April 6, 20062006-04-06
thanks!
how about using the built-in comparator?
since i have a sine wave with zero dc offset, can i simply measure the
time interval between the zero crossings?
that is using a reference voltage of o volts?
and use the time difference to determine my frequency...
or can you think of other?
thanks!
Reply by Noway2●April 6, 20062006-04-06
electro wrote:
> i would like to use the voltage as an indication of a change in ambient
> frequency due to a close metal...
> my initial idea was to full rectif the sine wave signal and extract its
> dc content...
> but since i wil be using a pic with adc capabilities..im now looking
> for ways to use that..
> do i really need an interface between my instanteanous analog 478khz or
> say 296khz sine wave and the ADC port of my pic?isnt it it is an analog
> to digital converter?so why still need an interface?
>
> thanks!
The short answer to your question is that you need circuitry to provide
a proper electrical (signal) interface between the signal source and
the ADC. The ADC has specific requirements of what it expects to be
driven with, and if these requirements are not met, you will get, at
best, erroneous results.
I agree that, based on some of the questions you are asking, it appears
that you are in over your head on at least some portions of this
design. It happens even to the best sometimes. You might, however,
wish to see if you can find a consultant who may be able to help you
along with some of the portions you are having trouble with.
> On 6 Apr 2006 07:42:04 -0700, the renowned "electro"
><electromagnetic377@yahoo.com> wrote:
>
>>i have a certain sine wave input in the 480 khz range.i would like to
>>make a pseudo frequency to voltge converter by using the ADC of my
>>pic16lf876a..
>>
>>any reaction?is this possible?
>>
>>thanks!
>
> Sure. For example, you could trigger a 1us monostable from the input
> waveform, low-pass filter the CMOS output and feed that to your ADC.
> Only a few parts, depending on the input amplitude.
Looking at some of his other posts on the topic I think it's critically
dependent on input aptitude, which I fear is low :-)
--
Nobby Anderson
Reply by Spehro Pefhany●April 6, 20062006-04-06
On 6 Apr 2006 08:55:41 -0700, the renowned "electro"
<electromagnetic377@yahoo.com> wrote:
>i would like to use the voltage as an indication of a change in ambient
>frequency due to a close metal...
>my initial idea was to full rectif the sine wave signal and extract its
>dc content...
>but since i wil be using a pic with adc capabilities..im now looking
>for ways to use that..
>do i really need an interface between my instanteanous analog 478khz or
>say 296khz sine wave and the ADC port of my pic?isnt it it is an analog
>to digital converter?so why still need an interface?
>
>thanks!
The ADC measures analog voltage, not frequency. Which do you want?
You can also measure the frequency directly with a PIC using on-chip
counter/timer hardware, but I fear you are in well over your head on
this one.
Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
Reply by electro●April 6, 20062006-04-06
i would like to use the voltage as an indication of a change in ambient
frequency due to a close metal...
my initial idea was to full rectif the sine wave signal and extract its
dc content...
but since i wil be using a pic with adc capabilities..im now looking
for ways to use that..
do i really need an interface between my instanteanous analog 478khz or
say 296khz sine wave and the ADC port of my pic?isnt it it is an analog
to digital converter?so why still need an interface?
thanks!
Reply by Spehro Pefhany●April 6, 20062006-04-06
On 6 Apr 2006 07:42:04 -0700, the renowned "electro"
<electromagnetic377@yahoo.com> wrote:
>i have a certain sine wave input in the 480 khz range.i would like to
>make a pseudo frequency to voltge converter by using the ADC of my
>pic16lf876a..
>
>any reaction?is this possible?
>
>thanks!
Sure. For example, you could trigger a 1us monostable from the input
waveform, low-pass filter the CMOS output and feed that to your ADC.
Only a few parts, depending on the input amplitude.
Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
Reply by Peter Dickerson●April 6, 20062006-04-06
"electro" <electromagnetic377@yahoo.com> wrote in message
news:1144335447.002808.28420@v46g2000cwv.googlegroups.com...
> thanks..
> assuming an 8-bit resolution,how will it relate to my input freuquency?
>
> my application is a metal detector. i have an lc tuned copitss
> oscillator where my loop antenna acts as my variable inductance..the
> common practice is beating this with a certain frequency and extract
> the difference..
> for my part, i would like simply to have some ways to translate the
> frequecny change in to a voltage change the simplest way.i tried f>v
> converter but they have low frequency input...
And what do you want to do with the voltage? Drive a meter? produce a tone?
or use the signal in the digital domain. I suspect that just want the
frequency shift a a numerical value in which case feeding the osc into a
counter sampled regularly to get a frequency number, then just subtract base
frequency. You could have a push-botton that tells the micro to take the
current measured frequency as the base. Just make sure the micro has a
stable clock source i.e use a crystal not an RC osc or ceramic resonator.
As for analog output - an DAC, PWM or counter driven square wave (for freq
out).
Peter
Reply by Peter●April 6, 20062006-04-06
"electro" <electromagnetic377@yahoo.com> wrote in message
news:1144334524.180706.50700@t31g2000cwb.googlegroups.com...
>i have a certain sine wave input in the 480 khz range.i would like to
> make a pseudo frequency to voltge converter by using the ADC of my
> pic16lf876a..
>
> any reaction?is this possible?
>
> thanks!
>
You can use the ADC if you put a frequency to voltage converter in front of
it. What I'd use is a phase lock loop.
Or just run the signal through a signal conditioner and comparator into an
interrupt pin and measure the wave period. If you count a decent number of
cycles over a fixed time period you should be able to get your frequency
measured as accurate as you want.
Peter