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

Set Timer tick for system clock task

Hello,

I changed the values for PLL in the startup_RTX.s file from the "HTTP_Example with RTX". Following is the code I changed. The original values are the one with ";" in front. This part of coude can be found at around line 300 of the startup file.

;PLLCFG_Val      EQU     0x00000007             ;7+1 = 8 * multiplier van mainclock (=>72MHz)
PLLCFG_Val      EQU     0x0000000B              ;11+1 = 12 * (12*2)/1 = 288MHz intern
;CCLKCFG_Val     EQU     0x00000003             ;3+1 = 4 * divider van PLLclock
CCLKCFG_Val     EQU     0x00000004              ;3+1 = 4 * divider van PLLclock = 72MHz
;USBCLKCFG_Val   EQU     0x00000003             ;3+1 = 4 * divider van PLLclock
USBCLKCFG_Val   EQU     0x00000005              ;5+1 = 6 * divider van PLLclock = 48 MHz
PCLKSEL0_Val    EQU     0x00010000              ;PCLK_SPI set to CCLK (48MHz)

So I changed it to have the following things:
-internal PLL rate of 288MHz
-divided by 4, this gives 72MHz for CPU
-divided by 6, this gives 48MHz for USB

When I do this, then the system clock isn't correct any more. What do I have to change to get it right again? The original CPU speed is 48MHz. So when I want to generate a periodic cycle of 2s, it's now only 1.333s...

Also, could it be that the CPU is less stable? When I reset my CPU, it blocks about 4 on 5 times.

Anyone got any experience with this?

Parents Reply Children
  • Sorry,

    I changed some code to test, but I did not change the comment. That second line of comment would heave to be "4+1 = 5 * divider van PLLclock = 57.6MHz"

    Normally the CCLKCFG_Val must stay 0x00000003 => 3+1 = 4 * divider, wich gives 288/4 = 72MHz.

    The original internal value is 192Mhz (wich gives CPU speed of 48MHz when divided by 4). But I also saw in the user manual (p.36 in the middle) that the internal PLL clock speed should be between 275 and 550 MHz.

    Why do some examples wich are given by Keil not follow the instructions? Or isn't this harmfull?

    PS: I use LPC2378

  • Have you downloaded and tried the PLL calculator available almost at the bottom of this page:

    www.standardics.nxp.com/.../

  • When I fill in this one, I get the same values as the one I calculated.
    M value = 12, N value = 1

    But in this app you can only have CPU speed of 48MHz if I choose USB. But it must be possible to choose a CPU speed wich is not depending on the one of USB (at least I think so)

    Do I have to change something in the RTX_Config file when I change these timings?