Translations of this page are also available in the following languages: Русский.

# PCB Footprint Guides

- PCB manual
- The PCB FAQ: pcb_tips.
- The PCB Quick-Reference has info on footprints
- PCB Footprint Naming Conventions : read this to learn how to name your footprint files.

### Footprint basics

- There are two types of footprints: M4 and NEWLIB.
- The best tools for creating footprints are PCB (wysiwyg), TEXT EDITOR (fast, accurate), SCRIPTING (powerful).
- For drawing footprints in PCB, refer to the section about library creation in the PCB manual, look at the part “Creating Newlib Footprints” in the “New Style Libraries” subsection.
- For Scripting footprints see the footprint generators page.
- Other things you may find helpful: calculator, paper+pencil, datasheets, calipers, spreadsheet.

### Manufacturer references for laying out footprints

- http://www.nxp.com/package
- http://focus.ti.com/general/docs/packaging.jsp
- http://www.maxim-ic.com/design/packaging/
- http://www.national.com/packaging/folders/pkg_index.html
- http://www.irf.com/package/
- http://www.onsemi.com/PowerSolutions/supportTechDoc.do?id=1165
- http://www.analog.com/Analog_Root/Packages/Packages_Home/
- http://www.linear.com/designtools/PkgInfo.jsp

### Sharing PCB Footprints

- The place to share symbols and footprints is gedasymbols.org

- You can find many PCB footprints at John Luciani's footprint page

- You can share gEDA footprints at Open Circuits.

### PCB Footprint FAQ

#### How do PCB's footprints work?

PCB supports two entirely separate footprint library mechanisms:

1. The first is referred to as the “oldlib”, “pcblib”, or the “M4 library”. This system uses the macro language M4 to generate footprints on the fly. The M4 library is fairly large. A powerful feature of the m4 library is that an entire family of footprints can quickly be defined by defining an appropriate base macro. Several standard families of footprints exist in pcblib. Starting with the pcb-20070208 snapshot, the entire m4 library is available as “newlib” footprints (see the following paragraph) under the name “pcblib-newlib”.
2. The second footprint library for PCB is called the “newlib”. Newlib footprints are defined using ASCII text files which call out each graphical primitive which makes up an entire footprint. Newlib footprints can either be created graphically using PCB or via any other method which can produce a text file (text editor, awk/perl/ruby script, etc.). The use of a scripting or programming language is especially powerful because you can generate large footprints or families of footprints.

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.

#### Where can I get pre-drawn footprints for PCB?

- Check your hard disk for `newlib` and `pcblib-newlib`. These directories contain the default footprint library of PCB.
- The best place to get additional footprints is the gEDA Symbols website. If you have you are welcome to contribute to the project and share your footprints.
- John Luciani's website has a large number of footprints and tools.
- Darrell Harmon provides a nice footprint generating script on his website.
- Finally, you can ask on the geda-user mailing list, and somebody might take pity on you and send you a footprint.

#### I want to use PCB to do layout. How do I know what value to use for the footprint attribute?

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

#### Newlib

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:

- You can browse the available footprints by running pcb and opening the footprint library window (available from the menu bar via Window → Library). Click on the “newlib” library group, and then select a sublibrary to browse its symbols. The name of each footprint appears in the Elements window on the right hand side of the footprint library browser. Use the name exactly as it appears in the browser for the footprint attribute in gschem or gattrib.
- The newlib footprints distributed with PCB are stored in the directories under `${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.
  For example, on my machine I installed gEDA with the prefix `/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`
  Therefore, to use this footprint on a component I set its “footprint” attribute to `0805_reflow_solder` using gschem or gattrib.
  Note that if the newlib symbol you want to use lives in a non-standard directory, gsch2pcb needs you to specify a path to that directory, either within your project.rc file (if you use one) or using the `--elements-dir` flag (from the command line).
- Finally, since each new design typically requires you to draw at least a couple of new footprints, it’s likely you will have a local “footprints” directory. As previously, the footprint name to use is the filename you assign to each of your new footprints. Again, don’t forget to add a line to your project.rc file telling gsch2pcb where to find your local footprints. Alternately, you can run gsch2pcb with the `--elements-dir` flag set to point to your local footprint directory.

#### M4 library

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:

- ~amp for Amp connectors
- ~amphenol for Amphenol connectors
- ~geda for many diverse parts used in basic design using gEDA (resistors, caps, etc).
- ~bourns for products like trim pots from Bourns
- ~cts for products like resistor packs from CTS
- ~johnstech for Johnstech sockets
- ~minicircuits for Minicircuits specific footprints
- ~panasonic for some Panasonic specific footprints

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.

#### What is the recommended way to deal with different footprints for the same sort of device?

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.

#### How do I draw a new footprint?

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.

- draw the part in PCB and save as a footprint. See the howto by Karel Kulhavy
- or use a python script by Darrel Harmon for “two pad”, “SOxx”, “tabbed” and QFP” style
- or use a perl script from John Luciani – can be adapted to DIL, SOxx-Style, QFP, or even circular arrangement of pads.
- or use the web based application dilpad written by DJ Delorie for “SOxx” style footprints.

#### How do I edit/change an existing footprint?

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.

1. Select element
2. Copy selection to buffer (`Ctrl`+`C`).
3. Break buffer elements to pieces. Pins become vias and pads become tracks. Unfortunately, some information is lost during the process. Namely, the square flag names of pins and pads. You have to regenerate this information later.
4. Paste buffer to layout
5. Do the desired changes. Note, that only vias, tracks and rectangles are allowed. No text, no arcs, no general polygons.
6. Select all objects that belong to the footprint
7. Copy selection to buffer (`Ctrl`+`C`). The position of the crosshair will determine the origin of the resulting footprint. The origin will be marked with a little diamond.
8. Convert buffer to element. This converts vias to pins. Tracks and rectangles get SMD pads.
9. Paste buffer to layout
10. Place the mouse over the pads that got rounded during step 4 and press `Q`. This squares off the rounded pad edges.
11. Go over every pad, press `N` and give a name to the pad.
12. Place the mouse somewhere where there is no pad or pin and give a name to the symbol.
13. Move the name to the place where you want the refdes or the value to appear.
14. Select everything and copy selection to buffer (`Ctrl`+`C`)
15. Save buffer elements to file.

Alternatively, you can use your favorite text editor and edit the source code of the footprint.

#### How do I move the diamond of a 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.

#### pcb does not save silk when I try to make a footprint

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 literary draw the letters with the line tool.

#### What is the proper way to make a double-sided 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.

#### How can I achieve pads without paste?

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.

#### How do I add a footprint library to PCB?

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

#### How do I update a footprint in my layout?

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.

#### PCB is not finding my footprints. Why?

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

#### Now that I have all of these footprints where do I put them?

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

#### Can I have two pads/pins with the same pin-number?

“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.”

#### How do I make an oval shaped pad around a footprint pin?

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.

#### How do I make a 2-sided pad?

“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" ]

#### Edge Connectors

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" ]