I have a MCU (STM32H7xx) whose GPIOs, when configured as output, can be configured either as open-drain or push-pull. Before seeing this, I though that open-drain meant hihg-Z, however I don't see how that works just reading the STMicro documents. Let me explain:
And this is the explanation I'm reading (attached as image to not lose the formatting):
Now, with regards to the push-pull output mode, my understanding is that the pull up/down resistors are disabled, the mosfets are used to output VDD or VSS (which is ground). I'm happy with that.
What I don't understand is what is the goal of open-drain mode, let me explain: the doc. says that you need to enable the pull-up resistor to work in this mode. In that case, I understand that when you enable the NMOS, VDD is grounded through the pull-up resistor, therefore the output pin is driving a 0. However, if the NMOS is disabled, it will be driving VDD through the pull-up resistor.
Questions: Is the above correct? If so, what is the point of this mode? It seems to achieve exactly the same behaviour as the push-pull one. How do you get a high-Z output?
Sources: