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.

Compiler/TM4C1294NCPDT: SysCtlClockFreqSet() Function.

Part Number: TM4C1294NCPDT

Tool/software: TI C/C++ Compiler

Hello, Everyone.

I'm a embedded system research engineer in South Korea.

I'm using TM4C1294XL and TivaWare_C_Seires-2.1.4.178 library.

There is a so strange coding in SysCtlClockFreqSet() function.

Under the function, it finish by changing OSCSRC to PIOSC.

If I used SysCtlClockFreqSet() to use MOSC and no-PLL mode, I must use PIOSC forcibly.

I can't understand why it finish after change OSCSRC to PIOSC.

because PIOSC ensure safe and it is used for internal functions?

I think it's not correctly answer.

  • I am able to reproduce the issue you describe, and agree that it does not look correct. I need to take some time to determine why it is not as we expect. I will update you tomorrow.

  • I can see when the change was made, (April 2016) but not why. If I comment out line 2479, the function SysCtlClockFreqSet() will work with main oscillator, PIOSC or PLL. I will enter this as a bug to be fixed in the next release. In the meantime, you can copy the file "sysctl.c" from the driverlib directory into your project and then comment out line 2479. 

        HWREG(SYSCTL_RSCLKCFG) &= ~(SYSCTL_RSCLKCFG_OSCSRC_M);
    

  • I have some more information on why the SysCtlClockFreqSet() function always sets the oscillator source as the PIOSC. It is related to erratum SYSCTL#23. To avoid a possible bus fault on reset it is recommended to use the PLL to generate 25MHz (or whatever the MOSC frequency is) when that is the desired operating frequency. Note that the PLL can be locked to the MOSC, but the OSCCLK (which is not used) is switched to PIOSC.