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.

Looking for Documentation on DK-TM4C123G Examples



I have several DK-TM4C123G kits and I'm studying the qs-logger example.  I have serveral questions on this code:

1. Is any additional documentation available such as UML flowchart for the qs-logger project?

2. On line 778 of qs-logger.c there are library functions that use the prefix MAP_ e.g. MAP_SysCtlPeripheralEnable(BUTTONS_GPIO_PERIPH);

I've used these functions with the prefix ROM_ so what does the MAP_ mean? Where can I find the definitions?  How do these differ from the ROM_ functions?

3. On line 836 of qs-logger.c the MAP_ code is used again, specifically MAP_SysCtlClockSet(SYSCTL_SYSDIV_4 |....

but at line #152 we see #define CLOCK_RATE              100 which I assume means that the clock rate is 100 MHz because line #153 we see #define MS_PER_SYSTICK          (1000 / CLOCK_RATE)

which looks like it's trying to calculate  mS per systick but the clock rate can't be 100 MHz as the max clock rate for the processor on this kit is 80 MHz and anyway, in teh code the clock is specifically set to 50 MHz.

4. Once qs-logger is up and running, there's a system of displaying a menu of data output selections and then taking the selected data item and displaying it in a 'widget' screen - e.g. selecting 'current' displays a 1Hz updated reading of current in mA displayed on a simple screen canvas; selecting 'gyro'  gives a different screen canvas with separate x, y, and z, values displayed.  Without any documentation, I'm struggling to understand how that works.  What I'd really like to do is to create my own widgets, add them into the menu system.

Any help greatly appreciated.

  • Hi Ted,

    #2 If MAP_ is used then if the function exists in the ROM, it would be linked to you code. If it does not exist then the code in Flash will be used for linking

    #3 The Systick module is configured to run from the System Clock. the counter value is being used to generate a SysTick Interrupt every 10ms. To get an interrupt every 10ms, the counter load value has to be SystemClock/100 which is where the CLOCK_RATE is being set to 100

    Regards

    Amit Ashara

  • Unfortunately there isn't any additional documentation on how the qs-logger application works.

    For more information on Graphics Library, though, you can take a look at the SW-TM4C-GRL-UG.pdf in the TivaWare_C_Series/docs folder of the board software package.

    -David

  • Amit,

    #2 Thanks, that was helpful.  I also found more info in the C:\ti\TivaWare_C_Series-2.0.1.11577\docs folder in SW-TM4C-DRL-UG-2.0.1.11577.pdf where, at para 36.3 if gives details on how to use Mapped ROM calls including what #includes you need.

    #3 Again, you're right.  I followed the code, I'll explain for benefit of others.  The code includes the following on lines 841-843 of qs-logger.c

        MAP_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ |
                           SYSCTL_OSC_MAIN);
        ui32SysClock = MAP_SysCtlClockGet();
    

    So, that means that the system clock is 50 MHz and the last line will set uin32SysClock to 50,000,000 and later on line 1060 the following code

    MAP_SysTickPeriodSet(ui32SysClock / CLOCK_RATE);

    set the SysTickPeriodSet to the number of system clocks between SysTicks.  Given that the system is running at 50,000,000 clocks per second or 1 clock every 20nS and ui32SysClock / CLOCK_RATE is 50,000,000 / 100 = 500,000 which takes 500,000 x 20 nS to happen which is 10 mS.

  • Hello Ted,

    Great explanation. To just add for clarity, the CLOCK_RATE is number of Tick Interrupt per second. So going by your explanation and the value of 10ms thereby computed it would mean 100 Tick Interrupt per second, which matches the define

    Regards

    Amit Ashara