Why are power pins designated as output in the symbol (micro-USB header) - Page 1
Forum section: electronics / general

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 18, 2023, 02:45:03 am
content: This is one of the micro-USB symbols included with Kicad 6. When I click on the symbol to edit I see that GND and VBUS pins are designated as outputs. Why not inputs considering these pins should supply power from an external source?

author: ataradov
author_rank: Super Contributor
timestamp: April 18, 2023, 04:08:58 am
content: This is so that you don't have to put power flags for ERC. The idea is that this pin is going to go to the voltage regulator power input.It is still a bad idea, connectors should be passive.And in OTG mode you will still have ERC errors. Just make them passive and place the power flags.

author: PlainName
author_rank: Super Contributor
timestamp: April 18, 2023, 12:51:14 pm
content: QuoteThe direction, input or output (or passive) relates to the component, not the circuit. Thus an output here means it is being output from this component to the circuit via those pins. Where that power comes from isn't relevant - could be from the cable, internal mini-nuclear generator, whatever.As ataradov notes, if you're running OTG then these pins could be both output (power from the cable) or input (power from the circuit, supplying the external device) so it's easier to mark them as passive. However, then you can get into the situation where you get an ERC error because a power net doesn't have a source. Depending on how anal you want to be, you might have different symbols depending on whether your design supplies or uses power.[Easy to get confused with these things. Same with Tx and Rx pins - generally they relate to the component, so Tx is sending from the component (and will probably be Rx at whatever it connects to).]

author: PlainName
author_rank: Super Contributor
timestamp: April 18, 2023, 12:54:26 pm
content: QuoteIn general I would agree, but where there is a specific pin usage then I don't see why this wouldn't be just like any other component. You wouldn't for instance, label the output of a vreg as passive. Or the supply pins of an IC as passive.

author: ataradov
author_rank: Super Contributor
timestamp: April 18, 2023, 04:32:21 pm
content: Quote from: PlainName on April 18, 2023, 12:54:26 pmThere is no specific usage here though. Micro USB device operating in OTG mode would supply voltage on that pin (the direction is negotiated via ID pin), so the pin would be a power input.If you use this symbol for an OTG device, then you would have ERC errors.

author: PlainName
author_rank: Super Contributor
timestamp: April 18, 2023, 05:59:52 pm
content: Wouldn't the answer be to have a different symbol for the different functionality?With complex chips where there are sub-functions (perhaps Ethernet, DRAM, LCD) we might have a symbol set where each of those functions is gathered into their own boxes. Kind of like four opamps on a chip have discrete shapes. But we might also have a single symbol for the whole chip if that shows the design better. Why can't we do that for USB connectors where one design has power coming from them and another has power going out?

author: ataradov
author_rank: Super Contributor
timestamp: April 18, 2023, 06:08:22 pm
content: No, because direction of this pin changes in run-time depending on the level on the ID pin.The solution here is to mark pins correctly. Connectors are purely passive devices, they should be marked as such.This is a non-issue, it is a poor symbol design plain and simple. And this is exactly why power flags exists.

author: newtekuser
author_rank: Frequent Contributor
timestamp: April 18, 2023, 06:48:49 pm
content: Makes sense now, at least the Vbus pin gets its power from the input pin of the usb header.

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 18, 2023, 08:40:01 pm
content: Quote from: newtekuser on April 18, 2023, 02:45:03 amThat decision is questionable, but it's not stupid. Those pins are indeed "power outputs" in the KiCad sense... as long as the USB connector is used as a standard, device-side USB connector.This is only used for ERC.The case where it would cause ERC issues is when the connector is used for USB OTG connections.Note that for VBUS, as long as you're going to put something in series, like a fuse, ferrite, etc. (which is very common in practice), then the pin function of the connector (at least for VBUS) stops having any purpose.So yeah, all in all it's usually best to define connector pins in general as passive.But don't assume all KiCad-provided symbols are perfect, they surely are not, and many have a bias, coming from their authors.I rarely use KiCad symbols as is. I make my own libraries - sometimes based on KiCad symbols and footprints, but often modified.