Connect with us

Crystal clock and USB operation

Discussion in 'Microcontrollers, Programming and IoT' started by Rajinder, Nov 19, 2020.

Scroll to continue with content
  1. Rajinder

    Rajinder

    445
    7
    Jan 30, 2016
    Hi all,
    I am using a PIC18F4520 microcontroller to use USB.

    I wanted to ask how the what crystal value I need to operate the USB at 480Mbits/s and 5Gbits/s.

    Is there a simple calculation that can help me?

    Thanks in advance
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    10,591
    2,360
    Nov 17, 2011
    You can use any crystal you like because the PIC18F4520 doesn't have a USB controller onboard. Therefore you need an external USB controller and you follow the datasheet of that external controller to determine the required crystal.

    YEs: max. clock speed of the PIC18F4520 is 40 MHz (32 MHz using the internal PLL), so 480 Mbit/s is impossible to achieve (you'd need 240 MHz at least for this) and 5 Gbit(s is way out of reach. It's all in the datasheet.
     
    Last edited: Nov 19, 2020
    hevans1944 and Rajinder like this.
  3. Rajinder

    Rajinder

    445
    7
    Jan 30, 2016
    Hi
    Thanks for your reply. Please could you explain why I would need a 240MHz crystal to achieve 480Mbits/s? I do not know and any help would be appreciated.
    Just a question, if I used a PIC 18F14K50, could I achieve the speeds of 480Mbits/s and 5Gbits/s with an external crystal.
    Please could you explain in simple terms the calculation of clock frequency to achieve these speeds, thanks.
     
  4. hevans1944

    hevans1944 Hop - AC8NS

    4,543
    2,116
    Jun 21, 2012
    @Rajinder: Visit this page for information on how to implement a USB 2.0 interface. PICs might have been suitable for the original USB 1.0 standard (1.5 Mbps low-speed and 12 Mbps high-speed), but any PIC is waaay too slow for USB 2, much less USB 3, data transfer rates. You need a USB controller, not a PIC to act as your host.

    With regard to your post #3, please download and read the information at the link I provided. Also read and employ the advice given by @bertus in his "signature line" included at the end of each of his posts. Please don't remain ignorant.
     
    Harald Kapp and bertus like this.
  5. Harald Kapp

    Harald Kapp Moderator Moderator

    10,591
    2,360
    Nov 17, 2011
    The minimum clock requirements come from the basic facts of serial communication: If you transmit one bit per clock edge, you can at max. transmit 2 bits per clock cycle (disregarding higher coding schemes that can transmit more than one bit per clock edge). So 480 Mbit/s translates to 240 MHz.
    This will be the minimum requirement. Everything else depends on the construction of the serial communication circuit. The datasheet of the controller will explain how to proceed.
     
    Rajinder likes this.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-