Crystal Choice for PIC USB

Thread Starter

blah2222

Joined May 3, 2010
582
Hi all, I am building the PIC18F4550 USB module and decided to use a 20MHz crystal oscillator. The PIC datasheet specifies to use a parallel-cut crystal but it does not specify the load capacitance and there is no mention of PPM for how much the USB clock can drift away from 48MHz before it starts failing.

Looking at Digikey I have filtered the products down this far: link but I am not sure what the difference between frequency tolerance and stability are as well as what ESR and load capacitance to go with.

Also, from what I understand you need to take stray PCB trace capacitance into account as well. So, how do you end up choosing what capacitors to place on either side of the crystal?

Thank you,
JP
 

takao21203

Joined Apr 28, 2012
3,702
Simple: Don't care at all.

Use 27pF.

And you need 12 MHz for these + configure 4x PLL multiplier.

Other PICs, some use 4 MHz crystals for USB.
 

Thread Starter

blah2222

Joined May 3, 2010
582
From the datasheet you can use anything that enables you to get down to 4MHz using PLLDIV and the examples that I am stemming my design from all use 20MHz, so to keep the coding easier I'm sticking with that.

Microchip also has a lot of documentation on how the loading capacitance affects the frequency PPM so I believe it does matter.

Does anyone have any other advice?
 

John P

Joined Oct 14, 2008
2,026
The claim is that the PIC16(L)F1454/5/9 can operate without a crystal, which works because the chip can auto-tune its oscillator to match incoming USB data. I'd like to hear that someone has made this work.
 

Thread Starter

blah2222

Joined May 3, 2010
582
Does this help:

Clock tolerance is 480.00 Mbit/s ±500 ppm, 12.000 Mbit/s ±2500 ppm, 1.50 Mbit/s ±15000 ppm.

From http://en.wikipedia.org/wiki/Universal_Serial_Bus
Hm, yeah I saw this wiki as well. I don't know much about USB 2.0 protocol, but is the data transferred in packets of 10 bits every cycle? Seems odd because USB implies a bit-by-bit serial transfer.

I am trying to translate the 48MHz USB clock to their specified transfer rate:

USB clock = 48 cycles/second
Data packet = 10 bits/cycle
Bit transfer = USB clock * Packet = 480 Mbits/second

Any idea?
 

ErnieM

Joined Apr 24, 2011
8,377
Bottom line: just pick a crystal with the same capacitance as the MC example and you are good to go for USB. Resonators *may* work, but the worst case tolerance is excessive for the USB spec.

Making a crystal work isn't rocket science. I used to think so, maybe 10 years back. Now I don't stress about it and have no problems.
 
Top