Other Parts Discussed in Thread: SYSBIOS
I'm trying to change the system clock on the TM4C129X and am having some issues. I have been developing on the dev kit which has a 25MHz crystal. I just received our first run of prototypes and am successfully able to load code and run my program...however we are using a 16MHz crystal. I'd still like to run at 120MHz like the dev kit. I have tried the following code with no luck.
I am using IAR version 7.20.2 and TI-RTOS version 2.00.02.36
/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Types.h>
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
/* TI-RTOS Header files */
#include <ti/drivers/GPIO.h>
#include <ti/drivers/UART.h>
/* Example/Board Header files */
#include "Board.h"
/* USB Reference Module Header file */
#include "USBCDCD.h"
#include "diagUART.h" // for UART init
#include "debugPrint.h"
#include "irdaDriver.h"
#include "gpioDriver.h"
#include <driverlib/sysctl.h>
/*
* ======== main ========
*/
int main( void )
{
uint32_t clockspeed;
uint32_t baudclock;
Types_FreqHz freq;
Bits32 loFreq;
// Set clock
SysCtlClockSet( SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL |
SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN );
clockspeed = SysCtlClockGet();
BIOS_getCpuFreq( &freq );
/* Call board init functions */
Board_initGeneral();
Board_initGPIO();
Board_initUART();
Board_initI2C();
InitDebugPrint();
InitDiagUart();
Board_initLCD();
Board_initUSB( Board_USBDEVICE );
GPIO_Init();
/* Call CDC init */
USBCDCD_init();
/* Start BIOS */
BIOS_start();
return (0);
}
Changing the parameters in SysCtlClockSet() have no affect on the clock speed when I call SysCtlClockGet(). I always return 96MHz. I thought I remember reading somewhere that SysCtlClockGet() is not supported with this micro, but I can't seem to find that now. It is in the Tivaware Peripheral library and is used in a lot of the function calls. I traced the code back to sysctl.h and found the PLL defines and tried altering those to see if anything changed. This did not change the clock speed either. Does the sysctl.h file not get compiled at runtime?
//***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PLLFREQ0 // register. // //***************************************************************************** #define SYSCTL_PLLFREQ0_MFRAC_M 0x000FFC00 // PLL M Fractional Value #define SYSCTL_PLLFREQ0_MINT_M 0x000003FF // PLL M Integer Value #define SYSCTL_PLLFREQ0_MFRAC_S 10 #define SYSCTL_PLLFREQ0_MINT_S 0 //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PLLFREQ1 // register. // //***************************************************************************** #define SYSCTL_PLLFREQ1_Q_M 0x00001F00 // PLL Q Value #define SYSCTL_PLLFREQ1_N_M 0x0000001F // PLL N Value #define SYSCTL_PLLFREQ1_Q_S 8 #define SYSCTL_PLLFREQ1_N_S 0
Any help would be appreciated. Thanks!

