Table of Contents

gEDA

Installation

– For Debian the installation is very easy

aptitude install geda-gschem geda-symbols geda-utils geda-gnetlist pcb geda-xgsch2pcb git
  1. After installation, copy your library folder into your “home directory”.
  2. Create the .gEDA directory in your home if it does not yet exist
  3. Create ~/.gEDA/gschemrc

Configuration

At bolay.co, we use our internal library. We didn't need to install them system wide. We prefere to add the library for each project as a git sub-module, referring to the exact version of library that match this project.

Create a new project

  mkdir ~/Projects
  cd ~/Projects
  mkdir mynewproject
  cd mynewproject
  git init
  git submodule init
  git submodule add git@git.bolay.co:gEDA_library.git Libs
  cp Libs/Config/gitignore .gitignore
  ./Libs/install.sh

When cloning a project from git.bolay.co, don't forget to do:

  git clone git@git.bolay.co:MyProject.git
  git submodule init
  git submodule update
 
  git pull origin <branch>  

Or

  git clone --rerursive git@git.bolay.co:MyProject.git
  cd MyProject
  git pull origin <branch>

When you want to modify a libray:

  ./Libs/install.sh
  cd Libs/
  git checkout origin/develop # Don't forget
 
  # Do something
  git commit -am "Message like Add DS18B20.sym"
  git push # Don't forget
  cd ..
  git commit -am "Update gEda Library"
 

Create Symbol

  1. Open “gschem” (Editeur de schémas gEDA)
  2. Select the board with the mouse and click “delete”
  3. Add → Pin (Rename it whit a correct name)
  4. Add → Box
  5. With this “options” you can create which symbol you want
  6. “Right Click” on the grill → Add atribute → Select footprint(boîtier), device (Description) and refdes (U?,D?,Q?) to give a name
  7. Select all the component : Edit → Symbol translate → The number is 0 because it's an original component
  8. File → Save as → el3/library/gschem-sym/… (Rename it COMPONENT.sym)
  9. Close gschem
  10. Your component is created

Attributes on Schematic

Prefix Component type
R Resistor
RN Resistor Network
FB Ferrite Bead
L Inductor
C Capacitor
B Battery
F Fuse
J Connector
P Connector (usually plugs that mate with J<n>)
K Relay
S Switch
T Transformer
TP Testpoint
M Motor
D Diode
Q Transistor
U Integrated circuits
X Crystal (Quartz)

Example for netname

Prefix Name
in Input
out Output
io Input/Output
oc Open collector
oe Open emitter
pas Passive
tp Totem pole
tri Tristate (High impedance)
clk Clock
pwr Power/Ground

Then, this attribute will be used from the DRC and netlisting.

Add and edit attributes via Gattribs

With geda it's too easily to edit or add attributes. First you open your gsch2pcb and add the schematic. Then you click on edit attributes.

Now click on edit attributes

There's the famous program.

Now you can edit, add and delete attributes with the “Edit” Options in the top of the program. If you want to the attributes be invisible in the schematic, use the “Visibility” options. It's too easily too understand.

Change title block at start up

el3@bolay:~$ vim ~/.gEDA/gschemrc

(define default-titleblock “Name_of_your_Titleblock.sym”)

Your titleblock must be in the good repertories

Refdes automatically numbered

el3@bolay:~$ vim ~/.gEDA/gschemrc

Note: Starting with version 1.2 of gschem the name of the path variable has changed:

U2, U4, U6… It will be correct in the future

Create Footprint

  1. Open “PCB Designer”
  2. Select the “impression” face
  3. Create the component with line, arc and vias
  4. When you do a line : at the top right of your program you can see the longer of your line
  5. To give a name to your vias select him and use “n” and rename it
  6. Your component is finish ?
  7. Select all the component : Select → Convert the selection on element (Convertir la sélection en élement)
  8. Click on a pin or on the component
  9. Buffer → Cut the selection on tampon (Couper la sélection dans le tampon)
  10. Buffer → Save the element of the tampon on a file (Sauvegarder les élements du tampons dans un fichier)
  11. Your component must be save at el3/library/pcb-elements/…
  12. File → Save as el3/library/pcb-elements/…
  13. You have two copies of the component
  14. Your component is created
Be careful to create a SMD footprint :

First create your component, you can use the circle to be faster and create the “big pad”.

Select your component and : Select → Convert the selection on element. Then you can modify the file with gedit to have the pad rectangular :

