Skip to main content
Explorer II
May 23, 2024
Question

GPIO CONFIGURATION IN TRISTATE mode

  • May 23, 2024
  • 4 replies
  • 1595 views

shall we able to configure stm32g431mb gpio to high impedence state when configured as output pin. We need to access output pin in tristate mode

 

    This topic has been closed for replies.

    4 replies

    Graduate
    May 23, 2024

    Look at the Reference Manual for your stm32.

    This will tell you how bits in the appropriate GPIOx->MODER control whether a pin is output or input.

    When you want to go from output to tri-state (digital input) you can reprogram those bits.

    There probably is a HAL way to do this, but I don't find it adequately documented.

    Graduate II
    May 23, 2024

    Of course. Set output type to mode "open drain" and write "high" to pin. Then it will be output in HiZ.

    Super User
    May 23, 2024

    @Mahalakshmisudhakar wrote:

     We need to access output pin in tristate mode


    What do you mean by that? What "access" ?

    ST Employee
    May 23, 2024

    Hi All,

     

    This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.

     

    Regards,
    Jake

    ST Support