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.

TMS320VC5502 PLL initialization problem.



Hello,

The DSP input clock are 20MHz. I'm trying to init PLL but the LOCK bit in PLL control/status register never becomes 1.

Did anybody had the same problem? 

 

#define     PLLCSR      (*(volatile ioport unsigned short int *) 0x00001C80)
#define     CK3SEL      (*(volatile ioport unsigned short int *) 0x00001C82)
#define     PLLM        (*(volatile ioport unsigned short int *) 0x00001C88)
#define     PLLDIV0     (*(volatile ioport unsigned short int *) 0x00001C8A)
#define     PLLDIV1     (*(volatile ioport unsigned short int *) 0x00001C8C)
#define     PLLDIV2     (*(volatile ioport unsigned short int *) 0x00001C8E)
#define     PLLDIV3     (*(volatile ioport unsigned short int *) 0x00001C90)

void PLLSetup( void )
{
    volatile unsigned long cnt = 0;

    // 1. Switch to bypass mode by setting the PLLEN bit to 0.
    PLLCSR &= ~BIT0;
    for( cnt = 0; cnt < PLL_SETUP_WAIT; cnt++ )
        asm("  nop");

    // 2. Set thePLL to its reset state by setting the PLLRST bit to 1.
    PLLCSR |= BIT3;
    // 3. Change the PLL setting through the PLLM and PLLDIV0 bits.
    PLLM    = 5; // 0x0F;
    PLLDIV0 = ( unsigned short )( BIT15 | 0x01 );

    // 4. Wait for 1 µs.
    for( cnt = 0; cnt < PLL_SETUP_WAIT; cnt++ )
        asm("  nop");
    // 5. Release the PLL from its reset state by setting PLLRST to 0.
    PLLCSR &= ~BIT3;

    // 6. Wait for thePLL to relock by polling the LOCK bit
    while(( PLLCSR & BIT5 ) == 0) 
        asm("  nop");
    // 7. Switch back to PLLmode by setting the PLLEN bit to 1.
    PLLCSR |= BIT0;

}

Thanks in advance.

Kirill

 

 

  • I just used the CSL functions, like so...

     

    PLL_Config pll_cfg;

    // This will set a clock freq of 195 MHz

         pll_cfg.iai = 1;

         pll_cfg.iob = 1;

         pll_cfg.pllmult = 15; // The main input clock is 13 MHz.  13*15/1 = 195 MHz

         pll_cfg.div = 1;

     

         PLL_config( &pll_cfg );

     

    But if you can't use the CSL, then I don't have much to offer.  I haven't gotten down and hacked on those regs yet.