Element["" "" "" "" 100079 67850 0 0 0 100 ""]
Pad[8316 160 15718 160 4000 2000 6000 "" "2" "square"]
Pad[-16731 167 -9329 167 4000 2000 6000 "" "1" "square"]
ElementLine [-16851 14276 -14646 16481 1000]
ElementLine [-16850 -13992 -14646 -16196 1000]
ElementLine [15827 -16196 15827 16481 1000]
ElementLine [15827 16481 -14646 16481 1000]
ElementLine [-16851 14276 -16851 -13992 1000]
ElementLine [-14646 -16196 15827 -16196 1000]

With “square” your pad will be rectangular. The modification has made with gedit.

For more information, please visit : http://www.brorson.com/gEDA/land_patterns_20070818.pdf or another link for the same doc https://github.com/evanfarrar/opensprints/raw/0b994c2b6b539b8a3beab4ea42a6447f10e396a3/hardware/interface_board/geda/docs/land_patterns_20070818.pdf

Schematic to PCB

  1. Open gschem and create your schematic
  2. When your schematic is finished save it at a new folder
  3. Close the program
  4. Make a “Liens symbolic” :
  5. Open the terminal
  6. cd /AAA/BBB/NAME_OF_REPERTORIES
  7. ln -s /home/el3/library/PCB-elements packages (PACKAGES MUST BE AT THE END)
  8. You have create a “Liens symbolic”
  9. Cf : Chapter : Add libraries to a single PCB project
  10. Click right on your schematic and open with “gEDA Schematic to PCB Project”
  11. Add your schematic and click update layout
  12. If there is an footprint error you have make an error
  13. If there isn't any error, you can start your PCB.

If the first solution does not work, try this:

  1. Open the terminal
  2. cd /AAA/BBB/YOUR_FOLDER (Folder where your schematic is located)
  3. gsch2pcb -d /AAA/BBB/YOUR_SCHEMATIC.sch
  4. Now, a new file was created on your folder (YOUR_SCHEMATIC.pcb)
  5. Run the .pcb and it's done

Sometimes, the netlist does not load:

  1. In the .pcb, select File→Load netlist file
  2. Search in your folder the .net
  3. Type o to optimise rat
  4. You can start route

Import the board on PCB

  1. Open the model with “gedit”
  2. Copy the layer 8 for the board :

Layer(8 “outline”)

(

Line[229994 203220 229994 33927 800 0 ""]
Line[35059 228756 204404 228810 800 0 ""]
Line[35112 8338 204404 8337 800 0 ""]
Line[204404 8337 229994 33927 800 0 ""]
Line[204404 228810 229994 203220 800 0 ""]
Line[9522 33928 9522 203219 800 0 ""]
Line[9522 203219 35059 228756 800 0 ""]
Line[9522 33928 35112 8338 800 0 ""]

)

  1. Now open your pcb with “gedit” and paste that instead layer 8
  2. Save that and open and the board is on your PCB !
  3. You can too copy the layer 9 for the text for example

Documentation

On debian you can read a lot of useful information directly from the installation doc files.

/usr/share/doc/pcb-common/

.
├── changelog.Debian.gz
├── changelog.gz
├── copyright
├── examples
│   ├── LED
│   ├── LED2
│   ├── LED.NET
│   ├── libraries
│   │   ├── example.inc
│   │   ├── example.list
│   │   └── example.m4
│   └── tut1.pcb
├── NEWS.gz
├── pad.png
├── pcb.html
├── pcb.pdf.gz
├── puller.png
├── refcard.dvi.gz
├── thermal.png
└── Whats_new_in_2.0.gz

Here you can especially read pcb.pdf.gz. And you can also print this useful refcard

Add libraries to a single PCB project

To add PCB components to your project use the following method to add a folder to your libraries :

  1. Open a terminal
  2. use the cd command line to access your project directory
  3. Once you are in your projet's directory, use the “ln -s” command to link a folder as library to your project
  4. Now open or re-open your project and all components must have been added to your library

In the following example, our project is in : ~/home/dzuf/pcb_project/project_test

and our folder path is : ~/home/dzuf/pcb_library

So, we open a terminal and write the following lines :

1.
cd /home/dzuf/pcb_project/project_test
2.
ln -s ../../pcb_library packages

Now the folder “pcb_library” has been added to our project library

Please note that this method only works for the folder on which the project is. If you want to add the library to another project, you will need to repeat the previous operations !

Verifying your symbols

Before using a symbol in geda, it may be useful to check if there aren't any error. Run gsymcheck -vv over the symbol you want to control.

gsymcheck -vv component_name.sym

