+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Full Member level 2
    Points: 777, Level: 6

    Join Date
    Nov 2018
    Posts
    121
    Helped
    1 / 1
    Points
    777
    Level
    6

    Enabling PLL in PIC18F

    Hi,

    I am having 16 MHz X-Tal crystal and I would like to get 40 MHz FOSC for higher baud rate. I guess PLL in PIC18F2550 can generate 4 times the crystal frequency but then it will be 64 MHz which device does not support as it is designed to support up to 48 MHz, right ?

    Is there any way to get 40 MHz from 16 MHz X-Tal crystal ?

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 2
    Points: 3,309, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    658
    Helped
    50 / 50
    Points
    3,309
    Level
    13

    Re: Enabling PLL in PIC18F

    PLLDIV = 4
    USDDIV = 2
    CPUDIV = HS, divided by 3

    These will give you 48 MHz CPU clock.

    Edit:

    Or

    PLLDIV = 4
    USBDIV = 2
    CPUDIV = HSPLL, divided by 2.
    FOSC3...0 = 1



    •   AltAdvertisement

        
       

  3. #3
    Advanced Member level 4
    Points: 7,924, Level: 21

    Join Date
    Jan 2015
    Posts
    1,109
    Helped
    349 / 349
    Points
    7,924
    Level
    21

    Re: Enabling PLL in PIC18F

    In a word: No!
    The issue with that MCU is that the PLL only multiples by 24 and must have an input frequency of 4MHz. (The reason is that this gives the 96/2 = 48MHz required for USB operation).
    Once you have a 96MHz clock, the only post-scalar divider options are divide by 2, 3, 4 or 6. To get 40MHz from 96MHz would require a division of 2.4!
    If you must have 40MHz then your only option is to use a 40MHz external oscillator, use EC mode and the 'divide by 1' option for the oscillator postscalar.
    On the other hand, as @baileychic has pointed out, you can easily get 48MHz, or 32MHz using the PLL and dividing by 3.
    As you are only wanting a faster Fosc for UART Baud rate purposes, then use the formula in the data sheet to find something that is close - but remember that a UART really need to be within 1-2% to be reliable.
    Susan



    •   AltAdvertisement

        
       

  4. #4
    Full Member level 2
    Points: 777, Level: 6

    Join Date
    Nov 2018
    Posts
    121
    Helped
    1 / 1
    Points
    777
    Level
    6

    Re: Enabling PLL in PIC18F

    PLL only multiples by 24 or 4 ? How about getting 40 MHz using PLL from internal 8 HMz ?



  5. #5
    Super Moderator
    Points: 262,035, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,803
    Helped
    13925 / 13925
    Points
    262,035
    Level
    100

    Re: Enabling PLL in PIC18F

    Im under the impression, you are trying to drag on the thread without ever looking into the 18F2550 datasheet…

    Simply notice that the PLL has fixed 96 MHz frequency. Possible CPU clock frequencies are integer parts (2,3,4,6) of 96 MHz.



--[[ ]]--