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.

TI-RTOS Kernel Workshop using TM4C1294XL

Other Parts Discussed in Thread: TM4C123GH6PM, TM4C1294NCPDT

Hi, I'm going through the Kernel Workshop labs using a TM4C1294XL launchpad instead of the TM4C123GH6PM.

Currently having some issues setting up the clock.

In the Lab05 example code (TM4C123GH6PM) they set the clock via:

//Set CPU Clock to 40MHz. 400MHz PLL/2 = 200 DIV 5 = 40MHz
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);

In the non TIRTOS "hello world" example (TM4C1294XL) they use:

//
// Run from the PLL at 120 MHz.
//
g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);

Do they perform the exact same function? The datasheet that details Clocks and PLL doesn't really cover this..

Also, does the following error below affect me?

http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/330524/1156581.aspx#1156581

Thanks,

Stephen

  • Hi Stephen,

    The TM4C1294NCPDT (device on TM4C129XL launchpad) and the TM4C123GH6PMI (device on TM4C123GXL launchpad) operate at two different frequencies and actually have two different clock trees, each with its own set of APIs (SysCtlClockSet vs. SysCtlClockFreqSet).  You can find simplified clock diagrams in Chapter 5 of each respective datasheet.  

    I am glad to hear you are stepping through the Kernel Workshop labs, but since you are using a device other than specified you will need to "patch" the code to work on the TM4C129XL.  In this case, use code that resembles TM4C129x device examples.

    Stephen Keng said:

    Also, does the following error below affect me?

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/330524/1156581.aspx#1156581

    I am not sure if the TM4C129x line of devices also are affected by the error, posting this on the TIvaC forum (here) are better prepared to answer this question.  On a better note, SYS/BIOS does not rely on TivaWare APIs to configure clocks.  As you move further on in the training, you should learn how to have SYS/BIOS do it for you.

    Thanks,

    -- Emmanuel

  • I understand now.

    // // Timer 2 setup code
    // SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2); // enable Timer 2 periph clks
    // TimerConfigure(TIMER2_BASE, TIMER_CFG_PERIODIC); // cfg Timer 2 mode - periodic
    //
    // //ui32Period = (SysCtlClockGet() /2); // period = CPU clk div 2 (500ms) *Doesn't work with TM4C129x
    // ui32Period = (120000000 /2); // period = CPU clk div 2 (500ms)
    // TimerLoadSet(TIMER2_BASE, TIMER_A, ui32Period); // set Timer 2 period
    //
    // TimerIntEnable(TIMER2_BASE, TIMER_TIMA_TIMEOUT); // enables Timer 2 to interrupt CPU
    //
    // TimerEnable(TIMER2_BASE, TIMER_A); // enable Timer 2

    Another thing I noticed is that SysCtlClockGet() doesn't seem to work.

    I had to hardcode the 120000000 value to get the intended results.

  • Stephen,

    What do you mean by SysCtlClockGet() doesn't seem to work? What value is it returning or is it returning anything at all?

    Moses

  • The value it is returning is 9600000 when SysCtlClockSet/SysCtlClockFreqSet is not used.

    The value it is returning is 9600000 when SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 40000000); is used

    It appears SysCtlClockGet() returns that particular value regardless of what the clock is set at.

    Basically SysCtlClockGet() doesn't work with TM4C129x.

    I believe my question is answered here:

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/324693.aspx

    I think it would be good to have a record of these small differences between the TM4C devices.

    Thanks

  • Stephen,

    Glad you found an answer. If you're using TI-RTOS, I'll recommend using the TI-RTOS kernel API's to configure your clock. Hopefully you'll learn about that from the training material you're using.

    Regards,

    Moses