Pic18f xtal oscilator

Status
Not open for further replies.

mrcube_ns

Advanced Member level 1
Joined
Apr 10, 2002
Messages
452
Helped
48
Reputation
96
Reaction score
34
Trophy points
1,308
Location
Europe
Activity points
3,813
PIC18f QUARTZ OSCILLATOR STRANGE BEHAVIOR?!?

Hello friends,

What is typical condensators value for 40MHz quartz?

Step 1: I test first with 24MHz quartz with 13.5pF (two 27pF in serial connection) everything working fine.
Step 2: Then I just change quartz (put 40MHz instead of 24MHz) and PIC working about 2 times slower?!?

I suppose that I need to put smaller condensators, but I'm not sure whats is problem....

I use PIC18F4550.


Any ideas?!?

Thanks in advance!!!!


Mr.Cube
 
Last edited:

did you change your timers setting in your program? because the pic timer will divide it by 4.and 27pf should work fine with 40Mhz crystal capacitor.
 

Re: PIC18f QUARTZ OSCILLATOR STRANGE BEHAVIOR?!?

Hi,

Have a good read of the datasheet - oscillator section.

25mhz is the fastest crystal you can use on that chip; that is the crystal uses the internal circuity of the 4550.

For up to 48mhz you need an external oscillator; that uses its own transistors / ic to produce the signals.

Then you have the PLL multipiers.

All these need various changes to your hardware and Config statements
 
Are you sure you can use such high frequency crystals? Most PICs can use only 20MHz or 24MHz crystals, maximum. External clocks can usually be higher. With the PLLs built into many PICs, very high frequency crystals are unnecessary.

Keith

- - - Updated - - -

I have just spotted someone who is quicker at typing than me!
 
To wp100 and keith1200rs

Thanks for answer!

OK 25MHz is max quartz, it seems to be fact which I didn't know.
But how PIC works on 40MHz, slower but works:?:

Mr.Cube
 

To wp100 and keith1200rs

Thanks for answer!

OK 25MHz is max quartz, it seems to be fact which I didn't know.
But how PIC works on 40MHz, slower but works:?:

Mr.Cube


Hi,

Cannot give you a qualified answer, but expect its all down to the internal Inverter / Transistors that the Xtal run against on OSC1 and OSC2 pins.
If those transistors have a max frequency of 25mhz and you are using a 40mhz xtal perhaps its only seeing every second or third pulse from the 40mhz xtal, or the pulses it creates are so distorted the rest of the Pic cannot recognise them

Bit like running a car engine thats rated to 6,000rpm but you are sending it ignition pulses at 15,000 rpm, you would not expect that to work well for long.
 

Remember that 25MHz is the maximum crystal oscillator frequency at which stable reliable operation is guaranteed. This doesn't necessarily mean that the PIC won't work at crystal oscillator frequencies higher than 25MHz. It just means that you can't be sure that it'll work as expected. It's like saying, "It might work at >25MHz, but it wasn't designed for it. Thus the operation might be erroneous, random and unstable. And even if it does, it might fail anytime soon." Might not really be the most technically accurate, but I hope I could get the point across.

Hope this helps.
Tahmid.
 

Re: PIC18f QUARTZ OSCILLATOR STRANGE BEHAVIOR?!?

What is typical condensators value for 40MHz quartz?

40mhz is third overtone crystal. if you connect to PIC, it will oscillate at fundamental which is ~13mhz.
So your pic will work at ~13mhz, which is at about half speed from 24mhz. Exactly as you have seen.
 
to operate a crystal at an overtone frequency, you have to usually add a special designed LC 'trap' to the circuit. The resonant freq of the trap has to be chosen so that the crystal looks inductive below the 3rd overtone (40MHz) freq, and looks capacitive above this. So an LC tuned somewhere between 3rd overtone and the fundamental can be used - say at 25MHz

the exact configuration of course depends on the internal structure of the PIC oscillator pins
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…