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.

TM4C123 Register Names...

Hello all,   I am looking at the TM4C123 datasheet which defines (I'll use the SysTick as an example)

STCTRL, STRELOAD, and STCURRENT  as the SysTick registers.    Those names are all compact and easy to remember, however I am taking a micro controller
course online,  and the same registers are being defined as:

#define NVIC_ST_CTRL_R      (*((volatile unsigned long *)0xE000E010))
#define NVIC_ST_RELOAD_R    (*((volatile unsigned long *)0xE000E014))
#define NVIC_ST_CURRENT_R   (*((volatile unsigned long *)0xE000E018))

So, 2 questions:

-Which header file contains the shorter register names? 

-Is there a 'normal' or 'best' way to go here?

 

thank you

/etienne

 

  • Hello Etienne,

    The folder "./inc" in TivaWare has "hw_***.h" files, which have the definition of the different registers along with their memory location. This folder, normally, has a header file for each of the peripherals. But in the case of SysTick, the registers are defined in the file "hw_nvic.h", hence the prefix NVIC_***.

    Hope this helps!

    Thanks,
    Sai
  • Thank you! 

    My new question is:   between the Tiva Register Driver Definitions and the CMSIS structure pointers,  is there a preferred, up-to-date, or most convenient
    method?     I am still a real beginner,    wondering if there is any benefit between:

    GPIOA->DATA

    and


    GPIO_PORTA_DATA_R

    The former seems to make a lot more sense to me;   I'd love to know what you Real Engineers think.

    thanks
     /etienne

  • Hello Etienne,

    Both the methods you mentioned are used for accessing the registers directly, which we strongly recommend against.Tip#2 in the following post gives reasons as to why we don't recommend using DRM: e2e.ti.com/.../374640.

    In addition to the reasons provided in the post, other reasons why we discourage the use of DRM is because it becomes very hard to maintain and debug applications.

    Please use TivaWare APIs instead, as these are tried and tested in multiple applications, not only by TI Engineers but many customers too.

    Please use DRMs only if the TivaWare examples don't provide the necessary functionality.

    Thanks,
    Sai
  • The link to the post is broken.   

    Thats all good,  and I look forward to using the TivaWare APIs, however I am self-learning through textbooks and online courses.   I dont exactly have an end goal in mind yet,  however I am really enjoying learning a bit of 'under the hood' material,  and most of the example code & lessons I have found so far are related to that. 

    Ying Bai - Practical Microcontroller Engineering with ARM Technology

    and 

    Jospeh Liu, Trevor Martin, Jonathon Valvano's books have offered the most step-by-step, well explained examples, so far.  

    If somebody would write a well explained TivaWare textbook (how to do it and how it works!!!)

    I would be all over that!!!!!!!!

    /etienne

  • Sorry about the link. It picked up the period (I placed after the end of the statement) as part of the link. Here is the correct one: e2e.ti.com/.../374640

    I don't think we have a textbook on TivaWare, but we do have a user's guide for the Peripheral Driver Library here: www.ti.com/.../spmu298

    User's guide for other libraries in TivaWare can be found here: www.ti.com/.../sw-tm4c Documents

    These user's guide can also be found in the "./docs" folder of TivaWare.

    Thanks,
    Sai
  • Thank You Sai!!!

    /etienne