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.

TM4C1233H6PM: Getting CMSIS device headers and understanting bit banding.

Part Number: TM4C1233H6PM

Hi everyone.

I'm trying to learn how to use the bit banding region in order to toggle a GPIO pin. I think i understand how it works (writing to a specific address writes a bit on a specific register for example), however i cannot understand how to make it work in code.

I'm using the code in the bottom of this https://developer.mbed.org/cookbook/bit-banding page with the proper modifications to toggle pin 3 on the GPIO Port f (it's connected to a red led on the tm4c123gxl board).

It works fine if a set the bit on the GPIO_DATA register, but does nothing when using the bit band region.

(i'll post the full source when i get home. sorry about that)

Related to this problem, I cannot download the CMSIS DSP Header files. The only link i can find http://www.ti.com/tool/cmsis_dsp_headers, works but dosen´t provide the download button anywhere.

  • Hello Tiago

    First of regarding the CMSIS DSP information, please refer to the following application report

    www.ti.com/.../spma041g.pdf

    As for the GPIO operation w.r.t bit banded, it would be simpler to use the TivaWare API's for GPIO Pin operations

    As an example, when using a GPIO Write

    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1, GPIO_PIN_1);

    This will set GPIO Pin-1 for Port A for the set of Pins 0 and 1

    Now if you wish to set 3 pins in a set of 5 pins, i.e. in the set of Pin 7, 5, 3, 2, 1 you want to set pins 7 and 3 then the same operation in TivaWare API would be

    GPIOPinWrite(GPIO_PORTA_BASE, (GPIO_PIN_7 | GPIO_PIN_5 | GPIO_PIN_3 | GPIO_PIN_2 | GPIO_PIN_1),
    (GPIO_PIN_7 | GPIO_PIN_3);

    The API works by using a set of pins given by argument 2 of the API and then applying the value as given by argument 3
  • Hi!

    Thanks for taking the time to reply.

    I'm trying to learn how to use CMSIS and bit banding as mere curiosity for my hobby projects. For real projects i do use the TivaWare API because, as you said, it's simpler and it's one less thing to worry about when developing.

    I did look into the GPIO API functions and it looks like it uses the bit band region but i still cannot get it to work on my own.

    Regarding the PDF linked, i haven´t had the time to read it properly but it seems to be what i'm looking for. Thank you!