This section shows how to use gEDA as the schematic capture front-end for a PCB design. This section is not intended to be complete documentation on gEDA and it is assumed that the user has at least some familiarity with the gEDA suite of programs.
The basic steps in a gEDA + PCB design flow are:
gschem
(part of gEDA)
gsch2pcb
(part of gEDA)
pcb
gschem
and
forward annotate to PCB with gsch2pcb
Although not required, a typical project directory will contain the
schematics and board layout at the top level.
Schematic symbols and circuit board footprints which are unique to this
project are stored in subdirectories. For this example, sym
contains the project specific schematic symbols and pkg
contains
the project specific footprints. Set up the project subdirectory and
subdirectories by executing:
mkdir ~/myproj cd ~/myproj mkdir sym mkdir pkg mkdir pkg/newlib mkdir pkg/m4
The gEDA tools, specifically gschem
and gnetlist
, use
configuration files to set the search path for symbol libraries in
addition to other user preferences. Create a file in the top level
project directory called gschemrc
. Add the following lines to
that file:
;; list libraries here. Order matters as it sets the ;; search order (component-library "./sym")This sets the local search path for the schematic capture program
gschem
. Now the netlister, gnetlist
, must also be
configured. This can be done by copying the file gschemrc
to
gnetlistrc
by running cp gschemrc gnetlistrc
.
Alternatively, you can create a soft link so only a single file needs to
be updated if additional symbol paths are added. The link is created by
running ln -s gschemrc gnetlistrc
.
gsch2pcb
Config Files
The program gsch2pcb
, not to be confused with the older
gschem2pcb
script, is used to link the schematic to layout.
gsch2pcb
is responsible for creating the netlist used to provide
connectivity information to PCB as well creating an initial layout with
all components instantiated in the design. Forward annotation of
schematic changes to the layout is also done using gsch2pcb
.
gsch2pcb
uses a project file to set up the schematic file names,
PCB library locations, and output file names. Create a project file
called project
using the following as an example:
# List all the schematics to be netlisted # and laid out on the pc board. schematics first.sch second.sch third.sch # For an output-name of foo, gsch2pcb generates files # foo.net, foo.pcb, and foo.new.pcb. If there is no # output-name specified, the file names are derived from # the first listed schematic, i.e. first.net, etc. output-name preamp
gschem
This section is fairly brief and assumes familiarity with using the
gschem
schematic capture program. As you are creating your
schematics, be sure to observe the following rules:
footprint
attribute that corresponds to a footprint in the PCB
library or a footprint you plan on creating.
refdes_renum
script (part of gEDA) after the
schematics are created.
Create the new footprints you design needs using either the m4 style or
newlib style of PCB libraries. Refer to Library Creation for details on this
process. For m4 style footprints, store them in the pkg/m4
subdirectory and for newlib footprints, store them in the
pkg/newlib
subdirectory.
gsch2pcb
The gsch2pcb
program connects the schematic and layout. It basic
operation is to call gnetlist
to generate the connectivity
netlist that PCB used to verify connectivity and to instantiate all
elements found in the schematic to a new layout.
The default, as of gsch2pcb
version 0.9, is to use any found m4
style parts first and then search for newlib style if no old style part
was found. By using the --use-files
or -f
flag to gsch2pcb
priority is given to newlib style parts even if m4 style are found. You
may wish to verify this in the gsch2pcb
documentation in case
this changes in the future.
To start your layout,
run gsch2pcb project
where project
is the project file
created previously. This will create a new netlist file,
preamp.net
, and a new layout file, preamp.pcb
.
Run PCB on the new layout by running pcb preamp.pcb
.
Load the netlist file by selecting "load netlist file" from the "file"
menu. In the file selection dialog box, choose preamp.net
. This
loads connectivity information into PCB.
Using the selection tool, grab and move apart the various footprints with the middle mouse button. Once the parts are moved apart from each other, choose "optimize rats-nest" from the "Connects" menu. This menu choice will display and optimize the rats nest. Use the rats nest to help guide placement of the parts. You may wish to re-run the "optimize rats-nest" command after moving parts around.
After the placement is complete, use the line tool to add traces to the board. As traces are added, the corresponding rats line will disappear.
If schematic changes are made after the layout has started,
gsch2pcb
can be used to forward annotate these changes to the
layout. To forward annotate schematic changes, run gsch2pcb
project
. This command will create the files preamp.new.pcb
,
preamp.net
, and modify the file preamp.pcb
. The
modifications to preamp.pcb
include forward annotation of
schematic component value changes, adds any new components, and removes
any deleted components.
After the layout is complete, choose "edit layer-groupings" from the
"Settings" menu. The LayerGroups form lets you specify which layers
will appear in each output layer group. For example, in the default
form, layer group 1 has "front" and "front side" in it. The
output file 1.gbr
if DOS file names are used, or
somename_front.gbr
if long file names are used will contain the
"front" and "front side" layers in it. Usually the defaults are
sufficient, but this form is still a useful reference.
Choose "print layout..." from the "File" menu. In the print dialog box, select "Gerber/RS-274X" for the device driver. Select the "outline", "alignment", and "drillhelper" options. To get DOS compatible file names, select the "DOS (8.3) names" option, otherwise enter "preamp" for the filename. Press "OK".
The following output files should have been created in the project directory. The names in parentheses correspond to the DOS compatible output file names.
preamp_frontsilk.gbr (csilk.gbr)
preamp_frontmask.gbr (cmask.gbr)
preamp_front.gbr (1.gbr)
preamp_backmask.gbr (smask.gbr)
preamp_back.gbr (2.gbr)
preamp_fab.gbr (fab.gbr)
preamp_plated-drill.cnc (pdrill.cnc)
preamp_unplated-drill.cnc (udrill.cnc)
preamp_bom.txt (bom.txt)
preamp_xy.txt (xy.txt)