CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

frequency of lc oscillator
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sifirzero1



Joined: 14 Dec 2022
Posts: 50

View user's profile Send private message

frequency of lc oscillator
PostPosted: Tue Dec 31, 2024 2:29 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 31, 2024 3:00 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 31, 2024 5:11 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 31, 2024 7:07 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 31, 2024 10:09 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 31, 2024 11:14 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 31, 2024 11:36 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 31, 2024 1:06 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jan 02, 2025 1:58 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jan 02, 2025 4:04 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jan 02, 2025 10:04 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 03, 2025 4:23 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 03, 2025 9:54 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 03, 2025 10:15 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 03, 2025 10:21 am     Reply with quote

sifirzero1,
Have you ever written code for a PIC processor before?
You seem to not have an understanding of the processor operation or programming.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group