adamgreig / agg-kicad

KiCAD libraries, footprints, and scripts
MIT License
161 stars 45 forks source link

Add Raspberry Pi symbol #105

Closed russss closed 7 years ago

russss commented 7 years ago

This adds a symbol for the RPi GPIO connector. I'm linking it to thePin_Headers:Pin_Header_Straight_2x20_Pitch2.54mm footprint which is the appropriate one for the header connector.

Pins are named based on what https://pinout.xyz/ says, which covers most of the frequently-used pins.

adamgreig commented 7 years ago

Is "P5" etc a common convention (the P that is)? At first I thought maybe P meant "physical pin" but clearly here the number is the BCM number (and the connector pin number the physical pin number).

I wonder if "BCM5" would be clearer?

Also I think this is the first part that references a footprint from outside agg-kicad, so I want to think about whether that makes sense or not (probably it does since those parts ship with KiCAD, but still...)

russss commented 7 years ago

They seem to be named GPIOx in the RPi and Broadcom docs, so I guess they should be that. Might be worth shortening that to "G" to avoid the symbol becoming too wide?

One other thing of note - the 3v3 power pins should really be pwrout, as they can't be used for powering the Pi (although the 5v pins can), however in that case it gets confusing with the ground pins. There seems to be no good solution which will make the ERC happy in both situations.

As for the footprints, I'm looking at adding a script to generate footprints for generic connector parts so we can perhaps add our own once it's easy to add them.

adamgreig commented 7 years ago

Ugh, no good answers really. Maybe GPIO12 would be best, how wide does it end up?

I thought they could be used for powering the pi if you provided your own 3v3? Multiple power pins seem to always be a pain point. Pwrin for all of them seems to be the best compromise and then users can add a power flag if they're using it to provide power.

Have you seen https://github.com/adamgreig/agg-kicad/blob/master/scripts/build_mod_sil_dil.py which does generic 2xN 0.1" headers? eg https://github.com/adamgreig/agg-kicad/blob/master/agg.pretty/DIL-254P-40.kicad_mod

russss commented 7 years ago

It's not too bad with "GPIO" actually. image

I've fixed up the power pins so they're all pwrin except for the 3V3 which is pwrout (the hat design guide is pretty clear the 3V3 should never be back-powered). That fixes the ERC issues I was having before and only requires one power flag.

adamgreig commented 7 years ago

If you now connect the two 3v3 pins together won't you also get an ERC violation?

russss commented 7 years ago

I shuffled the pins around a bit - the naming now mostly matches the Alt0 functions of the pins (also fixes the PWM and SDA-GPIO2 pins as mentioned).

I think the last question is of the 3v3 pins - having those pins as pwrout is marginally less hassle if you're drawing some of the limited 3v3 current available. Having them as pwrin seems wrong as you aren't allowed to back-power them. Having them as bidi seems to result in spurious ERC errors anyway.

I'm not convinced that it's useful to tie both 3v3 pins together anyway - it doesn't give you any additional current and they're both physically quite far from each other but not far enough that it's useful to use both.

(In this situation it would be nice to have a way of saying "these pins are all on the same bus".)

adamgreig commented 7 years ago

The usual thing in agg-kicad for devices with multiple power out pins (e.g. voltage regulators) is one pwrout and the rest passive, so they can be connected together with no issue. It's not really clear which one here would be pwrout and which one passive, though. Having them both pwrout makes most sense for anyone using just one and either one, but means you can't ever wire to both of them. Having both passive means you'd need a power flag any time you use it. If one is much more likely to be used than the other, that one could be pwrout and the other passive. I'm leaning towards that last option (so people can easily wire to both, or generally wire to one of them, and in the event they wire to the passive one they can add a power flag); what do you think?

russss commented 7 years ago

Sounds reasonable - I'd actually forgotten that passive was an option. I'll squash the previous commits and move pin 17 to passive.