PDA

View Full Version : 20 MHz + PLL vs 48MHz



Demon
- 27th July 2006, 03:42
What is the difference between using a 20 MHz crystal on a PIC 18F2550 running USB with this configuration:
CONFIG PLLDIV = 5 ;Divide by 5 (20MHz input)
CONFIG CPUDIV = OSC1_PLL2 ;[OSC1/OSC2 Src: /1][96MHz PLL Src: /2]
CONFIG USBDIV = 2 ;Clock source from 96MHz PLL/2
CONFIG FOSC = HSPLL_HS ;HS oscillator, PLL enabled, HS used by USB
DEFINE OSC 48 ' 20 MHz crystal with HSPLL enabled

and just using a 48 MHz crystal?

Is it more efficient? Is extra cost the only difference?

Also, what fuses would I need to change to use a 48 MHz crystal?

Thanks!

Robert
:)

Dave
- 27th July 2006, 22:15
Demon, The reason for using a lower crystal frequency is to reduce the emitted rf from the oscillator circuit. The higher you go in main oscillator frequency the more possible harmonics you can produce thru the crystal circuit and the PCB traces.
Dave Purola,
N8NTA

mister_e
- 28th July 2006, 13:18
in another hand, lower your crystal is, more you need to multiply it's value with the PLL... wich in some case may be a killer. PLL may and will drift with temperature change...more you multiply more it will drift.

As now i didn't experiment too much problem with 20MHZ but i doubt one day i'll have. A real 48MHZ osc should be better but will probably never work good on a bread-board. Nothing is perfect.

paul borgmeier
- 29th July 2006, 05:21
What is the difference between using a 20 MHz crystal on a PIC 18F2550 running USB with this configuration: ... and just using a 48 MHz crystal?
from datasheet: HS Oscillator mode max = 25 MHz

Am I underdstanding what you are trying to do? If so, then 48 MHz Xtal is not a good option unless you like to overclock your devices.

Darrel Taylor
- 29th July 2006, 06:04
EC mode can take 48mhz input.

But it needs to be an external oscillator. Crystal won't work.
<br>

Demon
- 29th July 2006, 13:05
Darrel,

I got some 48 MHz HC49 crystals from DigiKey along with the recommended caps. Why do you say crystals won't work and it must be an external oscillator? If it's a 48 MHz crystal, I don't undestand what might be the problem.

Or did you mean external RC won't work?

Robert
:)

Darrel Taylor
- 29th July 2006, 19:06
Like Paul said. 25mhz is the max spec for the HS oscillator.

EC (External Clock) mode can take the 48mhz directly, but the chip can't generate it itself.

There are so many oscillator modes on the 2550, it's pretty amazing. You can even get 48mhz from a 4mhz crystal.
<br>

Demon
- 30th July 2006, 04:02
Exactly, hence why I'm not sure which is the most efficient to use. Let me put it this way, if your life depended on it, which one would you chose?

- 20 MHz crystal boosted to 48 MHz using configuration settings.

or

- 48 MHz crystal.

This is not for a personal project, my goal is to one day market this creature and reliability is important to me.

Robert
:)

mister_e
- 30th July 2006, 15:44
By knowing what your project is... it will never be submit to extreme temperature variation... 20MHZ is more than enough safe. As now, mine works perfectly. I can't tell if it really worth to by a 48MHZ clock gen for a USB device. 20MHZ is safer than 4MHZ for sure... IMHO.

Demon
- 30th July 2006, 16:48
That's what I'm hoping.

This is designed to be used in PC gaming so it's meant for indoor use. I think the PC will act up before my circuit anyways.

This runs on 5V USB power at about 250 mA, I don't really have any heat issues on the circuit; LEDs, pushbuttons, 18F2550, 16F628, 24FC128, two MCP23016 and a graphic LCD.

Robert
:)

Darrel Taylor
- 30th July 2006, 18:45
Honestly, I'd probably go with 20mhz too, but is there a difference between a 4mhz and 20mhz crystal?

Let's say you have a standard 50ppm 4mhz crystal.

It's minimum frequency would be 3,999,800 &nbsp; (4,000,000 - .005%)
The max would be 4,000,200 (4,000,000 + .005%)

Now we multiply that times 12 to get the 48mhz and the ...
Minimum = 47,997,600
Maximum = 48,002,400

Check the PPM...
Minimum = (1 - (48,000,000/47,997,600)) = -0.005%
Maximum = (1 - (48,000,000/48,002,400)) = 0.005%

They are still 50ppm difference.

So whether you have a 4mhz or 20mhz crystal, you still end up with the same 50ppm tolerance.
And with 4mhz you also get less emitted radiation, and other PCB problems.

Interesting eh?

DT

mister_e
- 30th July 2006, 19:14
All good points!
i agree Darrel but my biggest concern is more about the PLL reliability and stability.. i'm still afraid of it. Maybe i'm comming old ;)

Darrel Taylor
- 30th July 2006, 20:01
It's a really interesting PLL on these chips.

The PLL's VCO always runs at 96mhz. And the crystals frequency is always divided down to 4mhz for the PLL reference. So in effect, the frequency of the crystal doesn't matter, only it's tolerance.

The only stability issue is the Jitter of +/- 0.25% But with either a 4mhz or 20mhz crystal, it's the same because it's inherent to the PLL.

The only way to remove the Jitter from the equation is to go back to the external clock (EC) and provide the 48mhz without using the PLL.

But, it won't really matter any which way you go. They'll all work just fine.

DT

Demon
- 30th July 2006, 23:15
... The PLL's VCO always runs at 96mhz. And the crystals frequency is always divided down to 4mhz for the PLL reference. So in effect, the frequency of the crystal doesn't matter, only it's tolerance....

DT

I noticed the division part, that makes a lot of sense. I just didn't know if there were other factors that would make a performance difference. So now I know that the tolerance is really what I'm concerned with when I'm selecting crystals.

I'll probably stick to 20 MHz components 'cause I've got lots in stock and I use them in other projects. But it is good to know that a 4 MHz crystal can be just as good for a 18F USB application.

Thanks guys!

Robert
:)

Dave
- 31st July 2006, 12:02
Demon, Don't for get to view the power requirements for the the osc. circuit. The faster the crystal the more power it will draw. Although it sounds like you will be running it off the USB power, if it were to be battery powered this is something to consider.
Dave Purola,
N8NTA