User Tools

Site Tools


geda:gsch2pcb_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
geda:gsch2pcb_tutorial [2014/04/25 00:34]
vzh Fix a link
geda:gsch2pcb_tutorial [2017/08/10 19:12] (current)
fisichel Added "Add a ground plane" and "Add a via" sections to pcb
Line 114: Line 114:
  
 {{geda:​one-sch-1.png |one.sch}} Run **gschem one.sch** and create this schematic (the second opamp is redundant, but this is just a tutorial): {{geda:​one-sch-1.png |one.sch}} Run **gschem one.sch** and create this schematic (the second opamp is redundant, but this is just a tutorial):
-  * Open the select components dialog (type **i**)+  * Open the select components dialog (type <key>i</​key>​)
   * Make sure, the drop down menu at the bottom of the dialog is set to "​Default behavior - reference component"​.   * Make sure, the drop down menu at the bottom of the dialog is set to "​Default behavior - reference component"​.
   * Add the components:   * Add the components:
Line 120: Line 120:
     * From the **Input/​output** library one **output-2.sym**.     * From the **Input/​output** library one **output-2.sym**.
     * From the **Power rails** library one **gnd-1.sym**,​ two **vcc-1.sym** and two **vee-1.sym**     * From the **Power rails** library one **gnd-1.sym**,​ two **vcc-1.sym** and two **vee-1.sym**
-  * Move components with the middle mouse button and rotate selected components by hitting keys **er** ​until everything is placed nicely. Rotate the bottom opamp and mirror it with the **ei** ​keys. +  * Move components with the middle mouse button and rotate selected components by hitting keys <​key>​e</​key><​key>​r</​key> ​until everything is placed nicely. Rotate the bottom opamp and mirror it with the <​key>​e</​key><​key>​i</​key> ​keys. 
-  * Use the **n** key and the mouse to draw net connections.+  * Use the <key>n</​key> ​key and the mouse to draw net connections.
  
-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 [e - shift-L]. You can find title blocks with different sizes in the **Titleblocks** library. Remember, to lock the new title block with [el] while the title block is selected.+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 <key>e</​key> ​<key>shift-l</​key>​. You can find title blocks with different sizes in the **Titleblocks** library. Remember, to lock the new title block with <​key>​e</​key><​key>​l</​key> ​while the title block is selected.
  
 ==== Edit the attributes of the components on the schematic ==== ==== Edit the attributes of the components on the schematic ====
-{{ geda:​one-sch-2.png|one.sch}} For each component, select it and bring up its attributes window by hitting keys **ee**.  Do not edit the **refdes** attribute here, but do make these edits:+{{ geda:​one-sch-2.png|one.sch}} For each component, select it and bring up its attributes window by hitting keys <​key>​e</​key><​key>​e</​key>​.  Do not edit the **refdes** attribute here, but do make these edits:
   * For resistors and the opamps, add visible **value** 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.   * For resistors and the opamps, add visible **value** 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.
   * For the resistors, add a **footprint** attribute and give it the value **R025** which is the PCB //m4 element// for a 1/4 watt resistor. ​ Make this attribute invisible.   * For the resistors, add a **footprint** attribute and give it the value **R025** which is the PCB //m4 element// for a 1/4 watt resistor. ​ Make this attribute invisible.
Line 139: Line 139:
 attribute default that covers most of your uses.  Or, when you add your attribute default that covers most of your uses.  Or, when you add your
 first component, edit it to have a good footprint default and then copy it first component, edit it to have a good footprint default and then copy it
-(select it and hit the **ec** ​keys) for all+(select it and hit the <​key>​e</​key><​key>​c</​key> ​keys) for all
 remaining components instead of adding them from the library.\\ remaining components instead of adding them from the library.\\
  
Line 286: Line 286:
   * Do **Connects->​optimize rats-nest**. Now, the pins and pads of components should be connected with straight lines according to the  schematic. These are "​rats"​.   * Do **Connects->​optimize rats-nest**. Now, the pins and pads of components should be connected with straight lines according to the  schematic. These are "​rats"​.
  
-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 **optimize rats-nest** rats will make the rats jump to this "​better"​ geometry. This action can be applied conveniently anytime with a stroke of the key **o**.+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 **optimize rats-nest** rats will make the rats jump to this "​better"​ geometry. This action can be applied conveniently anytime with a stroke of the key <key>o</​key>​.
  
 === Place the Components === === Place the Components ===
