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.

GPIO clock

I am running the "Getting Started with the Tiva™ TM4C123G LaunchPad Workshop". Now I am running on lab4. It is mentioned there, that we need to enable the GPIO clock. I tried to understand the GPIO clock from the datasheet, but it is still not clear. Is there any additional documentation on this subject?

Thank you in advance,

  • Hello Avner,

    You can go through the Peripheral Driverlib User Guide. For enabling the GPIO Clock or for that matter any peripheral on the TM4C the API call is SysCtlPeripheralEnable(PARAM). The PARAM is the name of the peripheral as given in the sysctl.h and is started as SYSCTL_PERIPH_xxx

    Regards
    Amit
  • Avner Lavi said:
    I tried to understand the GPIO clock from the datasheet, but it is still not clear.

    Hi Amit,

    Poster raises a most valid (yet embarrassing) point - does he not?

    Of course you're right - reading the Peripheral Driver Library Guide will (surely) help - but the MCU manual provides NO SUCH Mention!

    And - perhaps even worse - the MCU manual never even "HINTS" at the presence of the wondrous & extensive Api!   That's just NUTZ - is it not?

    No one cares "how or why" - you/I know from prior experience (i.e. head banging) but should not the MCU manual make some mention of the API - and the Peripheral Driver Library Guide?

    We note - instead - (and repeatedly) dreaded DRM code makes its appearance.   (only to later wind-up here - as poster crashes/burns - due to unwanted - seldom required - management of the great time/effort complexity DRM demands.)    "Failure to alert readers to the presence of the API" makes (some) sense - I'm sure - yet escapes this reporter, his firm and each/every client we engage!    And has been highlighted here - earlier - more than once - and still ignored...

    Yes - all here know of the API - but new users (often) do not!   Avoiding any/all mention of the API seems on "par" w/NMI & 0Ω "Plague-Istors" - leaf falls not far from that skilled/caring tree...  

    Other ARM MCUs abound - some even in M0, M3 & M7 "flavors." 

    Causing user pain/suffering due to, "refusal to correct past shortcomings" (outlined herein) seems an unwise (yet apparent, well entrenched) POLICY!

  • Enabling the 'GPIO clock' is the equivalent of enabling an IO port for use on an older 8bit MCU if you came that route. On ARM the various ports and peripherals are usually disabled on power up and have to enabled by sending a clock through to them. If you're C based look at Amit's post. If you're assembler based look at the register RCGCGPIO - setting the relevent bit in the RCGCGPIO turns the port on. You would then poll PRGPIO to know when the port becomes ready.