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.

Is there example code for setting GPIOPCTL PMCx Bit Field Encoding) ?

Other Parts Discussed in Thread: TM4C129XNCZAD

Is there example code for setting GPIOPCTL PMCx Bit Field Encoding) ?  I'm specifically trying to map UART 2 to GPIO pins. 

  • Hello Tadd,

    The specific info you are looking for is in the datasheet for the specific device you are using. For example, for the device tm4c129xnczad in a 212BGA, this information is located in table 10-2.

    The datasheet for your device can be found by using the product selector guide located here: www.ti.com/.../products.page Cortex-M4F or going straight to the part numbers product specific page.
  • I was looking for a sample code library. When I dealt with TI chips MSP430 and TMS470 in my last project there were downloadable sets of programs which did the simplest sequence of operations via reads and writes to CPU registers for peripheral functions like implementing a UART driver or I2C driver or generating performing a repetitive AtoD measurement under timer interrupt control etc.. The example code I've seen for the TM4C129 are more complex and use library functions. I wonder if I'm missing a repository someplace where I should be looking. Is the source code for the TIVA ROM not available?
  • Hello Tadd,

    MSP430 and TMS470 devices used what is called DRM. TM4C devices allow DRM but using TivaWare API's simplifies a lot of the coding and code maintenance. At the same it alleviates code type mixing when doing complex functions.

    If I may: what you are seeing as complex is may be you have to move from DRM to API functions. In fact in the past (and as you can see on the forum), users have used DRM and moved to TivaWare to realize that it has simplified debug and support on the forum.

    The TM4C ROM source code is not available. However functions that are in ROM and also made available in TivaWare API's, and TivaWare allows call to the ROM API's using both ROM_ and MAP_. The use of latter is considered better, because if there is a bug in the ROM API, the same can be deprecated in the library call and a recompile of the source code is sufficient without having to perform search and replace.

    I hope I am making my points clear to you. You will see immediate advantages of using library calls, as you start using and studying the examples from TivaWare.

    Regards
    Amit
  • Bravo Amit - appears that poster's past, "comfort level" has deprived him of the (many) benefits provided by your rich API.

    Poster may read the MCU manual - "GPIO Section" and then steer to "xxxWare\Programs\Examples\Peripherals\GPIO." Note that this vendor's API is (completely) unhidden - you can review the fine detail w/in each/every function call.

    There are many such functions - all "tried/true/tested by thousands" and the "fine/arcane detail" has been (quite nicely) managed for you by skilled & experienced vendor personnel...

    The "DRM" method forces users to constantly thumb thru page after page of Register notation - seeking that (exact) bit(s) w/in that (exact) register.   Not fun - nor robust nor reliable - and ALWAYS an adventure!  

    API stands in stark contrast - immensely aids your development - AND "automates" that exact function requirement you listed!   Use it - you will like it!