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

About PCLK

Hi,

I have bought a LandTiger development board for LPC1768. it has a 12Mhz Xtal on it. I am trying to use its USART0 and I need to know PCLK. is it 3MHz? I devide 12 by 4. am I right?

Parents
  • I take it you haven't actually downloaded the PLL spreadsheet from NXP:s site?
    And you didn't try my formula either.

    PLL0 = 2 * M * FOSC / N = 2 * 10 * 12 / 2 = 120MHz.
    But the datasheet §5.1 says the PLL0 requires a frequency 275 - 550 MHz. 120MHz is much too low.

    Change M = 12
    Change N = 1
    Then you get PLL0 = 2*12*12/2 = 288MHz.

    With CPUDIV = 4, you then get CCLK = PLL0/4 = 288/4 = 72MHz

    With PCLK_DIV = 4, you then get PCLK = CCLK/4 = 72/4 = 18MHz.

    Then compute a suitable baudrate divisor to get your required baudrate.

    Or select a different set of M, N, CPUDIV and run the CCLK at a different speed - if I remember correctly, some LPC17xx manages 100MHz and some manages up to 120MHz.

    If you need really high UART baudrates, you might consider to use a lower PCLK_DIV to not get too large baudrate error from rounding error when computing the baudrate divisor - but that also depends on how high CCLK you configure.

Reply
  • I take it you haven't actually downloaded the PLL spreadsheet from NXP:s site?
    And you didn't try my formula either.

    PLL0 = 2 * M * FOSC / N = 2 * 10 * 12 / 2 = 120MHz.
    But the datasheet §5.1 says the PLL0 requires a frequency 275 - 550 MHz. 120MHz is much too low.

    Change M = 12
    Change N = 1
    Then you get PLL0 = 2*12*12/2 = 288MHz.

    With CPUDIV = 4, you then get CCLK = PLL0/4 = 288/4 = 72MHz

    With PCLK_DIV = 4, you then get PCLK = CCLK/4 = 72/4 = 18MHz.

    Then compute a suitable baudrate divisor to get your required baudrate.

    Or select a different set of M, N, CPUDIV and run the CCLK at a different speed - if I remember correctly, some LPC17xx manages 100MHz and some manages up to 120MHz.

    If you need really high UART baudrates, you might consider to use a lower PCLK_DIV to not get too large baudrate error from rounding error when computing the baudrate divisor - but that also depends on how high CCLK you configure.

Children