Crystal Choice for PIC USB

Discussion in 'The Projects Forum' started by blah2222, Apr 18, 2013.

  1. blah2222

    Thread Starter Well-Known Member

    May 3, 2010
    554
    33
    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
     
  2. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    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.
     
  3. blah2222

    Thread Starter Well-Known Member

    May 3, 2010
    554
    33
    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?
     
  4. John P

    AAC Fanatic!

    Oct 14, 2008
    1,632
    224
    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.
     
  5. blah2222

    Thread Starter Well-Known Member

    May 3, 2010
    554
    33
    Does anyone have any information regarding my initial questions?
     
  6. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,675
    2,723
  7. blah2222

    Thread Starter Well-Known Member

    May 3, 2010
    554
    33
    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?
     
  8. blah2222

    Thread Starter Well-Known Member

    May 3, 2010
    554
    33
  9. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,024
    When in uCHIP, consult uCHIP. Then look at the datasheet Electrical Characteristics for your particular device.
     
  10. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    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.
     
Loading...