-{{ geda:​board-4.png|Step 4}}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 **o**-key.+{{ geda:​board-4.png|Step 4}}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 <key>o</​key> ​key.
  
  
-Select the **ROT** tool (**F-9**) to move elements with the+Select the **ROT** tool (<​key>​F9</​key>​) to move elements with the
 middle mouse button and rotate them with the left mouse button. middle mouse button and rotate them with the left mouse button.
 The right mouse button will move the viewport to the canvas when zoomed in. The right mouse button will move the viewport to the canvas when zoomed in.
-Zoom in and out with the mouse wheel or alternatively with **z** and **Shift z**+Zoom in and out with the mouse wheel or alternatively with <key>z</​key> ​and <key>Shift-z</​key>​
-Hit the **f** key while the mouse hovers over a pin to highlight+Hit the <key>f</​key> ​key while the mouse hovers over a pin to highlight
 the particular that touches this pin to help visualize the routes. the particular that touches this pin to help visualize the routes.
-Use **Shift f** to unhighlight. You can undo changes anytime with the **u** key.+Use <key>Shift-f</​key> ​to unhighlight. You can undo changes anytime with the <key>u</​key> ​key.
  
 Note: you can use the PCB auto placement Note: you can use the PCB auto placement
Line 317: Line 317:
 (solder, component, etc), and start drawing lines by selecting (solder, component, etc), and start drawing lines by selecting
 endpoints with the left endpoints with the left
-mouse button. ​ Again, it can help to use the **f** key to highlight+mouse button. ​ Again, it can help to use the <key>f</​key> ​key to highlight
 routes that need to be connected. routes that need to be connected.
 If you want to stop the current trace so you can start If you want to stop the current trace so you can start
Line 332: Line 332:
 areas around or step and repeat common trace patterns. ​ To areas around or step and repeat common trace patterns. ​ To
 select multiple objects with the **SEL** tool, click and drag select multiple objects with the **SEL** tool, click and drag
-to select rectangular regions, and SHIFT click to toggle additional+to select rectangular regions, and <​key>​Shift</​key>​-click to toggle additional
 selections to the currently selected set. selections to the currently selected set.
  
Line 355: Line 355:
 //Use separate window for command entry// option, then when //Use separate window for command entry// option, then when
 you bring up the Command window with **Window->​Command Entry** you bring up the Command window with **Window->​Command Entry**
-(or the ':' ​key), you will see a **Command Reference** expander+(or the <key>:</​key> ​key), you will see a **Command Reference** expander
 arrow. ​ Click on the arrow and a command reference will be shown arrow. ​ Click on the arrow and a command reference will be shown
 which lists some commands you can type in that may not be available which lists some commands you can type in that may not be available
Line 369: Line 369:
 inconvenient to be changing the Preferences each time.  For this, inconvenient to be changing the Preferences each time.  For this,
 you can select some lines, you can select some lines,
-bring up the command window (hit '**:**') and type in the command:+bring up the command window (hit <key>:</​key>​) and type in the command:
 <​code>​ <​code>​
 changesize(selectedlines,​ +3, mils) changesize(selectedlines,​ +3, mils)
Line 379: Line 379:
  
  
-=== Looking ​at the other side of the board ===+=== Look at the other side of the board ===
 In some layouts it is important to put components on either side of In some layouts it is important to put components on either side of
 the board, although not for the preceding example. In such a case the board, although not for the preceding example. In such a case
-the 'tab' ​key can be used to flip the board over and view it from the +the <key>tab</​key> ​key can be used to flip the board over and view it from the 
-back while the 'b' ​key can be used to put a selected component on the+back while the <key>b</​key> ​key can be used to put a selected component on the
 other side of the board. other side of the board.
 On dual sided boards it is also important to note what side a particular On dual sided boards it is also important to note what side a particular
