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 Pin under HW control

hi frnds

what is the meaning of GPIO pin under HW control?

Thanks

Er. Sanjay Kumar

  • sanjay kumar3 said:

    What is the meaning of GPIO pin under HW control?

    Believe you raise a good & thoughtful point.

    And - it may be - that a case may be made to challenge vendor's language.

    Many/most(all?) GPIO default to GPIO status/mode upon MCU power up.  Some pins - on some MCUs - violate this "default" rule (to the delight of quick or unread MCU manual users) and such users discover that their (chosen) GPIO pin(s) fail to perform.

    Usually - such GPIO pins have been "forced" into some specific, MCU Peripheral service mode - and it is that (I believe) which vendor's writing describes (bit cryptically - I'd say) as, "under HW control!"  To further detail - many MCUs default many Port "A" pins into SPI, I2C & UART service - rather than their (normal) GPIO mode.  To harvest these pins for (normal) GPIO use - you'll have to reconfigure and retype them.  (normally) 

    Adding to the "fun" very special pins (JTAG/SWD & (most always unwanted NMI)) are encountered.  These pins are "promoted" to unique "lock" mode - requiring users to "jump thru high hoops" to reclaim those pin's for more general usage.  CAUTION: "reclaim of any JTAG/SWD pin may cause MCU lock-out - do that w/past LM3S parts and MCU funeral results - LX4F/TM4C may be saved."  (yet is a distraction, time-waster - prevention trumps repair!)

    I've "winged" this posting (memory only) - others will cut/carve if I'm off-target or have missed key point... (doubtful that!)  

  • hi

    you mean if GPIO pin is left under hw control, then it will in its default state.

    Thanks

    Er. Sanjay Kumar 

  • Hello Sanja,

    When a GPIO is under HW control then the peripheral that is muxed onto it will control the GPIO Pad-Pin. This happens by setting both the AFSEL and PCTL registers in GPIO. The specific function of HW control is to set the corresponding Pad-Pin's AFSEL bit.

    Regards

    Amit

  • Prefer (still) far earlier posting's detail from this reporter.  To our group's collective mind, "Peripheral Control" far better describes!  (HW Control remains too vague, uncertain - likely "rushed" by tech writer's boss...Not to ask - HOW I know...)

    We note that the (very specific) mention of both AFSEL  & PCTL registers (seems) to be steering new poster into "Direct Register!"  Is that good?

    Instead - vendor's APIs w/in driver library automate the correct manipulation of any/all such registers - and avoid (but for very rare cases) the uncertainties admitted by Direct Register...

    KISS rules (i.e. safety/comfort of driver lib.) - direct register (or it's suggested use) not so much...