missing NULL terminator in set_config_x
[geda-gaf.git] / docs / wiki / geda-gsch2pcb_tutorial.html
blob1f8cfe08322de242eda5bcdbaed2ac81c5a73049
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html>
4 <head>
5 <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />
6 <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />
7 <link rel="stylesheet" media="print" type="text/css" href="./print.css" />
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10 </head>
11 <body>
13 <p>
14 <em>Translations of this page are also available in the following languages:</em> <a href="geda-gsch2pcb_tutorial.ru.html" class="wikilink1" title="geda-gsch2pcb_tutorial.ru.html">Русский</a>.
15 </p>
17 <h1 class="sectionedit1" id="gschem_-_gsch2pcb_-_pcb">gschem -&gt; gsch2pcb -&gt; PCB</h1>
18 <div class="level1">
20 <p>
21 This is a tutorial on the process of using gsch2pcb as an
22 interface between gschem and PCB.
23 It assumes the gEDA, PCB and gsch2pcb packages
24 are already installed and ready to use. Starting with gEDA 20030901,
25 gsch2pcb is packaged with gEDA and doesn&#039;t need to be separately installed.
26 This tutorial is functional and intended to
27 generate results as quickly as possible. It is not a complete reference
28 on gschem or PCB, but it does show with a simple example design
29 all the steps one might need to take.
30 </p>
32 <p>
33 The goal is to use gsch2pcb as the bridge between gschem and PCB so
34 that the schematics can always be in sync with the PCB layout
35 because all element additions or deletions in the layout will
36 automatically be driven by changes in the schematics. Back annotation
37 from PCB to gschem is currently not possible.
38 </p>
40 <p>
41 See the <a href="geda-gsch2pcb_tutorial_releasenotes.html" class="wikilink1" title="geda-gsch2pcb_tutorial_releasenotes.html">release notes</a> for the history of this tutorial.
42 </p>
44 </div>
45 <!-- EDIT1 SECTION "gschem -> gsch2pcb -> PCB" [120-1066] -->
46 <h2 class="sectionedit2" id="terminology">Terminology</h2>
47 <div class="level2">
49 <p>
50 With gschem, you add symbols representing electronic components to a
51 schematic. A symbol is a group of pins, attributes, and lines showing
52 an iconic representation of an electronic component.
53 Pins in symbols are connected to other pins by drawing a net
54 connection between them. Attributes are just named tags attached to
55 symbols to convey some bit of information. For using the schematic with PCB,
56 there are three of these attributes which are relevant and must be
57 specified. Each added symbol should have a <strong>footprint, value,</strong> and
58 <strong>refdes</strong> attribute.
59 </p>
61 <p>
62 The schematic <strong>footprint</strong> attribute value of a symbol is the name of the
63 PCB element to be placed on the layout for that instance of the symbol.
64 A PCB element is a group of pins, pads, and silk layer outlines physically
65 corresponding
66 to electronic components. It is probably a source of confusion for
67 newcomers to PCB that elements are of two different types. There are the
68 original m4 macro generated PCB elements and since PCB version 1.7
69 there are also the
70 newlib style file elements. A file element is a single fixed element
71 in a single file. However, many m4 macro element definitions may exist in a
72 single m4 element file. The macros can be given arguments to provide
73 programmable elements of variable number of pins or spacings.
74 Using these two types will be covered
75 in this tutorial and I will be referring to
76 these distinct element types as
77 <strong>m4 elements</strong> and <strong>file elements</strong>.
78 When you run PCB, the gschem <strong>footprint</strong> attribute
79 value will appear as the displayed element name when you
80 select <strong>Description</strong> from the <strong>Screen→Displayed Element Name</strong>
81 menu because gsch2pcb uses this field to keep track of which
82 <strong>footprint</strong> corresponds to a particular PCB element.
83 </p>
85 <p>
86 The gschem <strong>refdes</strong> attribute value is the reference designator
87 on the schematic such as Q1, U1, R1, etc. When you run PCB, this
88 refdes will appear as the displayed element name when you select
89 <strong>Reference Designator</strong> from the
90 <strong>Screen→Displayed Element Name</strong> menu.
91 </p>
93 <p>
94 The gschem <strong>value</strong> attribute value is the particular component value
95 such as BC546, 7400, 1K, etc. When you run PCB, this
96 <strong>value</strong> will appear as the displayed element name when you select
97 <strong>Value</strong> from the <strong>Screen→Displayed Element Name</strong> menu.
98 </p>
100 </div>
101 <!-- EDIT2 SECTION "Terminology" [1067-3370] -->
102 <h2 class="sectionedit3" id="setup">Setup</h2>
103 <div class="level2">
106 You should have a directory structure in mind for organizing your
107 design projects. The install of gEDA
108 and PCB gives you a set of default gschem symbols and
109 default PCB elements, but you can also provide for creating your own custom
110 libraries of gschem symbols and PCB elements.
111 </p>
112 <ul>
113 <li class="level1"><div class="li"> Somewhere, probably under your home directory, create a directory structure for your projects. Use directory names you like, but this tutorial will reference the directory name structure I use: <pre class="code">gaf/
114 gaf/gschem-sym/ Where I put the custom gschem symbols I create.
115 gaf/gschem-sym/transistors/ You can organize your custom symbols into subdirectories.
116 gaf/pcb-elements/ Where I put the custom PCB file elements I create.
117 These can also be organized into subdirectories.
118 gaf/myproject1/ And finally, separate directories for each
119 gaf/myproject2/ design project.
120 ...</pre>
123 With this organization, any custom gschem symbols and PCB elements you make can be common to all of your projects and this is good enough to get you started. However, I&#039;ll mention other possibilities which will be revealed below: There can be project specific PCB <strong>file element</strong> subdirectories or <strong>m4 element</strong> files. Or, CAD administrators can set up site wide custom PCB <strong>file element</strong> directories and <strong>m4 element</strong> files.
124 </p>
125 </div>
126 </li>
127 <li class="level1"><div class="li"> <strong>gEDA setup:</strong> the gschem, gnetlist, and other programs you may use such as gattrib, etc, all need to be able to find any custom symbols you will make, so you need to make your custom gschem symbol directories known to these programs in a gEDA gafrc file by adding <strong>component-library</strong> lines to either a user <strong>${HOME}/.gEDA/gafrc</strong> file or a project specific <strong>gafrc</strong> file in the project directory. There is also a system wide <strong>${GEDADATA}/system-gafrc</strong> file administrators can set up. The <strong>HOME</strong> and <strong>GEDADATA</strong> environment variables must be respectively set for those <strong>gafrc</strong> files to be found. For our directory structure setup above, we could add these lines to <strong>${HOME}/.gEDA/gafrc</strong> (plus lines for each additional <strong>gschem-sym</strong> subdirectory you want): <pre class="code">(component-library &quot;${HOME}/gaf/gschem-sym&quot;)
128 (component-library &quot;${HOME}/gaf/gschem-sym/transistors&quot;)</pre>
131 or, in each project directory (like myproject1 and myproject2) there could be a <strong>gafrc</strong> file with the lines:
132 </p>
133 <pre class="code">(component-library &quot;../gschem-sym&quot;)
134 (component-library &quot;../gschem-sym/transistors&quot;)</pre>
137 More modern versions of gEDA (since 1.7.2) let you specify only one command to achieve this:
138 </p>
139 <pre class="code">(component-library-search &quot;../gschem-sym&quot;) </pre>
142 which will recursively scan all subdirectories for symbol libraries. See the <a href="geda-gschem_ug-config.html" class="wikilink1" title="geda-gschem_ug-config.html">gEDA gschem User Guide</a> for further information on how to setup gEDA programs.
143 </p>
144 </div>
145 </li>
146 <li class="level1"><div class="li"> If you want a more detailed customization of gschem and gnetlist, you can override other initializations that are setup in the global rc files. In Debian, look at rc files in <strong>/etc/gEDA/</strong> for settings you can make. For example, I like the light gschem background, so I also put in my <strong>~/.gEDA/gschemrc</strong> the line: <pre class="code">(load (build-path geda-rc-path &quot;gschem-colormap-lightbg&quot;)) ; light background</pre>
147 </div>
148 </li>
149 <li class="level1"><div class="li"> <strong>PCB setup: </strong> A PCB distribution usually is set up so that PCB will automatically look in a <strong>packages</strong> subdirectory of the working directory. So, to make PCB find all the custom elements I put in <strong>gaf/pcb-elements</strong> I make a link in each of my project directories. Note that this link is actually not required when using gsch2pcb because, as described below, you may alternatively specify the <strong>pcb-elements</strong> directory in a <strong>project</strong> file. But if you do want to make the link, in directory <strong>gaf/myproject1</strong> enter the command: <pre class="code">ln -s ../pcb-elements packages</pre>
150 </div>
151 </li>
152 <li class="level1"><div class="li"> <strong> gsch2pcb setup: </strong> In each of your project directories, create a gsch2pcb project file which can be named anything that does not end in <em>.sch</em>. A project file will be created in the example below.</div>
153 </li>
154 </ul>
157 This is all the setup you need beyond the initial install of the gschem, gsch2pcb, and PCB packages.
158 </p>
160 </div>
161 <!-- EDIT3 SECTION "Setup" [3371-7505] -->
162 <h2 class="sectionedit4" id="simple_example">Simple Example</h2>
163 <div class="level2">
166 Let&#039;s generate a trivial design from schematics to PCB layout
167 almost as quickly as possible and then we can use it as a base for
168 doing some more advanced stuff. I&#039;ll complicate it just a bit by
169 making it a two schematic design.
170 </p>
173 Assuming you setup the directory structure described
174 above, go to the <strong>gaf/myproject1</strong> directory and create
175 a file named <strong>project</strong> with this content:
176 </p>
177 <pre class="code">schematics one.sch two.sch
178 output-name board</pre>
180 </div>
181 <!-- EDIT4 SECTION "Simple Example" [7506-7980] -->
182 <h3 class="sectionedit5" id="create_schematiconesch">Create schematic: one.sch</h3>
183 <div class="level3">
186 If you are using gschem for the first time, try stepping through
187 this simple <a href="geda-gschem_warmup.html" class="wikilink1" title="geda-gschem_warmup.html">gschem warmup</a>.
188 </p>
191 <a href="media/geda/one-sch-1.png" class="media" target="_blank" title="geda:one-sch-1.png"><img src="media/geda/one-sch-1.png" class="medialeft" title="one.sch" alt="one.sch" /></a> Run <strong>gschem one.sch</strong> and create this schematic (the second opamp is redundant, but this is just a tutorial):
192 </p>
193 <ul>
194 <li class="level1"><div class="li"> Open the select components dialog (type <kbd>I</kbd>)</div>
195 </li>
196 <li class="level1"><div class="li"> Make sure, the drop down menu at the bottom of the dialog is set to “Default behavior - reference component”.</div>
197 </li>
198 <li class="level1 node"><div class="li"> Add the components:</div>
199 <ul>
200 <li class="level2"><div class="li"> From the <strong>Basic devices</strong> library three <strong>resistor-1.sym</strong> and two <strong>dual-opamp-1.sym</strong>.</div>
201 </li>
202 <li class="level2"><div class="li"> From the <strong>Input/output</strong> library one <strong>output-2.sym</strong>.</div>
203 </li>
204 <li class="level2"><div class="li"> From the <strong>Power rails</strong> library one <strong>gnd-1.sym</strong>, two <strong>vcc-1.sym</strong> and two <strong>vee-1.sym</strong></div>
205 </li>
206 </ul>
207 </li>
208 <li class="level1"><div class="li"> Move components with the middle mouse button and rotate selected components by hitting keys <kbd>E</kbd><kbd>R</kbd> until everything is placed nicely. Rotate the bottom opamp and mirror it with the <kbd>E</kbd><kbd>I</kbd> keys.</div>
209 </li>
210 <li class="level1"><div class="li"> Use the <kbd>N</kbd> key and the mouse to draw net connections.</div>
211 </li>
212 </ul>
215 The large frame of the titleblock is a component too. It has been locked for convenience to prevent the mouse from catching it all the time. To unlock it, select it by dragging with left mouse button held down and press <kbd>E</kbd> - <kbd>Shift</kbd>+<kbd>L</kbd>. You can find title blocks with different sizes in the <strong>Titleblocks</strong> library. Remember, to lock the new title block with <kbd>E</kbd><kbd>L</kbd> while the title block is selected.
216 </p>
218 </div>
219 <!-- EDIT5 SECTION "Create schematic: one.sch" [7981-9469] -->
220 <h3 class="sectionedit6" id="edit_the_attributes_of_the_components_on_the_schematic">Edit the attributes of the components on the schematic</h3>
221 <div class="level3">
224 <a href="media/geda/one-sch-2.png" class="media" target="_blank" title="geda:one-sch-2.png"><img src="media/geda/one-sch-2.png" class="mediaright" title="one.sch" alt="one.sch" /></a> For each component, select it and bring up its attributes window by hitting keys <kbd>E</kbd><kbd>E</kbd>. Do not edit the <strong>refdes</strong> attribute here, but do make these edits:
225 </p>
226 <ul>
227 <li class="level1"><div class="li"> For resistors and the opamps, add visible <strong>value</strong> attributes and assign appropriate values to them (10K, TL072). Move these newly visible attributes to nice locations with the middle mouse button. Zoom in and repeat clicking the middle mouse button if it is difficult to select them.</div>
228 </li>
229 <li class="level1"><div class="li"> For the resistors, add a <strong>footprint</strong> attribute and give it the value <strong>R025</strong> which is the PCB <em>m4 element</em> for a 1/4 watt resistor. Make this attribute invisible.</div>
230 </li>
231 <li class="level1"><div class="li"> For the opamps, edit the already existing <strong>footprint</strong> attribute to be <strong>DIL 8 300</strong>. Yes, include those spaces because <strong>DIL</strong> is a <strong>m4 element</strong> that takes two args. We&#039;re telling it to make a dual in line package with 8 pins in a 300 mil package. Edit the <strong>slot</strong> attribute of the second opamp to be <strong>2</strong>. Its I/O pin numbers should change from (1,2,3) to (5,6,7).</div>
232 </li>
233 <li class="level1"><div class="li"> For the output module port, edit its <strong>net</strong> attribute to be <strong>vmixer:1</strong> and make it invisible. Edit its <strong>value</strong> attribute to be <strong>Vmixer</strong>.</div>
234 </li>
235 </ul>
238 It may have occurred to you that this editing will be painful for a
239 schematic with a large number of components that don&#039;t have reasonable
240 initial attribute values. At least for the footprints,
241 there are a couple of things that could help. You can create your own
242 library symbols having an initial <strong>footprint</strong> (and even <strong>value</strong>)
243 attribute default that covers most of your uses. Or, when you add your
244 first component, edit it to have a good footprint default and then copy it
245 (select it and hit the <kbd>E</kbd><kbd>C</kbd> keys) for all
246 remaining components instead of adding them from the library.<br/>
248 </p>
251 Anyway, we&#039;re done for now with <strong>one.sch</strong>, so save it with
252 the menu <strong>File→Save Page</strong> and quit gschem.
253 </p>
255 </div>
256 <!-- EDIT6 SECTION "Edit the attributes of the components on the schematic" [9470-11453] -->
257 <h3 class="sectionedit7" id="create_schematictwosch">Create schematic: two.sch</h3>
258 <div class="level3">
261 This will be really trivial and stupid since we&#039;re doing it only to
262 demonstrate multiple schematic capability.
263 <a href="media/geda/two-sch-1.png" class="media" target="_blank" title="geda:two-sch-1.png"><img src="media/geda/two-sch-1.png" class="medialeft" title="two.sch" alt="two.sch" /></a> Run <strong>gschem two.sch:</strong>
264 </p>
265 <ul>
266 <li class="level1"><div class="li"> Add component <strong>title-B.sym</strong> as you did in one.sch.</div>
267 </li>
268 <li class="level1 node"><div class="li"> Add components:</div>
269 <ul>
270 <li class="level2"><div class="li"> From the <strong>Input/Output</strong> library one <strong>input-2.sym</strong>.</div>
271 </li>
272 <li class="level2"><div class="li"> From the <strong>Basic Devices</strong> library one <strong>resistor-1.sym</strong>.</div>
273 </li>
274 <li class="level2"><div class="li"> From the <strong>Transistors</strong> library one <strong>2N3904-1.sym</strong>.</div>
275 </li>
276 <li class="level2"><div class="li"> From the <strong>Power rails</strong> library one <strong>gnd-1.sym</strong>, one <strong>vcc-1.sym</strong> and one <strong>vee-1.sym</strong>.</div>
277 </li>
278 <li class="level2"><div class="li"> From the <strong>Connectors</strong> library one <strong>BNC-1.sym</strong>.</div>
279 </li>
280 </ul>
281 </li>
282 <li class="level1"><div class="li"> Move components and draw nets as before.</div>
283 </li>
284 <li class="level1 node"><div class="li"> Edit component attributes:</div>
285 <ul>
286 <li class="level2"><div class="li"> Input module port: edit <strong>net</strong> attribute to be invisible and have value <strong>vmixer:1</strong> so this net will be connected to the <strong>vmixer</strong> in one.sch. Make the <strong>value</strong> attribute be <strong>Vmixer</strong>.</div>
287 </li>
288 <li class="level2"><div class="li"> Resistor: give it invisible <strong>footprint</strong> attribute <strong>R025</strong> and a visible <strong>value</strong> attribute 10K.</div>
289 </li>
290 <li class="level2"><div class="li"> Transistor: add <strong>value</strong> attribute <strong>2N3904</strong> and invisible <strong>footprint</strong> attribute <strong>TO92</strong>.</div>
291 </li>
292 <li class="level2"><div class="li"> BNC connector: add invisible <strong>footprint</strong> attribute <strong>CONNECTOR 2 1</strong>. which is a <strong>m4 element</strong> that takes arguments and we&#039;re telling it to make a connector with 2 rows and 1 column. We put a BNC connector on the schematic, but I&#039;m pretending we&#039;ll just jumper wires from this pc board header to a panel mounted connector.</div>
293 </li>
294 </ul>
295 </li>
296 </ul>
299 Unfortunately, the 2N3904 symbol we added has the text “2N3904” as an
300 integral part of its symbol. So when we add the <strong>value</strong> attribute
301 (which we want so the PCB layout will show appropriate values), there are
302 two “2N3904” designations visible on our schematic unless we would
303 make the <strong>value</strong> attribute invisible. This is not good and for this example
304 we have to live with it, but note that in most cases it&#039;s not a good
305 idea to hardwire information into symbols like this.
306 Also the default <strong>device</strong> attribute is wrong and should be <strong>NPN_TRANSISTOR</strong>
307 but it won&#039;t affect this tutorial. This is just to inform you that currently
308 there are some symbols in gschem that carry over outdated
309 attribute usage from older versions of gschem. If you get into
310 running spice on schematics, then your symbols will need to have
311 proper <strong>device</strong> attributes.
312 </p>
315 Now we are done with the schematics except for assigning <strong>refdes</strong>
316 attributes and we can use the command <strong>refdes_renum</strong> to do this
317 for both schematics at once. So, save <strong>two.sch</strong>, quit gschem and run:
318 </p>
319 <pre class="code">$ refdes_renum --pgskip one.sch two.sch</pre>
322 Run gschem on the schematics again to see how the components
323 have been given a <strong>refdes</strong> attribute. The <em>–pgksip</em> option
324 makes numbering begin at 101 for one.sch and at 201 for two.sch.
325 But you should know that
326 running <strong>refdes_renum</strong> is really only useful for an initial
327 numbering. If you later edit your schematics and add or delete
328 components, there is no guarantee when rerunning <strong>refdes_renum</strong>
329 that components will keep an
330 existing <strong>refdes</strong> value. If in the meantime you&#039;ve generated
331 a pc board using gsch2pcb, this reference designator number mixup
332 will put your schematics out of sync with your PCB layout. So,
333 after you initially run <strong>refdes_renum</strong> and start a PCB
334 layout, to be safe you will
335 need to manually add (unique) <strong>refdes</strong> attributes for any
336 schematic components you might add. Also note that <strong>refdes_renum</strong> may
337 number your resistors differently than it did for my examples here
338 depending on the order in which resistors were added. Keep that in
339 mind when comparing your eventual PCB layout to what you see in the
340 images below.
341 </p>
343 </div>
344 <!-- EDIT7 SECTION "Create schematic: two.sch" [11454-15072] -->
345 <h3 class="sectionedit8" id="generate_pcb_files_from_schematics">Generate PCB Files from Schematics</h3>
346 <div class="level3">
349 We have to fix one thing in <strong>one.sch</strong> before we can proceed.
350 Run <strong>gschem one.sch</strong> and notice that <strong>refdes_renum</strong> has
351 given our opamps <strong>refdes</strong> values of <strong>U101</strong> and <strong>U102</strong>
352 and did not know we really want to be using two opamps out of a single
353 TL072 package. That&#039;s why we edited the <strong>slot</strong> attribute of the
354 second opamp. We have to go back and fix this by editing the
355 <strong>refdes</strong> attribute of the second opamp to be <strong>U101</strong> so
356 both opamps will have the same <strong>refdes</strong>
357 and there will be only one TL072 package on our pc board.
358 </p>
361 Now, since we have already set up a gsch2pcb <strong>project</strong> file,
362 all we need to do to create an initial set of PCB files is to run
363 gsch2pcb:
364 </p>
365 <pre class="code">~/gaf/myproject1$ gsch2pcb project
366 0 file elements and 7 m4 elements added to board.pcb.</pre>
369 Since the project file specified <strong>board</strong> as the output-name,
370 the PCB files created are named <strong>board.pcb</strong> and <strong>board.net</strong>.
371 </p>
374 NB: more recent advice is to create an empty board using pcb first; then every use of gsch2pcb will generate changes to that layout as described below (<a href="#modifying_schematics" title=":geda:gsch2pcb_tutorial.txt ↵" class="wikilink1">Modifying Schematics</a>).
375 The reason for this is that gsch2pcb&#039;s default settings are quite different than pcb&#039;s these days,
376 and the consensus is that pcb&#039;s defaults are better for most uses.
377 One caveat with this is that if you use pcb2panel to combine multiple layouts into a single panelized layout,
378 you will get unusable results if the boards were created with a mix of gsch2pcb and [recent] pcb defaults
379 without editing the layer stacks, which may require further work. (mjm, Aug 2008)
380 </p>
383 If you get output from gsch2pcb like:
384 <em>2 unknown elements added to board.pcb.</em>, then run with the -v
385 flag: <strong>gsch2pcb -v project</strong> and the gsch2pcb output will tell
386 you which schematic components don&#039;t have a known <strong>footprint</strong>. Either
387 you forgot to add the attribute, the
388 attribute value is wrong,
389 or the PCB element for it is missing from your installation. But if
390 gsch2pcb can&#039;t find any elements and all 7 are unknown, then probably
391 gsch2pcb can&#039;t find your PCB m4 install directory. In this case,
392 look at the first part of the
393 <a href="#custom_m4_elements" title=":geda:gsch2pcb_tutorial.txt ↵" class="wikilink1">Custom M4 Elements</a> section.
394 </p>
396 </div>
397 <!-- EDIT8 SECTION "Generate PCB Files from Schematics" [15073-17251] -->
398 <h3 class="sectionedit9" id="layout_pcb_files">Layout PCB Files</h3>
399 <div class="level3">
401 </div>
403 <h4 id="set_the_defaults">Set the defaults</h4>
404 <div class="level4">
407 <a href="media/geda/board-1.png" class="media" target="_blank" title="geda:board-1.png"><img src="media/geda/board-1.png" class="medialeft" title="pcb, step 1" alt="pcb, step 1" /></a>Run <strong>pcb board.pcb</strong>. You&#039;ll see grouped into a big pile the PCB elements for all
408 the schematic component footprints. This is ok, we will clean up this mess later.
409 </p>
412 When you run PCB on a <strong>.pcb</strong> file for the first time, you should set up various initial values.
413 I usually set a 25 mil grid spacing with <strong>Screen→Grid Setting→25 mil</strong>
414 for the bulk of my layout work and then change grid spacing to smaller values as needed
415 for tight layout situations. Note that if you have enabled millimeter
416 units with <strong>Screen→Enable millimeter grid units</strong> you will see
417 a set of millimeter size options to select from instead of mils in the
418 <strong>Screen→Grid Setting</strong> menu. You may change between millimeter
419 and mil grid units at any time when doing a layout.
420 </p>
423 You should also set the default line and via sizes you
424 want for the Signal, Power, Fat, and Skinny drawing route styles.
425 Simply select one of these four route styles at the
426 lower left of the PCB window and then press the <strong>Route Style</strong>
427 button to edit the sizes. You can set your
428 board size now or wait until later while working on the layout.
429 To change the board size, bring up the <strong>File→Preferences</strong>
430 window and select the <strong>Sizes</strong> page. Other design rule
431 checking and increment sizes can also be edited in the Preferences
432 window. You should review PCB documentation for definitions of
433 these items. And you may find it useful to select <strong>Screen→Enable visible grid</strong>.
434 </p>
436 </div>
438 <h4 id="disperse_the_components">Disperse the Components</h4>
439 <div class="level4">
442 <a href="media/geda/board-2.png" class="media" target="_blank" title="geda:board-2.png"><img src="media/geda/board-2.png" class="mediaright" title="step 2" alt="step 2" /></a>
443 Use the middle mouse button to grab and move elements one
444 at a time until you have separated all the elements.
445 </p>
448 Or, you can let PCB spread out the elements with
449 <strong>Select→Disperse all elements</strong> before you fine tune
450 the positions with the middle mouse button.
451 </p>
453 </div>
455 <h4 id="load_the_netlist">Load the Netlist</h4>
456 <div class="level4">
459 <a href="media/geda/board-3.png" class="media" target="_blank" title="geda:board-3.png"><img src="media/geda/board-3.png" class="medialeft" title="Step 3" alt="Step 3" /></a>
460 </p>
461 <ul>
462 <li class="level1"><div class="li"> Go to <strong>File→load netlist file</strong> and select <strong>board.net</strong></div>
463 </li>
464 <li class="level1"><div class="li"> Do <strong>Connects→optimize rats-nest</strong>. Now, the pins and pads of components should be connected with straight lines according to the schematic. These are “rats”.</div>
465 </li>
466 </ul>
469 To minimize confusion, PCB tries to draw the rats of complex connections such that the sum of all rats is as short as possible. Try to drag an element to the other side of the working area. The rats will follow like a rubber band, but the end of the rats will not jump to a different node, although the resulting length might be shorter. The action <strong>optimize rats-nest</strong> rats will make the rats jump to this “better” geometry. This action can be applied conveniently anytime with a stroke of the key <kbd>O</kbd>.
470 </p>
472 </div>
474 <h4 id="place_the_components">Place the Components</h4>
475 <div class="level4">
478 <a href="media/geda/board-4.png" class="media" target="_blank" title="geda:board-4.png"><img src="media/geda/board-4.png" class="mediaright" title="Step 4" alt="Step 4" /></a>You will have to replace the rats with traces that can be etched in copper. After “Disperse all elements” the rats are usually in a random mess with lots of crossings. You should move and rotate the components around and try to disentangle the rats as much as possible. The key to a well routed pcb is proper placement of the components. Although PCB tries to clean up the rats lines while you move the components around, it is good practice to occasionally initiate rats optimization with the <kbd>O</kbd> key.
479 </p>
482 Select the <strong>ROT</strong> tool (<kbd>F9</kbd>) to move elements with the
483 middle mouse button and rotate them with the left mouse button.
484 The right mouse button will move the viewport to the canvas when zoomed in.
485 Zoom in and out with the mouse wheel or alternatively with <kbd>Z</kbd> and <kbd>Shift</kbd>+<kbd>Z</kbd>.
486 Hit the <kbd>F</kbd> key while the mouse hovers over a pin to highlight
487 the particular that touches this pin to help visualize the routes.
488 Use <kbd>Shift</kbd>+<kbd>F</kbd> to unhighlight. You can undo changes anytime with the <kbd>U</kbd> key.
489 </p>
492 Note: you can use the PCB auto placement
493 feature instead of manually placing (or dispersing with the
494 <strong>Select→Disperse …</strong> commands)
495 the components as described above. To do this,
496 you would load the netlist, select the components you want to be
497 autoplaced (if this is the first PCB run, just <strong>Select→Select all
498 objects</strong>) then do <strong>Select→Auto place selected elements</strong>.
499 Then you can again manually tune the PCB generated placements.
500 The auto place function should place elements more intelligently than the
501 disperse function, but it is also much slower as layouts get larger.
502 </p>
504 </div>
506 <h4 id="replace_rats_nests_with_routes">Replace rats nests with routes</h4>
507 <div class="level4">
510 <a href="media/geda/board-5.png" class="media" target="_blank" title="geda:board-5.png"><img src="media/geda/board-5.png" class="medialeft" title="Step 5" alt="Step 5" /></a> At this point you can start routing traces between pins connected
511 by rats nest lines. On the left PCB toolbar,
512 select the <strong>LINE</strong> tool, select the layer you want to draw on
513 (solder, component, etc), and start drawing lines by selecting
514 endpoints with the left
515 mouse button. Again, it can help to use the <kbd>F</kbd> key to highlight
516 routes that need to be connected.
517 If you want to stop the current trace so you can start
518 drawing a new trace somewhere else, finish the current trace with
519 a middle mouse click. Or you can play with auto routing here.
520 </p>
523 A very useful operation with the <strong>SEL</strong>
524 tool is to select multiple objects and then cut or copy them to a
525 buffer with the menu <strong>Buffer→Cut selection to buffer</strong> (or copy).
526 You can immediately paste the buffer contents or abort the current
527 paste by selecting another tool. The buffer contents can be pasted
528 any time later with <strong>Buffer→Paste buffer to layout</strong>. With
529 this you can move layout
530 areas around or step and repeat common trace patterns. To
531 select multiple objects with the <strong>SEL</strong> tool, click and drag
532 to select rectangular regions, and <kbd>Shift</kbd>-click to toggle additional
533 selections to the currently selected set.
534 </p>
537 When you&#039;ve finished routing the traces (PCB will congratulate you if all
538 traces are routed when you optimize the rats nest) the board can look
539 something like this. For this view I&#039;ve selected
540 <strong>Screen→Displayed element name→Value</strong>.
541 </p>
544 You will want more information on using PCB and there is a set
545 of html docs in the PCB source tarball. I don&#039;t know of a link to
546 put here, but you can get the latest tarball from the
547 <a href="http://sourceforge.net/projects/pcb/" class="urlextern" title="http://sourceforge.net/projects/pcb/" rel="nofollow">PCB development </a> site.
548 Or the docs may be installed somewhere on your system.
549 The Debian package has them installed in <strong>/usr/share/doc/pcb/html/</strong>.
550 PCB also has some convenient “live” documentation that can
551 help you become familiar with keyboard shortcuts or keyboard commands.
552 Bring up the keyboard shortcuts window with the menu
553 <strong>Window→Key Reference</strong> and you&#039;ll probably find just reading
554 through the shortcuts available will teach you a lot about what you
555 can do with PCB.
556 If you have selected in the <strong>File→Preferences</strong> window the
557 <em>Use separate window for command entry</em> option, then when
558 you bring up the Command window with <strong>Window→Command Entry</strong>
559 (or the <kbd>:</kbd> key), you will see a <strong>Command Reference</strong> expander
560 arrow. Click on the arrow and a command reference will be shown
561 which lists some commands you can type in that may not be available
562 from the menus or a keyboard shortcut.
563 </p>
566 For example, say you
567 have in the <strong>Preferences→Increments</strong> page configured a size
568 increment of 5 mils. With this you can select some lines and
569 then increase their width by 5 mils by selecting from the menu
570 <strong>Select→Change size of selected objects→Increment lines by 5 mils.</strong>
571 However, suppose you want to be changing widths by random values and it&#039;s
572 inconvenient to be changing the Preferences each time. For this,
573 you can select some lines,
574 bring up the command window (hit <kbd>:</kbd>) and type in the command:
575 </p>
576 <pre class="code">changesize(selectedlines, +3, mils)</pre>
579 and the selected lines
580 will increase by 3 mils. This command is now in a history list
581 which you can recall and quickly edit in the command window to change
582 sizes by other values.
583 </p>
585 </div>
587 <h4 id="look_at_the_other_side_of_the_board">Look at the other side of the board</h4>
588 <div class="level4">
591 In some layouts it is important to put components on either side of
592 the board, although not for the preceding example. In such a case
593 the <kbd>Tab</kbd> key can be used to flip the board over and view it from the
594 back while the <kbd>B</kbd> key can be used to put a selected component on the
595 other side of the board.
596 On dual sided boards it is also important to note what side a particular
597 layer of traces is on. This can be seen, and set, in the
598 File→Preferences→Layers→Groups dialog. Layers on the &#039;component&#039; side
599 will be on the top of the board and layers on the &#039;solder&#039; side will be on
600 the bottom. In this dialog you should make sure that all layers which are to
601 be fabricated in the same step (i.e. etched with photo-lithography) are grouped
602 together.
603 </p>
605 </div>
607 <h4 id="add_a_ground_plane">Add a Ground Plane</h4>
608 <div class="level4">
611 This section goes over how to add a ground plane. For this section, the top layer of the board looks like this:<br/>
613 <a href="media/geda/170810_002_groundplane.png" class="media" target="_blank" title="geda:170810_002_groundplane.png"><img src="media/geda/170810_002_groundplane.png" class="medialeft" title="top side" alt="top side" /></a> <br/>
615 <br/>
617 <br/>
619 <br/>
621 <br/>
623 <br/>
625 <br/>
627 <br/>
629 <br/>
631 <br/>
633 <br/>
635 <br/>
637 <br/>
639 <br/>
641 <br/>
643 <br/>
645 If you haven&#039;t done so already, flip your board to the back side by pressing <kbd>Tab</kbd>. You might have to move the vertical scroll bar to find your board. It&#039;s there. This is what it should look like:<br/>
647 <a href="media/geda/170810_004_groundplane.png" class="media" target="_blank" title="geda:170810_004_groundplane.png"><img src="media/geda/170810_004_groundplane.png" class="medialeft" title="back side" alt="back side" /></a> <br/>
649 <br/>
651 <br/>
653 <br/>
655 <br/>
657 <br/>
659 <br/>
661 <br/>
663 <br/>
665 <br/>
667 <br/>
669 <br/>
671 <br/>
673 <br/>
675 <br/>
677 <a href="media/geda/170810_008_groundplane.png" class="media" target="_blank" title="geda:170810_008_groundplane.png"><img src="media/geda/170810_008_groundplane.png" class="medialeft" title="bottom button" alt="bottom button" /></a>Select the “Bottom” layer from the left.<br/>
679 <br/>
681 Use the <a href="media/geda/170810_005_groundplane.png" class="media" target="_blank" title="geda:170810_005_groundplane.png"><img src="media/geda/170810_005_groundplane.png" class="medialeft" title="RECT side" alt="RECT side" /></a> rectangle (RECT) tool, click once in the upper left corner and then once again in the lower right corner.<br/>
683 <br/>
685 <a href="media/geda/170810_010_groundplane.png" class="media" target="_blank" title="geda:170810_010_groundplane.png"><img src="media/geda/170810_010_groundplane.png" class="medialeft" title="rectangle" alt="rectangle" /></a><br/>
687 <br/>
689 <br/>
691 <br/>
693 <br/>
695 <br/>
697 <br/>
699 <br/>
701 <br/>
703 <br/>
705 <br/>
707 <br/>
709 <br/>
711 PCB should fill in the area for you. Now, switch back to the top side using <kbd>Tab</kbd>. You have just made a copper plane. We will make it a ground plane in the next section.<br/>
713 <br/>
715 </p>
717 </div>
719 <h4 id="add_a_via">Add a via</h4>
720 <div class="level4">
723 Let&#039;s say we need to ground the pins from R102 and R201. We can use the copper plane we just created. A via will get you through the board. We will accept the defaults that are set using the route styles button. Feel free to open that dialog box and explore. <br/>
725 <br/>
727 <a href="media/geda/170810_013_via.png" class="media" target="_blank" title="geda:170810_013_via.png"><img src="media/geda/170810_013_via.png" class="medialeft" title="Route styles button" alt="Route styles button" /></a><br/>
729 <br/>
731 <br/>
733 <a href="media/geda/170810_014_via.png" class="media" target="_blank" title="geda:170810_014_via.png"><img src="media/geda/170810_014_via.png" class="medialeft" title="Via button" alt="Via button" /></a> Next, click on the via button, and click above and between the unconnected pins on R102 and R201.<br/>
735 <br/>
737 <a href="media/geda/170810_015_via.png" class="media" target="_blank" title="geda:170810_015_via.png"><img src="media/geda/170810_015_via.png" class="medialeft" title="via placement" alt="via placement" /></a><br/>
739 <br/>
741 <br/>
743 <br/>
745 <br/>
747 <br/>
749 <br/>
751 <br/>
753 <br/>
755 We will connect to this via using the line tool. <br/>
757 Click the “Top” button to make the top layer active. <br/>
759 Click the line button and click on the left resistor end, and then on the via. Press escape, then with the line tool again, click on the right resistor end, and on the via. <br/>
761 The top side is connected.<br/>
763 <a href="media/geda/170810_016_via.png" class="media" target="_blank" title="geda:170810_016_via.png"><img src="media/geda/170810_016_via.png" class="medialeft" title="via placement" alt="via placement" /></a><br/>
765 <br/>
767 <br/>
769 <br/>
771 <br/>
773 <br/>
775 Now, we need to connect the bottom side to the via. Press <kbd>Tab</kbd> and also press the “Bottom” layer button to make it active. If the bottom layer icon has a little triangle in with mostly white space, it is hidden. Click in that box to make it visible. <br/>
777 <a href="media/geda/170810_017_via.png" class="media" target="_blank" title="geda:170810_017_via.png"><img src="media/geda/170810_017_via.png" class="medialeft" title="select tool" alt="select tool" /></a>Using the select tool, click on the via annulus.<br/>
779 <br/>
781 <br/>
783 <a href="media/geda/170810_018_via.png" class="media" target="_blank" title="geda:170810_018_via.png"><img src="media/geda/170810_018_via.png" class="medialeft" title="via placement" alt="via placement" /></a><br/>
785 <br/>
787 <br/>
789 <br/>
791 <br/>
793 <br/>
795 <br/>
797 <br/>
799 <br/>
801 <br/>
803 With the copper annulus selected, press ctrl-shift-k. That should shrink the clearance area of the annulus to allow the copper to touch the annulus.<br/>
805 <a href="media/geda/170810_020_via.png" class="media" target="_blank" title="geda:170810_020_via.png"><img src="media/geda/170810_020_via.png" class="medialeft" title="via placement" alt="via placement" /></a><br/>
807 <br/>
809 <br/>
811 <br/>
813 <br/>
815 <br/>
817 <br/>
819 <br/>
821 <br/>
823 <br/>
825 The pins from the resistors are now connected to the plane you created earlier. You can click “Top” and press <kbd>Tab</kbd> to get back to the top view of the board.<br/>
827 <a href="media/geda/170810_022_via.png" class="media" target="_blank" title="geda:170810_022_via.png"><img src="media/geda/170810_022_via.png" class="medialeft" title="via placement" alt="via placement" /></a><br/>
829 </p>
831 </div>
832 <!-- EDIT9 SECTION "Layout PCB Files" [17252-28743] -->
833 <h2 class="sectionedit10" id="modifying_schematics">Modifying Schematics</h2>
834 <div class="level2">
837 The process of transferring schematic modifications to your PCB layout is
838 made very simple by using gsch2pcb. After the first <strong>board.pcb</strong>
839 was created when you initially ran gsch2pcb,
840 each time you run gschem on
841 your schematics and make changes, run <strong>gsch2pcb project</strong>. Then run
842 <strong>pcb board.pcb</strong> and do whatever is necessary based on the work
843 gsch2pcb has done. Each time gsch2pcb is run, this will happen:
844 </p>
845 <ul>
846 <li class="level1"><div class="li"> gsch2pcb always generates a new <strong>board.net</strong>. If the net was changed, load the new netlist file when you run pcb.</div>
847 </li>
848 <li class="level1"><div class="li"> If you added components (with a footprint attribute) to a schematic gsch2pcb will generate a <strong>board.new.pcb</strong> containing all the new PCB elements corresponding to the footprints. You then run <strong>pcb board.pcb</strong> and load the <strong>board.new.pcb</strong> with new elements into the existing layout with <strong>File→load layout data to paste-buffer</strong>. Place the new elements, load the new netlist, and route new traces.</div>
849 </li>
850 <li class="level1"><div class="li"> If you deleted components from a schematic, gsch2pcb will delete the corresponding PCB elements from <strong>board.pcb</strong>. You only need to run <strong>pcb board.pcb</strong> and clean up dangling traces from around the deleted elements.</div>
851 </li>
852 <li class="level1"><div class="li"> If you change an existing component&#039;s <strong>footprint</strong>, gsch2pcb will delete the corresponding old element from <strong>board.pcb</strong> and add the new element to <strong>board.new.pcb</strong>.</div>
853 </li>
854 <li class="level1"><div class="li"> If you changed schematic component <strong>value</strong> attributes, the value changes will be forward annotated to <strong>board.pcb</strong> in place.</div>
855 </li>
856 </ul>
859 So by using gsch2pcb, all PCB element changes are driven by the
860 schematics and you should never need to manually add or delete elements
861 for schematic components.
862 </p>
865 However, you will need to manually add PCB
866 elements that are not part of the schematics such as pc board mounting
867 holes. For these manually added PCB elements, make sure you never give
868 them a <strong>name on PCB</strong> name because that is reserved for schematic
869 component <strong>refdes</strong> attributes and gsch2pcb will want to delete
870 elements which have a non-empty <strong>name on PCB</strong> and don&#039;t match
871 any schematic component <strong>refdes</strong>.
872 </p>
875 Now, so far we&#039;ve only used <strong>m4 elements</strong> in our layout so let&#039;s
876 modify a schematic to use a <strong>file element</strong>. But first, it would
877 help to know about the default elements PCB provides. Depending
878 on the location of your PCB install there will be a directory
879 <strong>/usr/local/share/pcb/newlib, /usr/share/pcb/newlib</strong>, or possibly
880 something else (depending on the <em>prefix</em> specified when PCB
881 was installed). PCB versions before 20031113 used <strong>pcb_lib</strong> instead
882 of <strong>newlib</strong> in the locations
883 <strong>/usr/local/pcb_lib</strong>, or <strong>/usr/lib/pcb_lib</strong>.
884 Once you find your <strong>newlib</strong> directory,
885 look at the file names in each subdirectory. Each file name
886 is a name which may be used as a <strong>footprint</strong> attribute
887 for a schematic component. For example, there is the file
888 <strong>xxx/newlib/2_pin_thru-hole_packages/0.125W_Carbon_Resistor</strong>
889 so if we wanted 1/8 watt resistors on our layout, we could
890 use <strong>0.125W_Carbon_Resistor</strong> as the resistor <strong>footprint</strong>
891 attribute instead of <strong>R025</strong>. Try changing, say resistor R101 to
892 use <strong>0.125W_Carbon_Resistor</strong> in <strong>one.sch</strong> and
893 then run <strong>gsch2pcb project</strong>. If gsch2pcb does not find
894 this element, then you need to add your <strong>newlib</strong>
895 directory to your <strong>project</strong> file with a line like:
896 </p>
897 <pre class="code">elements-dir /usr/lib/newlib</pre>
900 If gsch2pcb does find it, you will get:
901 </p>
902 <pre class="code">~/gaf/myproject1$ gsch2pcb project
903 board.pcb is backed up as board.pcb.bak1.
904 1 elements deleted from board.pcb.
905 1 file elements and 0 m4 elements added to board.new.pcb.</pre>
908 Now you need to run <strong>pcb board.pcb</strong>. You will see that the
909 element for resistor R101 is gone and that you will get the
910 new element by loading <strong>board.new.pcb</strong> with
911 <strong>File→load layout data to paste-buffer</strong>.
912 </p>
914 </div>
915 <!-- EDIT10 SECTION "Modifying Schematics" [28744-32536] -->
916 <h2 class="sectionedit11" id="custom_gschem_symbols">Custom gschem Symbols</h2>
917 <div class="level2">
920 A common way to generate a custom symbol is to start with an
921 existing symbol and modify it. One thing I don&#039;t like about
922 the <strong>dual-opamp-1.sym</strong> we used is that the power pins are
923 repeated on each symbol. While some will prefer this, I
924 think it makes a page full of opamps
925 look a little cluttered and it presents a good opportunity to
926 learn about <strong>net</strong> attributes in this tutorial.
927 It&#039;s possible with gschem for symbols to
928 have <strong>net</strong> attributes which can assign pins to a particular
929 net. Instead of hooking up each opamp pin 8 to Vcc and pin 4 to
930 Vee on the schematic, we can have that happen automatically and
931 eliminate the pins on the schematic. To do this, just copy the
932 original symbol to our custom gschem symbol directory, giving it
933 a new name, and edit it. Do the steps described below. (Your gEDA symbol install directory may be something
934 different like <strong>/usr/local/share/gEDA/sym/</strong>):
935 </p>
937 </div>
939 <h5 id="make_attributes_visible">Make Attributes Visible</h5>
940 <div class="level5">
943 <a href="media/geda/gschem-sym-1.png" class="media" target="_blank" title="geda:gschem-sym-1.png"><img src="media/geda/gschem-sym-1.png" class="medialeft" title="Step 1" alt="Step 1" /></a>
944 </p>
945 <pre class="code">cd /usr/share/gEDA/sym/analog/
946 cp dual-opamp-1.sym ~/gaf/gschem-sym/opamp-dual.sym
947 cd ~/gaf/gschem-sym
948 gschem opamp-dual.sym</pre>
949 <ul>
950 <li class="level1"><div class="li"> Hit keys <kbd>E</kbd><kbd>N</kbd> to make attributes visible.</div>
951 </li>
952 <li class="level1"><div class="li"> Hit keys <kbd>V</kbd><kbd>E</kbd> to view extents.</div>
953 </li>
954 <li class="level1"><div class="li"> Left mouse click on pin 8 to select it.</div>
955 </li>
956 </ul>
958 </div>
960 <h5 id="remove_the_visible_supply_pins">Remove the Visible Supply Pins</h5>
961 <div class="level5">
964 <a href="media/geda/gschem-sym-2.png" class="media" target="_blank" title="geda:gschem-sym-2.png"><img src="media/geda/gschem-sym-2.png" class="medialeft" title="Step 2" alt="Step 2" /></a>
965 </p>
966 <ul>
967 <li class="level1"><div class="li"> Hit <kbd>Delete</kbd> key to delete pin 8.</div>
968 </li>
969 <li class="level1"><div class="li"> Similarly select and delete pin 4.</div>
970 </li>
971 <li class="level1"><div class="li"> Double click to select and edit the <strong>slotdef</strong> lines. Edit them by removing the pins 4 and 8.</div>
972 </li>
973 </ul>
975 </div>
977 <h5 id="add_global_nets_to_in_numbers">Add global Nets to in Numbers</h5>
978 <div class="level5">
981 <a href="media/geda/gschem-sym-3.png" class="media" target="_blank" title="geda:gschem-sym-3.png"><img src="media/geda/gschem-sym-3.png" class="medialeft" title="Step 3" alt="Step 3" /></a>From the menu <strong>Add→Attribute</strong>
982 </p>
983 <ul>
984 <li class="level1"><div class="li"> Add a <strong>net</strong> attribute with value <strong>Vcc:8</strong> Select <strong>Show Name &amp; Value</strong> and make it invisible.</div>
985 </li>
986 <li class="level1"><div class="li"> Add a <strong>net</strong> attribute with value <strong>Vee:4</strong> Make it <strong>Show Name &amp; Value</strong> and invisible.</div>
987 </li>
988 <li class="level1"><div class="li"> Make the <strong>device</strong> attribute be just <strong>OPAMP</strong>.</div>
989 </li>
990 </ul>
993 Clean up by moving these new attributes as shown.
994 </p>
997 Change the footprint default if you wish.
998 When all the edits are done, it&#039;s very important when editing
999 symbols to do a <strong>Edit→Symbol Translate</strong> to zero before saving.
1000 Do that and then save the symbol with <strong>File→Save Page</strong>
1001 I made the <strong>footprint</strong> default be <strong>DIP8</strong> because I have
1002 that as a custom element.
1003 </p>
1005 </div>
1007 <h5 id="run_gschem_with_the_new_symbol">Run gschem with the New Symbol</h5>
1008 <div class="level5">
1011 <a href="media/geda/one-sch-3.png" class="media" target="_blank" title="geda:one-sch-3.png"><img src="media/geda/one-sch-3.png" class="medialeft" title="one.sch" alt="one.sch" /></a> Run <strong>gschem one.sch</strong>. Select and delete with the <kbd>Delete</kbd>
1012 key both opamps. Also delete the <strong>Vcc</strong> and <strong>Vee</strong> symbols that
1013 were connected to them. Bring up the Add Components window
1014 and from the <strong>gschem-sym</strong> library which should now have your
1015 new custom symbol, place two of the <strong>opamp-dual.sym</strong>
1016 Move them to the right place on the schematic and don&#039;t forget to
1017 mirror and rotate the bottom opamp as before. Edit the attributes
1018 of each opamp giving them the same attributes they had, that
1019 is make the <strong>footprint</strong> be <strong>DIL 8 300</strong>, add a <strong>value</strong>
1020 attribute of <strong>TL072</strong>, and make the <strong>refdes</strong> of both
1021 opamps be <strong>U101</strong>. Make the <strong>slot</strong> of the second opamp
1022 be <strong>2</strong>. If you don&#039;t make the attributes the same as they were
1023 before, gsch2pcb will think it is a different component and delete the
1024 existing <strong>DIL</strong> package from the layout. If you did everything
1025 right, running gsch2pcb should give:
1026 </p>
1027 <pre class="code">~/gaf/myproject1$ gsch2pcb project
1028 Found a cpinlist head with a netname! [Vcc]
1029 Found a cpinlist head with a netname! [Vee]
1030 Found a cpinlist head with a netname! [Vcc]
1031 Found a cpinlist head with a netname! [Vee]
1032 Found a cpinlist head with a netname! [Vcc]
1033 Found a cpinlist head with a netname! [Vee]
1034 Found a cpinlist head with a netname! [Vcc]
1035 Found a cpinlist head with a netname! [Vee]
1036 No elements to add so not creating board.new.pcb</pre>
1039 Where the gEDA gnetlist program
1040 seems a bit “excited” about finding the new
1041 Vcc and Vee <strong>net</strong> attributes we just added, and a new netlist
1042 was generated. Now I think the schematic looks
1043 cleaner. And if you run <strong>pcb board.pcb</strong> and load the new netlist and then
1044 optimize the rats nest, PCB should tell you the board is complete
1045 which means connecting the opamp power pins via the <strong>net</strong>
1046 attribute has worked.
1047 </p>
1050 For complete details on making symbols, read through the
1051 <a href="geda-gschem_symbol_creation.html" class="wikilink1" title="geda-gschem_symbol_creation.html">Symbol Creation Document</a> on the
1052 <a href="geda-documentation.html" class="wikilink1" title="geda-documentation.html">gEDA Documentation</a> page.
1053 </p>
1055 </div>
1056 <!-- EDIT11 SECTION "Custom gschem Symbols" [32537-36845] -->
1057 <h2 class="sectionedit12" id="custom_file_elements">Custom file elements</h2>
1058 <div class="level2">
1061 You can create custom <strong>file elements</strong>
1062 in the middle of running PCB on any layout or you can run PCB
1063 just for making the element. As a demonstration, lets make a
1064 custom element for a 1N4004 diode. There are axial packages
1065 provided by PCB, but we want to be sure the drill size will be
1066 right for this 1 amp
1067 diode with slightly fatter leads. It needs about a 42 mil (#58) drill.
1068 </p>
1071 Run <strong>pcb</strong> and the first thing to do is select the <strong>Signal</strong>
1072 routing style and edit its sizes (press the <strong>Route Style</strong> button)
1073 Set the <strong>Via hole</strong> size
1074 to 42 and the <strong>via size</strong> to 70 or larger as you like.
1075 Select
1076 <strong>Screen→Grid setting→25 mil</strong> and
1077 <strong>Screen→Enable visible grid</strong>.
1078 Zoom in a couple of steps, then make the element:
1079 <a href="media/geda/pcb-el-1.png" class="media" target="_blank" title="geda:pcb-el-1.png"><img src="media/geda/pcb-el-1.png" class="medialeft" title="Step 1" alt="Step 1" /></a>
1080 </p>
1081 <ul>
1082 <li class="level1"><div class="li"> Select the <strong>VIA</strong> tool and place two vias 400 mils apart.</div>
1083 </li>
1084 <li class="level1"><div class="li"> With the mouse on the left via, hit the <kbd>N</kbd> key and give the via the name <strong>1</strong>. Give the right via the name <strong>2</strong></div>
1085 </li>
1086 <li class="level1"><div class="li"> Pin 1 will be the cathode and this must agree with the pin numbers in your diode gschem symbol.</div>
1087 </li>
1088 </ul>
1091 <a href="media/geda/pcb-el-2.png" class="media" target="_blank" title="geda:pcb-el-2.png"><img src="media/geda/pcb-el-2.png" class="mediaright" title="Step 2" alt="Step 2" /></a>
1092 </p>
1093 <ul>
1094 <li class="level1"><div class="li"> Select the <strong>Silk</strong> layer and the <strong>LINE</strong> tool.</div>
1095 </li>
1096 <li class="level1"><div class="li"> Draw the component outline as shown with line width set to 10 mils and the grid setting set to 10 mils.</div>
1097 </li>
1098 <li class="level1"><div class="li"> Draw the left fat cathode indicator with three lines after setting the line width to 20 mils.</div>
1099 </li>
1100 <li class="level1"><div class="li"> Don&#039;t let silk layer lines overlap solder pads.</div>
1101 </li>
1102 </ul>
1105 Select the vias and the outline just drawn using the <strong>SEL</strong> tool
1106 and finish making the element:
1107 </p>
1108 <ul>
1109 <li class="level1"><div class="li"> <strong>Buffer→Cut selection to buffer</strong> and move the cursor to the center of the left via and click.</div>
1110 </li>
1111 <li class="level1"><div class="li"> <strong>Buffer→Convert buffer to element</strong></div>
1112 </li>
1113 <li class="level1"><div class="li"> <strong>Buffer→Save buffer elements to file</strong> and navigate to <strong>~/gaf/pcb-elements</strong> and save the element as <strong>D400-1A</strong> since it&#039;s a package for a 1A diode with 400 mil spaced pins. Or give it any descriptive name you like.</div>
1114 </li>
1115 </ul>
1118 <strong>Note:</strong> if you save the element with a name which is the same
1119 as a <strong>m4 element</strong>, gsch2pcb will preferentially use the m4
1120 element unless you give gsch2pcb the --use-files (or -f) option.
1121 You may put <strong>use-files</strong> in a project file if you want to always
1122 give priority to using <strong>file elements</strong>. The m4 element names appear
1123 to use upper case, so you could also avoid the problem by using
1124 lower case in your file element names. Also, the only way I know to make
1125 the pin 1 of the symbol square is to edit the D400-1A file manually and
1126 change the square flag in the Pin “1” line. For example, change the
1127 line:
1128 </p>
1129 <pre class="code">Pin(0 0 70 20 70 42 &quot;&quot; &quot;1&quot; 0x00000001)</pre>
1133 </p>
1134 <pre class="code">Pin(0 0 70 20 70 42 &quot;&quot; &quot;1&quot; 0x00000101)</pre>
1137 You can now use <strong>D400-1A</strong> in a gschem schematic symbol
1138 <strong>footprint</strong> attribute and gsch2pcb will find it provided
1139 you have made the <strong>packages</strong> link described in the <strong>Setup</strong>
1140 section. If you have not made that link, you can still tell gsch2pcb
1141 about the elements directory with a line in a project file:
1142 </p>
1143 <pre class="code">elements-dir ~/gaf/pcb-elements</pre>
1146 Possibly you&#039;ve noticed, but there are some things not right about the
1147 <strong>myproject1</strong> example. For one thing, silk layer lines are
1148 overlapping solder pads on some of the elements, and for another,
1149 the transistor is backwards on the layout!
1150 You otherwise shouldn&#039;t have a problem like this when working
1151 with gschem and PCB, but transistor pin numbering can be confusing.
1152 If you will be using transistors in your designs, here&#039;s a description
1153 of my approach to
1154 making sure my gschem transistor symbol pin numbering is
1155 coordinated with PCB element pin numbers:
1156 <a href="geda-transistor_guide.html" class="wikilink1" title="geda-transistor_guide.html">transistor guide.</a>
1157 </p>
1160 From the transistor guide, you can see that the problem here is that
1161 the <strong>TO92</strong> element has its pins numbered
1162 in the less common (3,2,1) configuration while the <strong>2N3904-1.sym</strong>
1163 is like a npn-ebc symbol which needs a (1,2,3) numbering. You can
1164 see the 2N3904 pin numbers in gschem by hitting the <kbd>E</kbd><kbd>N</kbd> keys
1165 (and don&#039;t be confused by the <strong>pinseq</strong> attribute that nearly
1166 covers up the <strong>pinnumber</strong>). And in PCB, you can see the <strong>TO92</strong>
1167 pin numbers by hitting the <kbd>D</kbd> key with the mouse over
1168 the element. To be sure you are seeing pin numbers and not pin
1169 names, select <strong>Screen→pinout shows number</strong>.
1170 </p>
1173 I have libraries with transistor symbols and elements that you might
1174 find useful, so as a convenience you can get your custom
1175 libraries initially populated by installing my
1176 <a href="media/geda/gsch2pcb-libs.tar.gz" class="media" target="_blank" title="geda:gsch2pcb-libs.tar.gz"> gschem/PCB libraries</a>.
1177 Untar them under ~/gaf to mirror the setup of our example
1178 and there will also be a
1179 <strong>~/gaf/pcb-elements.Readme</strong> which documents the PCB elements.
1180 <em>Note: as of 1/10/2004 I&#039;ve corrected the tarball pcb elements
1181 to not overlap solder pads with silk layer lines.</em>
1182 If you untar them somewhere else,
1183 you will need to make sure that gschem knows about them with
1184 gafrc <strong>component-library</strong> lines and that
1185 gsch2pcb can find them with <strong>elements-dir</strong> lines in a
1186 project file.
1187 </p>
1190 If you install them, you can fix Q201 in <strong>two.sch</strong>
1191 by changing its footprint to <strong>TO-92</strong> which is my custom
1192 element with (1,2,3) pin numbering.
1193 Then run <strong>gsch2pcb project</strong>
1194 and then <strong>pcb board.pcb</strong> and load the new element for
1195 the transistor. In the next images, <strong>two.sch</strong> is showing
1196 the <strong>footprint</strong> attribute visible to emphasize it, and it also
1197 shows a new symbol for the 2N3904 which I created from my
1198 custom <strong>npn-ebc.sym</strong> as described in my transistor guide.
1199 In the updated board.pcb layout,
1200 if you compare the outline appearance of the transistor to the original
1201 layout you see that the orientation is now correct and that silk layer
1202 lines don&#039;t overlap the solder pads.
1203 I also changed the <strong>footprint</strong> attribute for
1204 resistors R102 and R103 in <strong>one.sch</strong> to my custom
1205 1/8 watt <strong>R0w8</strong> and 1/4 watt <strong>R0w4</strong> elements to
1206 illustrate the differences in style you can have with
1207 custom elements. You can also see the R101 style after its
1208 footprint was changed to <strong>0.125W_Carbon_Resistor</strong> as suggested
1209 above. As you evaluate the differences in these styles, I&#039;ll mention
1210 that for my custom elements I wanted to maximize room to display
1211 value and refdes text (the 0.125W… element body could be a little
1212 larger) and I wanted the solder pad diameter a little larger
1213 so it will be more forgiving of board fabrication technique.
1214 Also, the resistor pin spacing for my <strong>R0w4</strong> is slightly less
1215 than in <strong>R025</strong> to improve component density.
1216 </p>
1219 <a href="media/geda/two-sch-2.png" class="media" target="_blank" title="geda:two-sch-2.png"><img src="media/geda/two-sch-2.png" class="medialeft" title="two.sch" alt="two.sch" /></a> <a href="media/geda/board-6.png" class="media" target="_blank" title="geda:board-6.png"><img src="media/geda/board-6.png" class="mediaright" title="pcb" alt="pcb" /></a>
1220 </p>
1222 </div>
1223 <!-- EDIT12 SECTION "Custom file elements" [36846-43272] -->
1224 <h2 class="sectionedit13" id="custom_m4_elements">Custom m4 elements</h2>
1225 <div class="level2">
1228 First, some words about how to find out about
1229 the default <strong>m4 elements</strong>
1230 available in PCB. I think there is some documentation forthcoming
1231 in the PCB project, but at this point I don&#039;t know of anything
1232 to refer you to
1233 and you can&#039;t just look at filenames as you can for
1234 the <strong>file elements</strong>. Not only that, but many of these elements
1235 require arguments and you need to determine what they are.
1236 So for now all I can say is that the best
1237 way to find out what&#039;s available is to read the m4 element files and
1238 for this you need to know where the PCB
1239 m4 files install location is. As of PCB 20031113 this install
1240 directory will most likely be <strong>/usr/share/pcb/m4</strong> or
1241 <strong>/usr/local/share/pcb/m4</strong>, while on earlier PCB versions it could be
1242 <strong>/usr/X11R6/lib/X11/pcb/m4</strong> (run <em>gsch2pcb --help</em> or
1243 <em>gsch2pcb -v project</em> to see which of these directories gsch2pcb
1244 is using). But if your install is somewhere else you will
1245 have to track it down. By the way, if the m4 directory <em>is</em> somewhere
1246 different from the above three, then gsch2pcb won&#039;t be finding your
1247 <strong>m4 elements</strong> in the above examples and you will need to add
1248 the correct m4 directory to your <strong>project</strong> file with a line like:
1249 </p>
1250 <pre class="code">m4-pcbdir /path/to/pcb/m4</pre>
1253 Just read the <strong>.inc</strong> files in the m4 install directory. For
1254 example, in the <strong>misc.inc</strong> file you will find the <strong>R025</strong> element
1255 we&#039;ve used and it starts out with:
1256 </p>
1257 <pre class="code"># -------------------------------------------------------------------
1258 # the definition of a resistor (0.25W) package
1259 # $1: canonical name
1260 # $2: name on PCB
1261 # $3: value
1262 define(`PKG_R025&#039;,
1263 `Element(0x00 &quot;$1&quot; &quot;$2&quot; &quot;$3&quot; 120 30 0 100 0x00)
1265 ...</pre>
1268 The information you can extract from this is that a m4 <strong>PKG_</strong> macro
1269 named <strong>R025</strong> is being defined and it takes 3 arguments. Now, all PCB
1270 <strong>m4 element</strong> macros take at least three
1271 arguments and these are automatically
1272 filled in by gsch2pcb with the gschem attributes <strong>footprint</strong> for
1273 <strong>canonical name</strong>, <strong>refdes</strong> for <strong>name on PCB</strong>, and
1274 <strong>value</strong> for <strong>value</strong>. The “canonical name” used in these
1275 m4 files is just an older way of referring to the current PCB usage of
1276 <strong>description</strong> as mentioned above in the <strong>Terminology</strong> section.
1277 Since these args are automatically filled in, you don&#039;t need to specify
1278 any additional args to <strong>R025</strong> when you use it as a gschem
1279 <strong>footprint</strong>. But now look at the very next m4 element define
1280 in <strong>misc.inc</strong>:
1281 </p>
1282 <pre class="code"># -------------------------------------------------------------------
1283 # the definition of a SIL package without a common pin
1284 # $1: canonical name
1285 # $2: name on PCB
1286 # $3: value
1287 # $4: number of pins
1288 define(`PKG_SIL&#039;,
1289 `define(`MAXY&#039;, `eval(`$4&#039; * 100 -50)&#039;)
1290 Element(0x00 &quot;$1&quot; &quot;$2&quot; &quot;$3&quot; 160 10 3 100 0x00)
1292 ...</pre>
1295 From this you can determine there is a <strong>SIL</strong> package you can use
1296 as a <strong>footprint</strong>. It has 4 arguments, but only the first three are
1297 handled automatically so there is one argument you must give when using it.
1298 You get a flash of insight and realize this is a “Single In Line” package!
1299 So, instead of the <strong>CONNECTOR 2 1</strong> element specifying 1 column we used
1300 in our example above, you might think we could have used <strong>SIL 2</strong>.
1301 But you would be wrong! Because if you read the macro body you will see
1302 that if the argument is <strong>2</strong> the second forloop can&#039;t handle it.
1303 In fact, it will only work for arguments &gt;= 4. If you ever run gsch2pcb
1304 and it appears stuck in an infinite loop, a m4 macro argument problem
1305 is likely the cause. As you look through <strong>misc.inc</strong> here&#039;s a summary
1306 of what you will find as possible elements you can use:
1307 </p>
1308 <pre class="code">Package Args you need to supply
1309 SD 1 number of pins of a ZIP package
1310 MULTIWATT15 0
1311 R025 0
1312 SIL 1 number of pins (we know now must be &gt;= 4)
1313 CSIL 1 number of pins
1314 QFP132 0
1315 LED 1 diameter of LED
1316 DIODE_LAY 1 pin separation
1317 AXIAL_LAY 1 pin separation
1318 CRYSTAL 1 package width
1319 OSC 0
1320 ISA8 0
1321 OVEN_OSC 0
1322 RADIAL_CAN 1
1323 SMD_BASE 2 length and width of surface mount device
1324 SMD_CHIP 1 package length</pre>
1327 And so on for the other <strong>.inc</strong> files…
1328 </p>
1331 The reality is that the m4 setup is less user friendly (you can&#039;t create
1332 the elements graphically) and more complicated (you need to understand
1333 m4 macros) than the simple
1334 <strong>file element</strong> approach. So for most of your custom elements I
1335 suggest you are better off staying with <strong>file elements</strong>. However,
1336 with the m4 macro method a single element
1337 definition that takes arguments gives you a programmable
1338 element which can be very useful for large pin count packages.
1339 It is particularly nice for IC packages with variable widths
1340 and number of pins, so a good example
1341 of using a custom <strong>m4 element</strong> would be to copy and modify to
1342 our taste the existing
1343 m4 macro for IC packages (the <strong>DIL</strong> macro) into a m4 file gsch2pcb
1344 will search. The destination m4 file can be any of these:
1345 </p>
1346 <ul>
1347 <li class="level1"><div class="li"> <strong>pcb.inc</strong> in our <strong>myproject1</strong> directory and the custom element will be local to this project.</div>
1348 </li>
1349 <li class="level1"><div class="li"> <strong>~/.pcb/pcb.inc</strong> and the element will be known to all of our projects.</div>
1350 </li>
1351 <li class="level1"><div class="li"> <strong>/path/to/anyfile</strong> if this path is made known to gsch2pcb by adding a line to a project file like: <pre class="code">m4-file /path/to/anyfile</pre>
1354 Depending on whether you want the file known only to this project, to all of your projects, or to all projects of all users, this line may be added to any of the project files:
1355 </p>
1356 <pre class="code">~/gaf/myproject1/project
1357 ~/.gsch2pcb
1358 /usr/local/etc/gsch2pcb
1359 /etc/gsch2pcb</pre>
1360 </div>
1361 </li>
1362 </ul>
1365 For this tutorial, I&#039;ll use the first <strong>pcb.inc</strong> way, so copy over
1366 the existing macro file:
1367 </p>
1368 <pre class="code">cd /usr/local/share/pcb/m4 (or /usr/share/pcb/m4 or /usr/X11R6/lib/X11/pcb/m4)
1369 cp dil.inc ~/gaf/myproject1/pcb.inc
1370 cd ~/gaf/myproject1</pre>
1373 Now, edit the <strong>pcb.inc</strong> file you just copied and cut everything
1374 out except for the PKG_DIL macro. Change the name of
1375 the package to something like PKG_DILFAT because the change we&#039;ll make
1376 will be to make larger diameter pins. Actually, we could leave the name
1377 alone and our new definition would override the old one, but for now
1378 let&#039;s go with the new name. Change the pin diameter from <strong>60</strong>
1379 to <strong>70</strong> on the <strong>PIN</strong> lines.
1380 When done, this should
1381 be the entire contents of the new <strong>pcb.inc</strong> file:
1382 </p>
1383 <pre class="code"># -------------------------------------------------------------------
1384 # the definition of a dual-inline package N and similar types
1385 # $1: canonical name
1386 # $2: name on PCB
1387 # $3: value
1388 # $4: number of pins
1389 # $5: package size (300, 600, 900 + 100 for socket space)
1391 define(`PKG_DILFAT&#039;,
1392 `define(`MAXY&#039;, `eval(`$4&#039; / 2 * 100)&#039;)
1393 define(`MAXX&#039;, `eval(`$5&#039; + 100)&#039;)
1394 define(`CENTERX&#039;, `eval(MAXX / 2)&#039;)
1395 Element(0x00 &quot;$1&quot; &quot;$2&quot; &quot;$3&quot; eval(CENTERX + 20) 100 3 100 0x00)
1397 forloop(`i&#039;, 1, eval($4 / 2),
1398 `PIN(50, eval(i * 100 -50), 70, 28, i)
1399 &#039;)
1400 forloop(`i&#039;, 1, eval($4 / 2),
1401 `PIN(eval(MAXX -50), eval(MAXY - i * 100 +50), 70, 28, eval(i + $4/2))
1402 &#039;)
1403 ElementLine(0 0 0 MAXY 10)
1404 ElementLine(0 MAXY MAXX MAXY 10)
1405 ElementLine(MAXX MAXY MAXX 0 10)
1406 ElementLine(0 0 eval(CENTERX - 50) 0 10)
1407 ElementLine(eval(CENTERX + 50) 0 MAXX 0 10)
1408 ElementArc(CENTERX 0 50 50 0 180 10)
1409 Mark(50 50)
1410 )&#039;)</pre>
1413 Run <strong>gschem one.sch</strong> and edit the <strong>footprint</strong> attribute of
1414 the opamps to be <strong>DILFAT 8 300</strong>.
1415 Then run <strong>gsch2pcb project</strong>
1416 and gsch2pcb will remove the <strong>DIL</strong> element from <strong>board.pcb</strong>
1417 and add into <strong>board.new.pcb</strong> a new <strong>DILFAT</strong> element from your
1418 custom m4 file <strong>pcb.inc</strong>. Run <strong>pcb board.pcb</strong> and
1419 load the <strong>board.new.pcb</strong> into
1420 your layout. Move the new element with its fatter pins to the location
1421 left vacant by the removal of the old element.
1422 </p>
1424 </div>
1425 <!-- EDIT13 SECTION "Custom m4 elements" [43273-50933] -->
1426 <h2 class="sectionedit14" id="multi-user_setup">Multi-user Setup</h2>
1427 <div class="level2">
1430 The above examples are oriented towards a single user with projects and
1431 custom gschem and PCB libraries under his home directory. Here&#039;s a
1432 way to set up for multiple users who need to share resources:
1433 </p>
1434 <ul>
1435 <li class="level1"><div class="li"> Put site wide custom PCB <strong>file elements</strong> under, for example, <strong>/usr/local/share/pcb/pcb-elements</strong>. Make this directory searched by gsch2pcb for all users by putting a line into <strong>/etc/gsch2pcb</strong> or <strong>/usr/local/etc/gsch2pcb</strong>:<pre class="code">elements-dir /usr/local/share/pcb/pcb-elements</pre>
1438 If there are any site wide custom PCB <strong>m4 element</strong> files, for example, <strong>/usr/local/share/pcb/pcb.inc</strong>, add another line into <strong>/etc/gsch2pcb</strong> or <strong>/usr/local/etc/gsch2pcb</strong>:
1439 </p>
1440 <pre class="code">m4-file /usr/local/share/pcb/pcb.inc</pre>
1441 </div>
1442 </li>
1443 <li class="level1"><div class="li"> If the default PCB m4 install is not <strong>/usr/local/share/pcb/m4, /usr/share/pcb/m4,</strong> or <strong>/usr/X11R6/lib/X11/pcb/m4</strong>, then make the install location known to all users of gsch2pcb by putting into <strong>/etc/gsch2pcb</strong> or <strong>/usr/local/etc/gsch2pcb</strong> the line:<pre class="code">m4-pcbdir /path/to/pcb/m4</pre>
1446 If the m4 program is gm4 instead of m4, add to the gsch2pcb file:
1447 </p>
1448 <pre class="code">m4-command gm4</pre>
1449 </div>
1450 </li>
1451 <li class="level1"><div class="li"> If there are site wide custom gschem symbols under some directory, you will have to edit the <strong>system-gafrc</strong> file and add <strong>component-library</strong> lines for them.</div>
1452 </li>
1453 </ul>
1456 With the above, users will have access to site wide libraries
1457 and only need to put in a design <strong>project</strong> file
1458 lines for <strong>schematics</strong> and <strong>output-name</strong>. But they
1459 also are free to have their own additional user and/or project
1460 specific symbol and element libraries.
1461 </p>
1463 </div>
1464 <!-- EDIT14 SECTION "Multi-user Setup" [50934-52519] -->
1465 <h2 class="sectionedit15" id="pc_board_fabrication">PC Board Fabrication</h2>
1466 <div class="level2">
1469 The tutorial should cover pcb fabrication too.
1470 </p>
1472 </div>
1474 <h5 id="photo-lithography">Photo-lithography</h5>
1475 <div class="level5">
1478 Use File→Export layout→ps to make a postscript file suitable for printing
1479 on a transparency. Note the presence of the &#039;mirror&#039; and &#039;ps-invert&#039; options
1480 which you may need depending on your process.
1481 </p>
1484 Open the ps file and print only the pages that you will actually need for
1485 fabrication. There are a large number of pages here, many of which you may
1486 not need.
1487 </p>
1490 If you find that your pads and traces don&#039;t print on the same page, or are
1491 placed on the wrong side you need to check the settings under File→Preferences→Layers
1492 to group the layers appropriately and place them on the correct side.
1493 </p>
1495 </div>
1497 <h5 id="machining">Machining</h5>
1498 <div class="level5">
1501 <a href="http://www.lpkf.com" class="urlextern" title="http://www.lpkf.com" rel="nofollow">LPKF</a> (and probably other companies) have a pcb plotting machines that accept gerber files.
1502 These files can be produced by choosing File→Export Layout→gerber which produces a large number of files. The files
1503 can be viewed using <a href="http://geda.seul.org/tools/gerbv/index.html" class="urlextern" title="http://geda.seul.org/tools/gerbv/index.html" rel="nofollow">gerbv</a> and the visualization saved. Once you are satisfied with the output gerber files just
1504 hand them off to whomever controls the pcb plotting machine and wait for the boards to be completed!
1505 </p>
1507 </div>
1508 <!-- EDIT15 SECTION "PC Board Fabrication" [52520-] --></body>
1509 </html>