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.

TM4C internal clock configuration

Hi All,

I have developed my board with TM4C123, I have flashed it using XDS100v2-ARM.

I can see that LED toggling code is working good.

When I tried to get clock it in debug mode it shows

SysCtlClockGet = 0x0000077C which is 1916 Hz, why it is too low ?

I dont have any external oscillator connected on board. I wanted to set something around 50 MHz.

SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_INT);

are these parameters correct ?

  • Value seems odd (SYSCTL_XTAL_16MHZ) when clock source you like to be internal driven precision oscillator (PIOSC) and no XTAL is present.
  • Hello Sachin,

    The parameters are right. Can you read the variable that is being updated with the value of SysCtlClockGet?
  • Thank you for suggestion.

    I don't have external clock connected on board. I am looking for stable clock source. Can you please suggest better value which will give know result in frequency which I wanted to generate PWM.

    SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16_3MHZ | SYSCTL_OSC_INT);

  • Are you sure, because I can see that API explanation says.

    #define SYSCTL_XTAL_16MHZ       0x00000540  // External crystal is 16 MHz

    Where I wanted to set  internal driven precision oscillator (PIOSC) and no XTAL is present.

    SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_INT);

  • >I don't have external clock connected on board.
    Sounded like you were referring, last post see you confirmed Amit indeed No XTAL and No external clock source on custom PCB.

    It would seem to me you may need call (SysCtlAltClkCfg) to also assign peripherals an alternate clock source. Perhaps you can use the internal PIOSC with PLL but check TM4C123 data sheet as there may be some restrictions.

  • Hello Sachin

    When you use SYSCTL_OSC_INT, the source clock frequency is hardcoded as 16MHz. You can check the SysCtlClockSet API to see how it is programmed.