Author Topic: Why are power pins designated as output in the symbol (micro-USB header)  (Read 1806 times)

0 Members and 1 Guest are viewing this topic.

Offline newtekuserTopic starter

  • Frequent Contributor
  • **
  • Posts: 401
  • Country: us
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?

1763567-0
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11722
  • Country: us
    • Personal site
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.
« Last Edit: April 18, 2023, 04:12:27 am by ataradov »
Alex
 
The following users thanked this post: newtekuser

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7196
  • Country: va
Quote
Why not inputs considering these pins should supply power from an external source?

The 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).]
 
The following users thanked this post: newtekuser

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7196
  • Country: va
Quote
connectors should be passive

In 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.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11722
  • Country: us
    • Personal site
there is a specific pin usage then I don't see why this wouldn't be just like any other component
There 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.
Alex
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7196
  • Country: va
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?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11722
  • Country: us
    • Personal site
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.
Alex
 

Offline newtekuserTopic starter

  • Frequent Contributor
  • **
  • Posts: 401
  • Country: us
Makes sense now, at least the Vbus pin gets its power from the input pin of the usb header.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15274
  • Country: fr
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?

That 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf