This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

help regarding initialization of pll of lpc2129

i want to know how to use logic analyser to check the pllclock also i want to initialize the non-blocking pll i.e. it should not wait for the lock state please help me through this i m new to the arm 7 family

  • Hi,
    pll clock is inside the lpc, and you can not probe it anyway.

    Regards
    Maurizio

  • actually i just want to know the exact working of non blocking pll i.e. it should not wait for pll tobe locked it should continue with the external clock and whenn pll is lock it should replace

  • Hi,
    the pll work as described on manual:

    The program must configure
    and activate the PLL, wait for the PLL to Lock, then connect to the PLL as a clock source.

    Usually this is done inside the startup file, that are .s extension, and you can find someone easy for your development tool/compiler.

    What are exactly your problem/question?

    Regards
    Maurizio

  • sir actually I know the traditional way of initialising the pll but the main proleminthe code is i m waitng for the pll to be locked whereas i don't want to this, what i exactly want to do is i want to carry on my work on the external clock and when pll is locked i want to replace it with the external clock

    this is the initializing code that i have
    void init(void)
    { PLLCFG=0x24; //set multiplier/divider values PLLFEED=0xaa; PLLFEED=0x55; PLLCON=0x01; //enable PLL PLLFEED=0xaa; PLLFEED=0x55; while(!(PLLSTAT & PLOCK)); //wait for the PLL to lock to set frequency PLLCON=0x3; //connect the PLL as the clock source PLLFEED=0xaa; PLLFEED=0x55; MAMCR=0x02; //enable MAM MAMTIM=0x04; //set number of clocks for flash memory fetch VPBDIV=0x01; //set peripheral clock(pclk) to system clock(cclk)
    }

  • sir actually I know the traditional way of initialising the pll but the main proleminthe code is i m waitng for the pll to be locked whereas i don't want to this, what i exactly want to do is i want to carry on my work on the external clock and when pll is locked i want to replace it with the external clock

    this is the initializing code that i have

    
    void init(void)
    {
        PLLCFG=0x24;                //set multiplier/divider values
        PLLFEED=0xaa;
        PLLFEED=0x55;
        PLLCON=0x01;                //enable PLL
        PLLFEED=0xaa;
        PLLFEED=0x55;
        while(!(PLLSTAT & PLOCK));  //wait for the PLL to lock to set frequency
        PLLCON=0x3;                 //connect the PLL as the clock source
        PLLFEED=0xaa;
        PLLFEED=0x55;
        MAMCR=0x02;                 //enable MAM
        MAMTIM=0x04;                //set number of clocks for flash memory fetch
        VPBDIV=0x01;           //set peripheral clock(pclk) to system clock(cclk)
    }
    

  • Hi,
    if you want use the external clock, and not pll, you must simply jump the pll enable.
    The external clock is used at startup and even the pll is activated and stable; but if you don't want use pll, simply don't start it.

    If is it not the answer that you wait, you must better explain your question.

    Regards
    Maurizio

  • Nothing says that you have to wait for the PLL to lock after having configured the PLL. You just have to make sure that the PLL has a stable frequency before you switch oscillator source.

    So - turn on the PLL and then continue with your program.

    At a later section in the program, check if the PLL has stabilized, and then start using it.

    It is, of curse, up to you to check how your program is affected by where/when you finally switch to the different frequency.

  • alternatively a interrupt can be generated when the PLL locks, so that you can carry out other tasks while the PLL starts . once the PLL has locked as a stable clock source , it can replace the external clock source for Cclk.
    this is given in the hitex book for lpc2129 as an alternative way for starting the pll.

    also see datasheet for lpc2129 software interrupt register pin no. 12 i.e. for the same purpose

  • alternatively a interrupt can be generated when the PLL locks, so that you can carry out other tasks while the PLL starts . once the PLL has locked as a stable clock source , it can replace the external clock source for Cclk.
    this is given in the hitex book for lpc2129 as an alternative way for starting the pll.

    also see datasheet for lpc2129 software interrupt register pin no. 12 i.e. for the same purpose

  • Only note about use of interrupt for PLL lock is of course that the interrupt comes at a random position in the program execution. Having the switch take place at a known location in the program often has its advantages.

  • Still i want to be get cleared about the INTERRUPT for PLL connect concept.
    Will u plz explain it to me...!
    With refeerence to the code.

  • It works as the manual says it does. You can perform the first part of PLL activation and have the processor generate an interrupt when the PLL has locked. When you get the interrupt, you can perform the second part.

    This allows you to insert own code to do a lot of other things instead of having a while loop busy-waiting for the PLL lock.

    The manual for the chip specifically mentions that the PLOCK bit of the PLLSTAT register is connected to the interrupt controller and says:
    "This allows for software to turn on the PLL and continue with other functions without having to wait for the PLL to achieve lock. When the interrupt occurs (PLOCK = 1), the PLL may be connected, and the interrupt disabled."

    Actual configuration/handling of interrupts is similar to other interrupt sources in the chip.

  • can u please give me a sample code for the same
    plz.......

  • I knew you would ask that. You just do not want to do any work yourself. Yes I can. But where do I send the bill?