Translations of this page are also available in the following languages: Русский.
PCB supports two entirely separate footprint library mechanisms:
Therefore, during layout, you can use footprints which are distributed with PCB, you can find footprints via a web search, or you can create your own, and put them in a dedicated directory. The pcb manual has complete and up to date documentation for the element file format. Gedasymbols.org has a number of user contributed footprints. A somewhat incomplete but useful tutorial is available on the web at: http://www.brorson.com/gEDA/ (search for the term “newlib”).
newlib
and pcblib-newlib
. These directories contain the default footprint library of PCB.This question is a common one amongst new gEDA users. Indeed, helping newbies determine the appropriate footprint names lies at the core of the ongoing light vs. heavy symbol debate. In the current, light symbol gEDA/gaf distribution, you need to attach the footprint attribute at the schematic level (i.e. using either gschem or gattrib). The name of the footprint to use depends upon whether you are using the newlib or the M4 library (pcblib).
The newlib stores one footprint per file, and the footprint names used by the newlib are the file names of the footprint files.
There are several ways to determine the newlib footprint names to use:
${PREFIX}/share/pcb/newlib
. (${PREFIX}
is the install directory you specified when configuring/building PCB.) The name to stick in the “footprint” attribute is the filename of the footprint you wish to use./usr/local/geda/
. The 0805 package (for SMT resistors or caps) lives in a file with absolute path/usr/local/geda/share/pcb/newlib/generic_SMD_packages/0805_reflow_solder
0805_reflow_solder
using gschem or gattrib.--elements-dir
flag (from the command line).--elements-dir
flag set to point to your local footprint directory.The M4 library stores the footprints as M4 macros; there are usually several (many) footprints contained in each footprint file. The different footprints in a single file are generally variations on a single pattern (e.g. DIP-8, DIP-14, DIP-16, etc.) The easiest way to find the correct footprint attribute name is by browsing through the “pcblib” library in the PCB library window. The footprint attribute is given in square brackets in the description. Also you can view the list of footprints from pcblib at the gEDA Symbols webpage.
The following m4 libraries have received more attention and improvements than the others:
Finally, for both the newlib and the M4 lib, it is extremely important that you verify that the footprint name you use instantiates *exactly* the footprint you want when you place it in PCB. Therefore, it is critical to inspect the footprint before you use it. You can verify the footprint you want to use by clicking on it in the “footprint library” window, and then placing it onto an empty spot in PCB’s drawing area. Manually inspect the footprint to ensure that it has the correct number of pins/pads, correct dimensions, etc.
Also, once you generate Gerber files, make sure you inspect all footprints instantiated in your Gerbers using gerbv (or an equivalent Gerber viewer) before you send your design out for fabrication.
For example, an opamp may be DIP8 or SO8. A resistor may be 0603, 0805, 1208, or through-hole. How do I know what package and footprint to use, and how do I manage the choices?
First off, the footprint you should use is a decision for you to make, not your CAD tool. It is up to you to choose your preferred package type/footprint, and then attach the correct footprint attribute to the component in the schematic. Once you have chosen which package (and footprint) you wish to use, then either find an appropriate footprint, or draw one yourself and save it in a local directory.
As far as managing the footprint choices (and indeed the large number of component attributes you are likely to have): Use gattrib. That’s what it’s for.
Everybody does this a little differently. Some people draw the footprint entirely using PCB. Some people first draw a preliminary footprint in PCB, and then finish it off by hand editing it (e.g. using emacs). Some people write Perl or Python scripts to autogenerate footprints.
You can convert a footprint into an ordinary layout, edit the parts and convert them back to footprint. In the following list the parts in bold italic font are actions from the Buffer menu.
Alternatively, you can use your favorite text editor and edit the source code of the footprint.
The origin of a footprint is marked with a little diamond. To move it to some other position relative to the footprint you have to modify all coordinates. This can be done manually with a text editor. If you want to do it from within the GUI, you need to break the footprint into pieces and assemble it again. See above for a detailed checklist. Note, that the position of the diamond is determined by the position of cross hair when copying to the buffer.
Yes, this is tedious. The reason for it is the lack of a real footprint editing mode in pcb. You are invited to write one.
The silk of footprints can only deal with lines and arcs. All the other objects like polygons, rectangles and text are silently omitted during Convert buffer to element. If you need text in footprints you have to literally draw the letters with the line tool. Or, use this utility by Erich Heinzle to create silkscreen line elements for any given ASCII text, which can then be added to an existing footprint.
You can use the “onsolder” flag to place pads on the opposite side of the board. You would have something like this for a connector on both sides of the board:
Pad[-40000 -7000 -40000 7000 2700 2400 3000 "B1" "B1" "square"] Pad[-40000 -7000 -40000 3000 2700 2400 3000 "A1" "A1" "square,onsolder"]
If you draw the footprint with pcb-GUI and do Buffer → Convert buffer to element, the lines on the second layer become pads with the onsolder flag. Yes, it is the second layer, regardless its name.
Sometimes, exposed copper should not receive solder paste. A common example is the pads of an edge connector. This can be achieved with the nopaste
flag. Currently, there is no GUI way to set the flag. Use a text editor to add this flag to the pads of a footprint.
Adding footprint libraries can be done from the GUI:
File → Preferences… → Library → FOOTPRINTDIRECTORY
Alternatively you can edit the file $HOME/.pcb/preferences
. Make sure, no instance of pcb is currently running. Look for the line that starts with “library-newlib”.
Don’t forget to include the new directory into either your gsch2pcbrc, or your local gafrc file (if you are using gsch2pcb, that is).
There is no way to automatically replace all instances of a footprint with the new version, yet. But there is a special mode of the buffer-paste tool, that will reduce the amount of clicks for manual replacement.
Use the Window → Library dialog box to manually choose the new footprint. The tool becomes the buffer-paste tool, with the new footprint preloaded. Rotate it if needed with Buffer → Rotate Buffer. Position the new footprint over the old one, and shift-left-mouse-click to replace the old footprint with the new one. Watch out for being 180 degrees off, use O to check the rats nest after each placement, and undo if it appears you placed it backwards.
The footprint path that PCB uses is defined using the Pcb.elementPath
variable in the app-defaults file named PCB
. The path for the PCB
file is set using the XAPPLRESDIR
environment variable which is typically set from within the wrapper script named pcb
.
I prefer to place all “production-ready” footprints in a single directory that is not in the gEDA/PCB install tree. When a new version of gEDA/PCB comes out I do not make any changes to project files or libraries. If there are newlib footprints in the PCB library that I want to use I copy them to the “production-ready” footprint directory.
Rather than change configuration files to get gsch2pcb to find the footprints I create a wrapper script called sch2pcb
that contains the footprint path. All users use the same script and access the same production footprints.
To use the sch2pcb
script that is listed below replace the string FOOTPRINT_DIR
with your footprint directory:
#!/bin/bash gsch2pcb --elements-dir FOOTPRINT_DIR $@
Or another user's version:
#!/bin/bash #this script was written by John Luciani gsch2pcb --elements-dir /home/user/pcb/footprints/user --use-files $@
Alternatively you can make use of a project file which gsch2pcb reads for its options. For example the file myproject
could look like this:
schematics myschematic.sch myschematic2.sch elements-dir /myfootprintdir output-name mypcb skip-m4
The example file searches through myfootprintdir
for footprints used in myschematic.sch
and myschematic2.sch
and creates mypcb.pcb
skipping m4 style footprints. gsch2pcb is then called with the project file as an option.
gsch2pcb myproject
“Yes, totally. This is how you create oval shaped copper around pins, or funny shaped pads (e.g. square at one end and round at the other) by overlapping two or more pads.”
Simply add a pad on top of your pin and give them the same pin-number. If the soldermask is kept off both pins, and they overlap, they should appear as one pin on your board.
“Odd as it sounds, this can be necessary for some edge connectors. … but how do you do it???”
You can do it by making two pads at the same position and same pin number, but the second one with the flag “onsolder”. Like in:
Pad[ 10mm -3mm 10mm 3mm 2.0mm 0.5mm 0.2mm "1" "1" "square" ] Pad[ 10mm -3mm 10mm 3mm 2.0mm 0.5mm 0.2mm "1" "1" "square,onsolder" ]
Do a 2-sided pad as above. If you want the shape of the connector pad to be square at the edge end and half-round at the pcb-interior end, use two overlapping pads per side, like in:
Pad[ 0 -3mm 0 3mm 2.0mm 0.5mm 0.2mm "1" "1" "square" ] Pad[ 0 -3mm 0 5mm 2.0mm 0.5mm 0.2mm "1" "1" "" ]
Pad[ 0 -3mm 0 3mm 2.0mm 0.5mm 0.2mm "1" "1" "square,onsolder" ] Pad[ 0 -3mm 0 5mm 2.0mm 0.5mm 0.2mm "1" "1" "onsolder" ]