Electrical – connecting Open drain and Push pull outputs to drive the same pin

open-collectoropen-drainpush-pull

I am designing a circuit in which has a voltage supervisor (MCP121-33)with active low output nRST connected to RESET input of the microcontroller which is straightforward. Also, there is a another requirement in which the RESET input of the microcontroller has to be driven by one of the GPIOs of MCP2221 (USB to I2C/UART).

The GPIOs of MCP2221 are all push pull and not open drain.

How to connect MCP2221 GPIO and nRST from the regulator such that we can RESET the microcontroller using either of the sources.?

Any buffers with open drain is required on the push pull GPIO? please clarify.

Thanks in advance….

Datasheets: MCP2221 (USB to I2C/UART) AND Voltage monitor

Best Answer

You can use a GPIO as open drain by programming it differently.

If you leave it programmed to output mode, then set the output data to 0 or 1, it behaves as a push pull output.

If you leave the output data set to 0, then program the mode to input or output, it behaves as an open drain output.

Although this is a fairly common pattern, it's worth leaving yourself a clear note in comments that you're using the GPIO in this way, to avoid accidents in the future should you forget what you've done.