I try to set the system clock to about 8MHz, using an external 25MHz crystal (result should be then 8.33MHz). I am using TivaWare 2.1.4.178 with the following code:
g_ui32SysClock = SysCtlClockFreqSet((SYSCTL_OSC_MAIN | SYSCTL_USE_OSC | SYSCTL_XTAL_25MHZ), SYSFREQ_STANDBY);
The result is 5,365MHz, however, which is a result of PIOSC/3 (16MHz/3), but the function returns 8.33MHz.
Checking the code of the library, I saw, that everything is set-up correctly, but then in the last line of the function there is:
//
// Finally change the OSCSRC back to PIOSC
//
HWREG(SYSCTL_RSCLKCFG) &= ~(SYSCTL_RSCLKCFG_OSCSRC_M);
If I look into older versions of the driverlib (2.1.2.111), this code is missing and the function works fine. Has there a bug been introduced or is there some strange intention behind this last line?
Regards
Klaus