This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Chip Support Library PLL Configuration question



All:

In the chip support library, there is a set up for PLL that has entries like this:

PLL_Config pllCfg_12p288MHz = {0x8173, 0x8000, 0x0806, 0x0000};
PLL_Config pllCfg_40MHz     = {0x8988, 0x8000, 0x0806, 0x0201};
PLL_Config pllCfg_60MHz     = {0x8724, 0x8000, 0x0806, 0x0000};
PLL_Config pllCfg_75MHz     = {0x88ED, 0x8000, 0x0806, 0x0000};
PLL_Config pllCfg_100MHz    = {0x8BE8, 0x8000, 0x0806, 0x0000};
PLL_Config pllCfg_102p4MHz  = {0x8BE8, 0x8000, 0x0806, 0x0000};
PLL_Config pllCfg_120MHz    = {0x8E4A, 0x8000, 0x0806, 0x0000};

I am having trouble finding information about the 4 parameters in the parentheses above. At first, I thought it was contents of CGCR1, CGCR2, CGCR3, and CGCR4, but I have seen nothing to confirm. Can someone tell me what each of the 4 parameters represents?

 

  • Todd, looking at the first parameter in this list I'd say those entries correspond to table 11-1 in SPURGH5a.

    Therefore, I conclude that the first entry is CGCGR1.  I'm assuming the CGCGR2, 3 and 4 entries follow in order.

    Is there a specific concern you have about using these settings?

  • Todd,

    Todd Anderson78572 said:
    Can someone tell me what each of the 4 parameters represents?

    These are the various Clock Generator registers. Below is some sample code from my PLL init routine. See the comments. You can verify this by running the CSL example code and single stepping through the PLL_config() function. 

    #if (PLL_120M ==1)
    PLL_CNTL2 = 0x8000; //CGCR2 (input/reference divider) RDRATIO + 4
    PLL_CNTL4 = 0x0000; //CGCR4 (output divider) ODRATIO + 1
    PLL_CNTL3 = 0x0806; //CGCR3 fixed
    PLL_CNTL1 = 0x8E4B; //CRCR1 PLL Multiplier + 4

    Unfortunately, as with most of the C55xx CSL, the documentation is horrible and outdated.

    Take a look at SPRUFX5D starting in section 1.3, Device Clocking.

    I hope this helps .

  • All:

    I think that Mike's input represents what I am seeing - PLL_CNTL1 does NOT represent CGCR1 only, but bits from CGCR1 and CGCR2 - mainly the MH+ML bits get combined to form PLL multiplier (+4 !!!).

    PLL_CNTL2 does NOT represent CGCR2, but a subset of CGCR2. (ML bits are included in PLL_CNTL1.)

    I agree that PLL_CNTL3 probably does represent CGCR3, and PLL_CNTL4 probably does represent CGCR4.

    Can someone confirm what I have stated?

     

  • Todd,

    What version of the Chip Support Library are you referencing?  It is important to make sure we are on the same page and looking at the same information.  Thank you.

  • v2.50.00.00

    Todd

  • The definition of the data structure PLL_Config is in <CSL_INSTALL_DIR>\c55xx_csl\inc\csl_pll.h.  How these parameters correspond to registers of the PLL are in the PLL_Config() API implementation itself found in <CSL_INSTALL_DIR>\c55xx_csl\src\csl_pll.c.

    typedef struct {
      Uint16    PLLCNTL1;
      Uint16    PLLINCNTL;
      Uint16    PLLCNTL2;
      Uint16    PLLOUTCNTL;
    } PLL_Config;

    CSL_Status PLL_config(PLL_Handle hPll, PLL_Config *pconfigInfo)
    {
    ...
        hPll->sysAddr->CGICR = pconfigInfo->PLLINCNTL;
        hPll->sysAddr->CGOCR = pconfigInfo->PLLOUTCNTL;
        hPll->sysAddr->CGCR2 = pconfigInfo->PLLCNTL2;
    ...
    #if (defined(CHIP_C5505_C5515) || defined(CHIP_C5504_C5514))
        hPll->sysAddr->CGCR1 |= ((CSL_SYS_CGCR1_VP_MASK | CSL_SYS_CGCR1_VS_MASK) & pconfigInfo->PLLCNTL1);
    #else
        hPll->sysAddr->CGCR1 |= (CSL_SYS_CGCR1_MH_MASK & pconfigInfo->PLLCNTL1);
    #endif
    ...
    }

  • So, is this a confirmation of Mike's email? I can assume the answer is yes.

     

     

  • I put together the pieces of this puzzle, thanks to input from Mike and Brandon:

    PLL_Config pllCfg_120MHz = {0x8E4A, 0x8000, 0x0806, 0x0000}

    Parameter 1 = 0x8E4A generates Clock Generator Control Register 1 (CGCR1)

    (Chip support library ANDs the most significant 4 bits, leaving E4E, then adds 4, leaving a decimal value of 3666, which is multiplied by 32768 to get the clock              frequency of 120.127488 MHz.  32.768 KHz is the input frequency.)

    Parameter 2 = 0x8000  generates Clock Generator Control Register 2 (CGCR2)

    (Set RDBYPASS – reference divider bypass)

    Parameter 3 = 0x806 generates Clock Generator Control Register 3 (CGCR3)

    (Internal TI default value must be used for this register.)

    Parameter 4 = 0x0000 generates Clock Generator Control Register 4 (CGCR4)

    (Output divider is disabled.)