Open Collector Wired OR logic

Electric1

Nov 29, 2025
50
Joined
Nov 29, 2025
Messages
50
I always come across the term open collector is used for Wired OR logic, i tried creating a circuit to understand better
1781354564672.png
Is the above configuration i have drawn is wired or logic?
1781354601595.png
When i make the port high the line is pulled to 3.3V?
Edit: There is ground connected for micro controller B as well.
 
Last edited by a moderator:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,271
Joined
Nov 17, 2011
Messages
14,271
Your circuit will not work in 99.9 %, unless some intelligent programming is used for the ports (see below: risk of short circuit).
  1. you need only 1 pull-up resistor, not 2.
  2. what are the "transistors" in your table? Usually µCs have totem pole outputs with 2 transistors. You need open collector or open drain outputs. Otherwise you risk a short cirecuit on the wired-or line when one output is high and the other output is low.
    Alternatively, open emitter or open source configurations can be used or diodes can be used to decouple totem pole outputs.
 

Electric1

Nov 29, 2025
50
Joined
Nov 29, 2025
Messages
50
Your circuit will not work in 99.9 %, unless some intelligent programming is used for the ports (see below: risk of short circuit).
  1. you need only 1 pull-up resistor, not 2.
  2. what are the "transistors" in your table? Usually µCs have totem pole outputs with 2 transistors. You need open collector or open drain outputs. Otherwise you risk a short cirecuit on the wired-or line when one output is high and the other output is low.
    Alternatively, open emitter or open source configurations can be used or diodes can be used to decouple totem pole outputs.
Sorry in the table i mentioned wrongly as transistor, i meant was the microcontroller 1 and microcontroller 2 ports. So, in case the microcontroller has open collector o/p when i a make high any of the port the bus line will be pulled high and when i make both the port lines low the bus line will be 0V. Is my understanding correct?
1781407158111.png
 

Electric1

Nov 29, 2025
50
Joined
Nov 29, 2025
Messages
50
Below are the configurations i have for the controller
GPIO output level -> Low / High
1781422810221.png

1781422873295.png
1781422917738.png
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,271
Joined
Nov 17, 2011
Messages
14,271
You need to set the output to open drain, not push pull!

What is the operating voltage of the µCs GPIOs? The controllers themselves are supplied by 5 V, so I'd expect the pull-up resistor going to 5 V, too. Unless, that is, when the µCs operate on 3.3 V using internal voltage regulators to create the 3.3 V from teh 5 V supply. In that case having the pull up to 3.3 V is perfectly o.k.

when i a make high any of the port the bus line will be pulled high and when i make both the port lines low the bus line will be 0V. Is my understanding correct?
By no means, sorry.
When any output (µC-A or µC-B) is low, the bus will be low, too.
Only when both outputs are high, the pull up resistor will drive the bus high.

In the schematic you show, I see no particular use for a wired or. If µC-A is driving and µC-B is receiving, you can configure the GPIOs as output and input, respectively. Or vice versa, when the direction is from B to A.
If both µC can be driving, who is going to receive the driven signal? You show no other component on the bus.

Also note that a wired or is typically much slower than a bus driven by totem pole outputs. The pull up resistor creates an RC-term with the capacitances on the bus (wiring, pin capacitances) which generates a comparatively slow rising waveform. If you need to be fast, wired-or (or wired-and etc.) is the wrong decision. Use fast logic gates or bus drivers for such an application.
 
Top