If any errors occures, you can correct them directly by using the terminal.

  1. Move to the component directory with terminal
  2. Then use the vi text editor over the symbol
vi component_name.sym

Pin types

In gEDA, there are pre-defined pin types, so be sure to use them, otherwise gsymcheck won't accept them.

You'll find those types by following the link “geda attributes”, then go to page 7.

Sending components to the bottom of the board

To send single component to the bottom of the board :

To send multiples components to the bottom :

  1. Select the components you want to send to the bottom
  2. Press the “maj+b” key
To resend components to the top, repeat the previous operations
If your components disappear when you send them to the bottom, verify that the “far side” button is activated !

Send tracks to another layer

To send one single track segment to another layer, select the layer, then with the mouse over your track's segement, press the “m” key.

To send multiple track's segements to another layer, select the layer, select the segments, then press “shift+m”.

Edit a component

Open your component file with PCB Designer. Select all your component, copy it into the buffer with “ctrl+c” or “ctrl+x”. Select Buffer in the toolbar, click to Break buffer elements to pieces and Paste buffer to layout or “ctrl+v”. Now you can edit your component. Don't forget to give a name to all pad with “n”.

If you want to convert your component into a single element, select all your component , copy it into the buffer. Select Buffer in the toolbar, click to Convert buffer to element and Paste buffer to layout. It's done, your component is edit.

Add a new footprint in your pcb

  1. Open the terminal
  2. cd /AAA/BBB/YOUR_FOLDER (Folder where your schematic is located)
  3. gsch2pcb -d /AAA/BBB/YOUR_SCHEMATIC.sch
  4. Run pcb on your file YOUR_SCHEMATIC.pcb
  5. Select File → Load layout data to paste buffer
  6. Select YOUR_SCHEMATIC.new.pcb to load your new footprint
  7. Select File → Load netlist file and select YOUR_SCHEMATIC.net
  8. Type o to optimize rat

PCB Tips

While routing your PCB, you may win some time by using the predefined hot-keys from PCB :

While routing, if you want to change layer, simply press the number associated to the layer. They are ranked from the top to the bottom :

If you want to replace the “REFDES” on PCB, you must click on nothing (Where there isn't any coamponent), press “f” and then take the “REFDES” with the mouse and you can place it where you wnt.

There's some useless keyboard shortcut on gEDA :

Plan de masse

Pour pouvoir créer un plan de masse ou de VCC, il suffit de tracer un rectangle.

En utilisant l'outil THRM et en cliquant sur des trous, cela va directement connecter le trou au plan.

Pour connecter directement une piste au plan, il faut décocher la case “New lines, arcs clear polygons” dans l'onglet Settings. Ainsi, lorsqu'on tracera une nouvelle piste, elle va se connecter toute seule au plan. Pour les anciennes pistes, il faudra les retracer, autrement elles ne seront pas connectées.

Attention: cochez à nouveau la case si vous refaites une piste qui ne doit pas être connectée au plan !

Create a build of material from shematics

Open the terminal and write this command :

Create a PS Schematic

You mustn't be a root when you write this command

Create a .zip with the terminal

Create a screen of your PCB

To create a screen and print it, you must export the layer :

File → Export layout → PNG

Check the “as-shown” options and write 1000 to the DIP. (Pixel)

Simulation with Gnucap and Gwave

With gnucap you can “export” your schematic and do a simulation. But you must add a netname to your connection. For example :

Here you can see we have add the netname attribute for some connections, the value attribute for the transistor and the voltage source are useful.

When your schematic is finish, open the terminal :

Important : “build” is used to modify or add for example an voltage source, “list” is used to see all your component, Links :

There's three very important links to understand how to use Gnucap.

You can use a script to be faster with Gnucap. Write on gedit the command you want use in the options of Gnucap. For example : That must be saved in the same folder of your project.

Then open your terminal :

If you want to have a simulation who looks better use Gnuplot :

After you have made the simulation write in the terminal :

There's a result with Gnuplot :

With the right-click you can do a measure easily.

Q/A

To add input/output in gschem, some problems can arise. If the gnelist is not able to make the connection between the input label and the output label, it is because you have probably misconfigured your input/output element. For an optimal configuration, you need to edit the component attribut, add the net attribut and then enter the label name.

Example

Your input label is connected to PortB of your uC. Double click the input, add the net, and insert XXXX:1 (replace X by the correct name, e.g PORTB:1)

Do not forget the :1 after the name, otherwise it will not work.

gschem2pcb with command line

gsch2pcb EdgeBoard_DS18B20.sch –elements-dir ../gEDA_library/PCB_elements/