View previous topic :: View next topic |
Author |
Message |
sifirzero1
Joined: 14 Dec 2022 Posts: 50
|
frequency of lc oscillator |
Posted: Tue Dec 31, 2024 2:29 am |
|
|
hello external lc oscillator, it is not the number of periods per time period of the LC generator, it is the number of quartz periods relative to the LC generator. In this way, the change in Hertz rates can be seen in real time. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19589
|
|
Posted: Tue Dec 31, 2024 3:00 am |
|
|
and the question is??????
If you are asking how to do this, the answer will depend on what PIC,
what frequencies are involved, etc. etc.. |
|
|
sifirzero1
Joined: 14 Dec 2022 Posts: 50
|
|
Posted: Tue Dec 31, 2024 5:11 am |
|
|
Ttelmah wrote: | and the question is??????
If you are asking how to do this, the answer will depend on what PIC,
what frequencies are involved, etc. etc.. |
pic16f88 With timer0, the LC oscillator type will measure the frequency, but the measurement is made on a hertz basis with crystal resonance. I can measure the crystal oscillator with timer1, but how can I make the two resonate? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9269 Location: Greensville,Ontario
|
|
Posted: Tue Dec 31, 2024 7:07 am |
|
|
I wonder what the project is ? Perhaps a 'metal detector' ?
Really need more information,might have an easy alternative to do it . |
|
|
sifirzero1
Joined: 14 Dec 2022 Posts: 50
|
|
Posted: Tue Dec 31, 2024 10:09 am |
|
|
temtronic wrote: | I wonder what the project is ? Perhaps a 'metal detector' ?
Really need more information,might have an easy alternative to do it . |
I gave detailed information. Following the oscillatory movement relative to the crystal oscillator. |
|
|
gaugeguy
Joined: 05 Apr 2011 Posts: 306
|
|
Posted: Tue Dec 31, 2024 11:14 am |
|
|
You can count the number of cycles received in a set amount of time or you can measure the time for one or move cycles to complete.
Since you haven't answered the previous requests for details the answer is unknown. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19589
|
|
Posted: Tue Dec 31, 2024 11:36 am |
|
|
and the comments about 'resonance' make no sense. If you make one
oscillator resonate with the other, the relative frequencies will be fixed.
Measuring a frequency using period is simple, and answers to this have
been given here hundreds of times. A quick search will find these. However
a huge amount depends on the frequencies involved and he still has
not answered about these. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9269 Location: Greensville,Ontario
|
|
Posted: Tue Dec 31, 2024 1:06 pm |
|
|
well English has been my native language for 71 years and I still can't understand WHAT is required.
An 'lc oscillator' is by nature an analog signal, so it'd have to be 'digitized' somehow, then easily compared to the PICs internal clock source ?
Providing this 'lc oscillator' is properly designed, uses quality parts it should be stable to say 1%. PIC clock will be better of course ( if xtal/2 caps),so the 'coupling' number will be constant.
Would still like to know what the project is as th code to generate the 'coupling constant is super easy as nothing changes. |
|
|
sifirzero1
Joined: 14 Dec 2022 Posts: 50
|
|
Posted: Thu Jan 02, 2025 1:58 pm |
|
|
temtronic wrote: | well English has been my native language for 71 years and I still can't understand WHAT is required.
An 'lc oscillator' is by nature an analog signal, so it'd have to be 'digitized' somehow, then easily compared to the PICs internal clock source ?
Providing this 'lc oscillator' is properly designed, uses quality parts it should be stable to say 1%. PIC clock will be better of course ( if xtal/2 caps),so the 'coupling' number will be constant.
Would still like to know what the project is as th code to generate the 'coupling constant is super easy as nothing changes. |
You guessed it right. I'm making a metal detector switch. In order to calculate on a hertz basis, I need to adjust the frequency of the crystal oscillator. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9269 Location: Greensville,Ontario
|
|
Posted: Thu Jan 02, 2025 4:04 pm |
|
|
so ,now you'll be able to use Google to find a suitable circuit, using whatever PIC you've chosen and whatever 'features' are required.
There's probably 1,000s of 'PIC based metal detector' projects on the Web.... |
|
|
sifirzero1
Joined: 14 Dec 2022 Posts: 50
|
|
Posted: Thu Jan 02, 2025 10:04 pm |
|
|
temtronic wrote: | so ,now you'll be able to use Google to find a suitable circuit, using whatever PIC you've chosen and whatever 'features' are required.
There's probably 1,000s of 'PIC based metal detector' projects on the Web.... |
To discover it myself, understand its logic and move forward. I don't want to be prepared |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19589
|
|
Posted: Fri Jan 03, 2025 4:23 am |
|
|
You keep talking about adjusting the frequency of the crystal oscillator.
The whole point of a crystal is to give a stable fixed frequency. You do not
adjust this (except by a tiny fraction of a percent).
The standard way to do a metal detector is to built an LC oscillator whose
frequency is adjusted by the presence of metal. You then test for the change
by comparing with the fixed oscillator.
How good the resolution is, depends (massively) on the design of the coil
used for the sense oscillator, and the frequencies chosen for this. Different
materials are best sensed by different frequencies. Normally around 10KHz
is optimal for standard metal detection.
The design of the sense coil and the frequency used is critical for sensitivity. |
|
|
sifirzero1
Joined: 14 Dec 2022 Posts: 50
|
|
Posted: Fri Jan 03, 2025 9:54 am |
|
|
Ttelmah wrote: | You keep talking about adjusting the frequency of the crystal oscillator.
The whole point of a crystal is to give a stable fixed frequency. You do not
adjust this (except by a tiny fraction of a percent).
The standard way to do a metal detector is to built an LC oscillator whose
frequency is adjusted by the presence of metal. You then test for the change
by comparing with the fixed oscillator.
How good the resolution is, depends (massively) on the design of the coil
used for the sense oscillator, and the frequencies chosen for this. Different
materials are best sensed by different frequencies. Normally around 10KHz
is optimal for standard metal detection.
The design of the sense coil and the frequency used is critical for sensitivity. |
Adjusting tumer0 to the crystal oscillator is shown in the drawing here. datasheet page 41
[/img] |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9269 Location: Greensville,Ontario
|
|
Posted: Fri Jan 03, 2025 10:15 am |
|
|
You'll get a lot more help if you post which PIC you're using ! I've used dozens of PICs starting with the PIC16C84,yes I'm THAT old...
As Mr. T says the coil(s) ARE the critical part of the project ! Decide on ferrous(magnetic ) vs nonferrous You need different coil 'specs' for those materials.
HOW is the ''hit' going to be shown ? LCD module with graphics, simple LED that changes colour, a 'beeper' ?? What operational depth do you need ? surface or 2-3m ?
BTW you do not change the operating clock speed of the PIC. |
|
|
gaugeguy
Joined: 05 Apr 2011 Posts: 306
|
|
Posted: Fri Jan 03, 2025 10:21 am |
|
|
sifirzero1,
Have you ever written code for a PIC processor before?
You seem to not have an understanding of the processor operation or programming. |
|
|
|