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.

SW-EK-TM4C123GXL: SYSTEM CLOCK Used as 30Khz

Part Number: SW-EK-TM4C123GXL
Other Parts Discussed in Thread: TM4C123GH6PM

Hello ,

In clock section of datasheet TM4C123GH6PM,I have read that that the System clock can be generated using various options listed.

But when i tested it with Internal 30Khz,the device got locked up(debugger).Anyway i unlocked it using LM Flash programmer.

So i am posting this query and need to know following which are not clearly mentioned in Datasheet.

1). What is the minimum frequency we can run the device tm4c123g?

2).why the system gets locked up when running at 30Khz internal OSC.

Regards 

Sajad

  • Hello Sajad,

    Are you referring to the Low Frequency Internal Oscillator (LFIOSC)?

    When you say run, what operations are planning to do?

    I ask this because the LFIOSC is meant to be used for power saving modes to reduce power consumption and allowing the device to run with bare minimum current draw until it detects a wake event. Once the wake event occurs, then it should power up and use PIOSC or MOSC for normal operations.

    As far as minimum frequencies, that answer is dependent on what you want to do as many peripherals will impact what the minimum frequency you can use is. The datasheet also outlines possible frequencies for PIOSC on pages 223 and 224.
  • Dear Ralph,

    Yes i am talking about same LFIOSC with 50% tolerence.

    I know that this oscillator as per datasheet is intended for deepsleep mode,but same data sheet also says that it can drive the system clock too.

    The operation i  was doing just two days back- digging timer Module capabilities and i configured TIMER 0 in 32 bit mode and generated interrupts to flash LED and it works very well. As also we can configure the same timer Timer0 in 16 bit mode as a split pair of TIMER A & TIMER B.So i did some program write up for TImer 0 Subtimer A to generate interrupt and toggle LED state,but as my clock was set to 40Mhz , & 16 bit timer can have value range from 0 -65535 ,i was not able to see the toggling happen,So i configured the clock to use internal Osc 30KHZ, and set my timer period as system clock to see led toggle per second.But my processor debugger gets locked and i have to use LMFlash Programmer to unlock.

    So i am wondering why it shows such behaviour, orelse i have missed something related to timers.

    Anyway below is my code for same

    #include <stdint.h>

    #include <stdbool.h>

    #include "inc/tm4c123gh6pm.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/gpio.h"
    #include "driverlib/timer.h"
    uint16_t Period;
    int a;

    int main(void)
    {

                SysCtlClockSet (SYSCTL_USE_OSC|SYSCTL_OSC_INT30); //Gets Locked
    ///////SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
    a = SysCtlClockGet();
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);

    TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR|TIMER_CFG_A_PERIODIC); 

    Period = SysCtlClockGet();

    TimerLoadSet(TIMER0_BASE, TIMER_A, Period -1);

    IntEnable(INT_TIMER0A);

    TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);

    IntMasterEnable();
    TimerEnable(TIMER0_BASE, TIMER_A);

    while(1)
    {

    }
    }

    void xyz(void)
    {
    TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
    if(GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_1))
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, 0);

    }
    else
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, 2);

    }
    }

    Regards 

    Sajad

  • Hello Sajad,

    Sajad Rather4 said:
    I know that this oscillator as per datasheet is intended for deepsleep mode,but same data sheet also says that it can drive the system clock too.

    This behavior is one and the same. In Deep Sleep mode, it drives the System Clock. That is the only time it should be doing so. The device cannot execute code like what you are trying to do when run just from LFIOSC.

    You can't use it to operate the device like you are describing.

    If you need a lower clock frequency, then you should use a higher SYSCTL_SYSDIV_x setting for the SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); API

  • Hello Ralph,

    Agreed,

  • Hello Sajad,

    That is a different topic now, and if you continue to have issues with it beyond my answer in this post, I'd recommend making a new thread along those lines.

    You absolutely can get a visible LED blink with the 16 bit timer if configured right.

    Looking at your code, I would suggest removing TIMER_CFG_SPLIT_PAIR from your TimerConfigure call and restore the SysCtlClockSet to use the OSC_MAIN as normal and try again. Doing that should get you a blinking LED that is visible!
  • HEllo Ralph,

    Sure will open a new thread..!

    Agreed with you , by removing split pair and configuring clock as you said would flash led for sure but the timer no more remains in 16 bit mode .

    As per my knowledge, using split pair in timer config would allow you to take advantage of 2 subtimers in 16 bit mode.

    Regards

    Sajad