How to create a bus in gschem

The whole GEDA suite has a positively medieval taste to it, I agree. But it feels so goddamn Unix I just can’t refuse using it.
If you would like to get a general idea, here is a nice tutorial:  gsch2pcb_tutorial . (You might want to use xgsch2pcb instead of gsch2pcb (there are packages for both in Ubuntu) which is a nice and simple GUI to it, and frees you of many chores of using gsch2pcb in command line.)

If you want to make a lot of connections in gschem that serve as for example an address bus or a memory bus, you might consider using a gschem “bus” function. I couldn’t find any good tutorial on how to do it, so here is some info:

First you should just draw a bus, like so:

Draw a bus in gschem

Please note, that as specified in the gschem documentation, bus is just purely a graphical symbol, all the real work is done by the netname attributes of the wires leading to it.

Next step is to wire a pin to your new bus:

Wire a pin to a bus

[adsense]
Your connection will have two parts: a dark blue, straight wire part, and a angled bus-ripper part added automatically. You should now double-click the blue wire part. A dialog will appear, with a netname property ready to be added:

gschem: add netname property

Change the Visible to “Show Value only” (less mess on the schematic), type “A?” into Value field and click “Add”. You should end up with something like this:

gschem: netname

Note than you can adjust the placement of the “A?” by clicking on it and moving freely. I chose it to be a little lower than default, as visible in the picture.
Next you should select the whole connection to the bus, the wire, the bus-ripper and the name, and copy-paste it as many times as you will need it:

gschem: a connected bus

[adsense]
Now select all the connections, and choose Attributes->Autonumber Text (or press “tu” on the keyboard). Similar window should appear:

gschem autonumber text

Feel free to play with the options, but don’t forget to change “Search for” to netname=A*. It’s a pretty useful tool in general – you don’t have to manually number your parts. And if you have multiple schematic files in one project that goes to a single pcb where element names have to be unique you can just start with a different “Starting number” on every schematic when naming refdes to keep the names unique.

After clicking Apply you should end up with a nice list like that:

gschem: nets on a bus

What you can do now is to route your bus to the other part(s) you want to connect it to, and possibly copy-paste the whole net setup there, saves a lot of time.

The finished setup can look for example like this:

gschem: schematic using a bus

[adsense]
Also, one common error is adding the netname to the bus-ripper, and not to the wire – it won’t work that way.
Hope this helps you in yourfuture designs. Let me know in the comments!

P.S.

If your are curious what the circuit is, it will be the brains for my monitor project. Check out for example this post:
DDC2 interface – crafting your own EDID to get some more info.

P.S.S

A thing to keep in mind while designing in GEDA is that footprint names (when you will be designing and using your own) can not contain a dash ‘-‘ character. If you’ll include such ones in your design, there will be no obvious sign of failure, your pcb window will just stop being updated with the changes from the schematic. For more indulgent, running Window->Message Log in PCB will show you something like this:

ERROR parsing file 'your-desigb.new.pcb'
line:        62
description: 'syntax error'

and not much more. God it took me ages to find this one! Using underscore ‘_’ works just fine.