LOGIC-7 Open-drain or open-collector output as the only driver of a net with no pull-up¶
| Severity | Status | Implementation |
|---|---|---|
| error | runs in better_erc | easy, depends on IMP-1, NET-7 |
Data it needs: graph, part classes, rails.
Looks at. Open-drain pin types.
What it catches. A net whose only drivers are open-drain or open-collector outputs (including MCU pins configured open-drain, comparators, optocouplers, transistor stages) and that has no resistor to a rail.
Why it matters. Open-drain outputs only pull low; the high level has to come from a pull-up. Without one the net floats when released: the receiver reads whatever leakage and noise decide (AN4899 §6.4).
Example. An LM393 comparator output into an MCU input, no pull-up, the MCU's internal pull-up never enabled: the input reads low most of the time and "high" when a finger is near.
How to check. Nets whose output-capable pins are all open_collector / open_emitter (KiCad pin types, IMP-1) or open-drain by part data (NET-7), with no resistor to a rail. IO-15 is the same check narrowed to interrupt and fault outputs. better_erc (erc_checks/src/logic/logic_7.rs) takes the KiCad pin types of the fitted parts: a signal net with open-collector (or open-emitter) pins, no output, tri-state or power output pin, and a pin of another part to receive, is a finding when no fitted resistor, diode or ferrite chain (max_hops = 2: an LED and its resistor count) leads up to a rail (down to ground for open emitters). A bidirectional pin (an MCU GPIO) is not counted as a driver: its mode and internal pull-up need pin roles (NET-7), and so does open drain by part data. An MCU, SoC or FPGA pin set open drain (its symbol type, or a chosen alternate such as PA1/OD) whose net reaches no logic input is left out: no pin of another fitted part other than resistors, capacitors, inductors, ferrites, diodes, links, connectors, test points and passive pins of unclassified parts sits on the net or behind one series resistor. Such a pin switches a resistor (a USB-C Rd on CC) or leaves the board through a header, and floating when released is its purpose. The same pin driving another IC, directly or through a series resistor, is still a finding.
Fix. A pull-up to the receiver's rail, sized per IO-17.
References. AN4899 §5.1.5, §6.4; Wikipedia, Open collector.
Settings¶
Set them in the project file under [checks."LOGIC-7"], or for one run with --set LOGIC-7.NAME=VALUE.
| Setting | Default | Meaning |
|---|---|---|
LOGIC-7.max_hops |
2 parts | how many resistors, diodes or ferrites in series a pull-up may go through to its rail (an LED and its resistor) |
Test schematics¶
Each schematic below is in test_schematics/sources. The block under it is what berc check --only LOGIC-7 reports on it.
logic-7_mcu_open_drain_receiver¶
error LOGIC-7 #0wr /RST_R is driven only by open-collector (open-drain) output U1.4 and has no pull-up: it floats when released
net /RST_R, part U1
fix: a pull-up to the receiver's rail, sized per IO-17
error LOGIC-7 #c53 /RST is driven only by open-collector (open-drain) output U1.3 and has no pull-up: it floats when released
net /RST, part U1
fix: a pull-up to the receiver's rail, sized per IO-17
logic-7_open_drain¶
error LOGIC-7 #4vb /CMP1 is driven only by open-collector (open-drain) output U1.3 and has no pull-up: it floats when released
net /CMP1, part U1
fix: a pull-up to the receiver's rail, sized per IO-17
LOGIC-7 also fires on the test schematics of other checks: dbg-8_open_drain_pull_ups, drv-9_relay_flyback, io-15_no_connect_flag, io-15_open_drain_flags, io-8_fet_switched_pull, io-8_internal_pulls, io-8_switched_pull.