Line 392: Line 392:
 be fabricated in the same step (i.e. etched with photo-lithography) are grouped be fabricated in the same step (i.e. etched with photo-lithography) are grouped
 together. together.
 +
 +=== Add a Ground Plane ===
 +This section goes over how to add a ground plane. For this section, the top layer of the board looks like this:​\\ ​
 +{{geda:​170810_002_groundplane.png |top side}} \\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +If you haven'​t done so already, flip your board to the back side by pressing <​key>​tab</​key>​. You might have to move the vertical scroll bar to find your board. It's there. This is what it should look like:​\\ ​
 +{{geda:​170810_004_groundplane.png |back side}} \\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +{{geda:​170810_008_groundplane.png |bottom button}}Select the "​Bottom"​ layer from the left.\\ ​
 +\\ 
 +Use the {{geda:​170810_005_groundplane.png |RECT side}} rectangle (RECT) tool, click once in the upper left corner and then once again in the lower right corner.\\ ​
 +\\ 
 +{{geda:​170810_010_groundplane.png |rectangle}}\\ ​
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +PCB should fill in the area for you. Now, switch back to the top side using <​key>​tab</​key>​. You have just made a copper plane. We will make it a ground plane in the next section.\\ ​
 +\\ 
 +=== Add a via ===
 +Let'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. \\ 
 +\\ 
 +{{geda:​170810_013_via.png |Route styles button}}\\ ​
 +\\ 
 +\\ 
 +{{geda:​170810_014_via.png |Via button}} Next, click on the via button, and click above and between the unconnected pins on R102 and R201.\\ ​
 +\\ 
 +{{geda:​170810_015_via.png |via placement}}\\ ​
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +We will connect to this via using the line tool. \\ 
 +Click the "​Top"​ button to make the top layer active. \\ 
 +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. \\
 +The top side is connected.\\ ​
 +{{geda:​170810_016_via.png |via placement}}\\ ​
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +Now, we need to connect the bottom side to the via. Press <​key>​tab</​key>​ 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. \\ 
 +{{geda:​170810_017_via.png |select tool}}Using the select tool, click on the via annulus.\\ ​
 +\\ 
 +\\ 
 +{{geda:​170810_018_via.png |via placement}}\\ ​
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +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.\\ ​
 +{{geda:​170810_020_via.png |via placement}}\\ ​
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +The pins from the resistors are now connected to the plane you created earlier. You can click "​Top"​ and press <​key>​tab</​key>​ to get back to the top view of the board.\\
 +{{geda:​170810_022_via.png |via placement}}\\ ​
 +
  
 ===== Modifying Schematics ===== ===== Modifying Schematics =====
Line 432: Line 541:
 was installed). ​ PCB versions before 20031113 used **pcb_lib** instead was installed). ​ PCB versions before 20031113 used **pcb_lib** instead
 of **newlib** in the locations of **newlib** in the locations
-**/​usr/​local/​pcb_lib** or **/​usr/​lib/​pcb_lib,**.+**/​usr/​local/​pcb_lib**or **/​usr/​lib/​pcb_lib**.
 Once you find your **newlib** directory, Once you find your **newlib** directory,
 look at the file names in each subdirectory. ​ Each file name look at the file names in each subdirectory. ​ Each file name
Line 470: Line 579:
 have **net** attributes which can assign pins to a particular have **net** attributes which can assign pins to a particular
 net.  Instead of hooking up each opamp pin 8 to Vcc and pin 4 to net.  Instead of hooking up each opamp pin 8 to Vcc and pin 4 to
-to Vee on the schematic, we can have that happen automatically and+Vee on the schematic, we can have that happen automatically and
 eliminate the pins on the schematic. ​ To do this, just copy the eliminate the pins on the schematic. ​ To do this, just copy the
 original symbol to our custom gschem symbol directory, giving it original symbol to our custom gschem symbol directory, giving it
Line 482: Line 591:
 gschem opamp-dual.sym gschem opamp-dual.sym
 </​code>​ </​code>​
-  * Hit keys **en** ​to make attributes visible. +  * Hit keys <​key>​e</​key><​key>​n</​key> ​to make attributes visible. 
-  * Hit keys **ve** ​to view extents.+  * Hit keys <​key>​v</​key><​key>​e</​key> ​to view extents.
   * Left mouse click on pin 8 to select it.   * Left mouse click on pin 8 to select it.
  
Line 489: Line 598:
 {{geda:​gschem-sym-2.png |Step 2}} {{geda:​gschem-sym-2.png |Step 2}}
  
-  * Hit **Delete** key to delete pin 8.+  * Hit <key>Delete</​key> ​key to delete pin 8.
   * Similarly select and delete pin 4.   * Similarly select and delete pin 4.
   * Double click to select and edit the **slotdef** lines. ​ Edit them by removing the pins 4 and 8.   * Double click to select and edit the **slotdef** lines. ​ Edit them by removing the pins 4 and 8.
Line 495: Line 604:
 == Add global Nets to in Numbers == == Add global Nets to in Numbers ==
 {{geda:​gschem-sym-3.png |Step 3}}From the menu **Add->​Attribute** {{geda:​gschem-sym-3.png |Step 3}}From the menu **Add->​Attribute**
-  * Add a **net** attribute with value **Vcc:8** Select **Show Name &amp; Value** and make it invisible. +  * Add a **net** attribute with value **Vcc:8** Select **Show Name & Value** and make it invisible. 
-  * Add a **net** attribute with value **Vee:4** Make it **Show Name &amp; Value** and invisible.+  * Add a **net** attribute with value **Vee:4** Make it **Show Name & Value** and invisible.
   * Make the **device** attribute be just **OPAMP**.   * Make the **device** attribute be just **OPAMP**.
  
