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.

TM4C1233H6PM SysCtlClockSet

Other Parts Discussed in Thread: TM4C1233H6PM

HI there, 

I am having trouble setting the clock rate in my program. Im using the TM4C1233H6PM micro. 

PLL clock = 400Mhz, Main oscillator = 16Mhz , Desired Clock rate= 6Mhz or above

SysCtlClockSet(SYSCTL_SYSDIV_4| SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ |SYSCTL_OSC_MAIN) 

I have found the above code online, which sets the clock to 50Mhz. I dont understand how this calculation has been made? In the sysctl.h it says that processor clock is osc/pll /4, but when I do this calculation i get a decimal value. (16e6/400e6/4 = 0.01??)

Can someone please explain me how clock speed is calculated using PLL,Divider, and Xtal?

 Thank you in advance

  • Hi,

        Refer to your device datasheet at the System Clock Section. There is a table there on what would be the system clock using "these settings".

    Embedded_career said:
    SysCtlClockSet(SYSCTL_SYSDIV_4| SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ |SYSCTL_OSC_MAIN) 

    This would provide 50 Mhz System Clock. If you check the Clock Tree Diagram the equation should be

    400MHZ(PLL) /2 / 4 = 50 Mhz

    The 4 is SYSCTL_SYSDIV_4

    -kel

  • Hello All,

    On TM4C123 devices the Cyrstal Value is used to select the Locking parameters in terms of M and N fpr the PLL. It is for this reason that the SYSCTL.RCC register has the XTAL selection field. The XTAL value when selected is used to then program a pre defined value to the PLL to get 400MHz PLL output.

    As Kel mentioned this is then applied with the divider value to get the System Clock.

    Regards

    Amit