Line 509: Line 618:
  
 == Run gschem with the New Symbol == == Run gschem with the New Symbol ==
-{{geda:​one-sch-3.png |one.sch}} Run **gschem one.sch**. ​ Select and delete with the **Delete**+{{geda:​one-sch-3.png |one.sch}} Run **gschem one.sch**. ​ Select and delete with the <key>Delete</​key>​
 key both opamps. ​ Also delete the **Vcc** and **Vee** symbols that key both opamps. ​ Also delete the **Vcc** and **Vee** symbols that
 were connected to them.  Bring up the Add Components window were connected to them.  Bring up the Add Components window
Line 547: Line 656:
 [[geda:​gschem_symbol_creation|Symbol Creation Document]] on the [[geda:​gschem_symbol_creation|Symbol Creation Document]] on the
 [[geda:​documentation|gEDA Documentation]] page. [[geda:​documentation|gEDA Documentation]] page.
- 
- 
  
 ===== Custom file elements ===== ===== Custom file elements =====
Line 570: Line 677:
 {{geda:​pcb-el-1.png |Step 1}} {{geda:​pcb-el-1.png |Step 1}}
   * Select the **VIA** tool and place two vias 400 mils apart.   * Select the **VIA** tool and place two vias 400 mils apart.
-  * With the mouse on the left via, hit the **n** key and give the via the name **1**. ​ Give the right via the name **2**+  * With the mouse on the left via, hit the <key>n</​key> ​key and give the via the name **1**. ​ Give the right via the name **2**
   * Pin 1 will be the cathode and this must agree with the pin numbers in your diode gschem symbol.   * Pin 1 will be the cathode and this must agree with the pin numbers in your diode gschem symbol.
  
Line 588: Line 695:
 **Note:** if you save the element with a name which is the same **Note:** if you save the element with a name which is the same
 as a **m4 element**, gsch2pcb will preferentially use the m4 as a **m4 element**, gsch2pcb will preferentially use the m4
-element unless you give gsch2pcb the --use-files (or -f) option.+element unless you give gsch2pcb the %%--use-files%% (or -f) option.
 You may put **use-files** in a project file if you want to always You may put **use-files** in a project file if you want to always
 give priority to using **file elements**. ​ The m4 element names appear give priority to using **file elements**. ​ The m4 element names appear
Line 626: Line 733:
 in the less common (3,2,1) configuration while the **2N3904-1.sym** in the less common (3,2,1) configuration while the **2N3904-1.sym**
 is like a npn-ebc symbol which needs a (1,2,3) numbering. ​ You can is like a npn-ebc symbol which needs a (1,2,3) numbering. ​ You can
-see the 2N3904 pin numbers in gschem by hitting the **en** ​keys+see the 2N3904 pin numbers in gschem by hitting the <​key>​e</​key><​key>​n</​key> ​keys
 (and don't be confused by the **pinseq** attribute that nearly (and don't be confused by the **pinseq** attribute that nearly
 covers up the **pinnumber**). ​ And in PCB, you can see the **TO92** covers up the **pinnumber**). ​ And in PCB, you can see the **TO92**
-pin numbers by hitting the **d** key with the mouse over+pin numbers by hitting the <key>d</​key> ​key with the mouse over
 the element. ​ To be sure you are seeing pin numbers and not pin the element. ​ To be sure you are seeing pin numbers and not pin
 names, select **Screen->​pinout shows number**. names, select **Screen->​pinout shows number**.
Line 694: Line 801:
 directory will most likely be **/​usr/​share/​pcb/​m4** or directory will most likely be **/​usr/​share/​pcb/​m4** or
 **/​usr/​local/​share/​pcb/​m4**,​ while on earlier PCB versions it could be **/​usr/​local/​share/​pcb/​m4**,​ while on earlier PCB versions it could be
-**/​usr/​X11R6/​lib/​X11/​pcb/​m4** (run //gsch2pcb --help// or+**/​usr/​X11R6/​lib/​X11/​pcb/​m4** (run //%%gsch2pcb --help%%// or
 //gsch2pcb -v project// to see which of these directories gsch2pcb //gsch2pcb -v project// to see which of these directories gsch2pcb
 is using). ​ But if your install is somewhere else you will is using). ​ But if your install is somewhere else you will
geda/gsch2pcb_tutorial.1398400487.txt.gz · Last modified: 2014/04/25 00:34 by vzh