Table of Contents

Usage de Gschem

Comment je déplace un composant?

Les nouveaux avec une longue expérience de Windows posent souvent cette question. Vous avez trois manières de déplacer facilement des composants avec gschem:

Un:

  1. Attrapez le composants avec le bouton de souris du milieu. Le composant suivra le curseur où vous l’emmenez.
  2. Pour placer le composant, relachez le bouton du milieu de la souris. Le composant restera où vous l’avez placé.

Deux:

  1. Sélectionnez le composant en cliquant dessus avec le bouton gauche de la souris. Le composant sera mis en valeur.
  2. Appuyez sur la touche « M » du clavier. Le composant suivra le curseur où vous l’emmenez.
  3. Pour placer le composant, cliquez le bouton gauche de la souris. Le composant restera où vous l’avez placé.

Trois:

  1. Sélectionnez le composant en cliquant dessus avec le bouton gauche de la souris. Le composant sera mis en valeur.
  2. Cliquez sur le bouton droit de la souris. Un menu déroulant apparaîtra.
  3. Avec le bouton gauche de la souris, cliquez sur l’option « move » du menu déroulant.
  4. Cliquez sur le composant avec le bouton gauche de souris. Le composant suivra maintenant le curseur où vous le déplacez.
  5. Pour placer le composant, cliquez sur le bouton gauche de souris. Le composant restera là où vous l’avez placé.

Comment je change la taille du texte sur un symbole?

  1. Sélectionnez le symbole.
  2. Clic droit → down symbol (ou faites Hierarchy → down symbol). Ceci vous mène à l’éditeur de symbole.
  3. Sélectionnez le pinnumber que vous voulez changer.
  4. Faites Edit → Edit Text (ou tapez le raccourci clavier « ex »).
  5. Changez la taille de police dans la boîte déroulante.
  6. Recommencez pour tous les éléments de textes désirés.
  7. Fichier → sauvegarde
  8. Clic droit → up (ou Hierarchy → Up). Vous êtes maintenant retourné à l’éditeur de schéma.
  9. Avez le symbole encore sélectionné, faites Edit → Update component (ou utilisez le raccourci clavier « ep »). Si cela ne fonctionne pas, effacez simplement le symbole et rechargez-le.

Plus généralement, vous pouvez utiliser cette procédure pour éditer n’importe quoi sur un symbole. (Substituez « Edit Text » pour votre édition souhaitée, bien sûr.)

Comment dévérouiller un composant

Lorsqu’un composant est véroullé, il est insélectionnable en utilisant le bouton milieu de la souris mais il est néanmoins sélectionnable en utilisant une sélection de fenêtre. Pour une sélection de fenêtre sur un composant, cliquez et maintenez avec le bouton gauche de souris et tirez pour créer une région rectangulaire contenant le composant devant être dévérouillé. Exécutez la commande Edit unLock pour dévérouiller le composant.

Comment refdes peut-il être automatiquement numéroté lorsque je dessine un schéma?

Éditez le fichier system-gschemrc ou placez ce qui suit dans le fichier gschemrc (soit ~/.gEDA/gschemrc ou un fichier gschemrc dans le répertoire local d’où vous invoquez gschem):

(load "$YOUR_INSTALL_PATH/share/gEDA/scheme/auto-uref.scm")  ; load the autonumbering script
(add-hook! add-component-hook auto-uref)                     ; autonumber when adding a component
(add-hook! copy-component-hook auto-uref)                    ; autonumber when copying a component

Veuillez substituer $YOUR_INSTALL_PATH par le chemin d’installation de geda.

Que sont les Liaisons de Touches dans gschem?

Quelles sont les liaisons avec la souris dans gschem?

Par défaut, vous avez:

Vous pouvez changer le bouton milieu en ajoutant ce qui suit à un fichier gschemrc:

(middle-button "action")   ;default binding, move or copy an object

ou:

(middle-button "stroke")   ;draw mouse gestures/strokes (must install libstroke to enable

ou:

(middle-button "repeat")   ;repeat the last command executed

Vous pouvez changer le bouton droit en ajoutant ce qui suit dans un fichier gschemrc:

(third-button "popup")     ;default binding, show a popup menu

ou:

(third-button "mousepan")  ;use the mouse to pan around the schematic

Pour plus informations sur ces options, veuillez aller voir le fichier ${install_prefix}/share/gEDA/system-gschemrc.

Symboles gschem

What's this business about heavy vs. light symbols?

This nomenclature arose from a discussion which frequently appears on the geda-user and geda-dev mailing lists. A light symbol is one which contains very few built-in attributes in the symbol itself. It requires that the user attach almost all attributes at the schematic level (e.g. using either gschem or gattrib). A heavy symbol is one which contains many attributes (such as package footprints, SPICE model names, etc.) built into the symbol file itself. A heavy symbol therefore requires very little attribute attachment at the schematic level – you just place it and you’re done.

The debate between proponents of heavy and light symbols is very detailed and involved. In caricature, proponents of heavy symbols belive that they provide better integration between gschem and PCB since the important layout attributes (such as footprint name) are already built into the symbol. This is considered a good thing for new users (noobs) who just want to design a simple board and don’t appreciate or don’t care about the zillions of variations that even a simple resistor might have (e.g. different footprint, TCR, precision, material composition, etc). Proponents of light symbols prefer to deal with attributes at the schematic level because they believe it to be more flexible. They are quick to point out that a library of heavy symbols will quickly grow into the thousands of parts with grotesquely long names trying to distinguish between the different variations of the part. They also point out that the utility “gattrib” is the preferred tool for dealing with attributes at the schematic level (i.e. in the .sch file).

GEDA/gaf, as default configured, uses light symbols, although it can be configured to use heavy symbols. For further information, you may read these dicussions from the geda-user mailing list:

http://archives.seul.org/geda/user/Jun-2005/msg00001.html http://archives.seul.org/geda/dev/Oct-2005/msg00043.html

I am using a symbol out of the library. How come it's not aligned to the grid?

The symbols in the symbol library, like those available at the gedasymbols website are contributed by users just like you. Some people use different grid settings than other people (e.g. 50mil vs. 100mil). If you discover a symbol which seems to be off the grid, try reducing your grid spacing, move the symbol so that it sits on your grid, then revert to your preferred grid settings.

Yes, the gEDA docs suggest that you use a 100mil grid spacing. But everybody likes to do things their own way, and there is no overall symbol dictator to enforce the rules on contributed symbols. Therefore, you just need to be aware of this possibility.

Is there an explicit "no connect" symbol that I can/should place in the schematic to prevent gnetlist from thinking I've forgotten a connection?

Answer: misc → nc-left, nc-right, nc-top, nc-bottom.

Caution: occassionally this may create a net called “no_connect” (or “NC??”) which may lead to no-connect pins being connected together in gnetlist – which you probably _don’t_ want to happen.

If you want an entire symbol to be graphical (no elec. connections) , add a “graphical=1” attribute. The netlister will ignore these symbols entirely.

How do I promote an invisible symbol attribute into the schematic?

Most attributes living in the symbol do not get promoted to the schematic unless they are visible. To promote invisible symbol attributes, look for the following keywords in the system-gschemrc file:

(attribute-promotion “enabled”);
(promote-invisible “disabled”) ; ⇐ This one
(keep-invisible “enabled”)

Add to your gschemrc file:

(promote-invisible “enabled”)

and you will get all the attributes promoted. The “keep-invisible” keyword will keep hidden those attributes that are hidden in the symbol file.

What should I do about power pins on my symbols: Make them visible (explicit) or invisible (implicit)?

In the past, digital logic circuits often hid the power pin, and attached power nets using an attribute inside the symbol. Modern thought is that this is a bad practice (although religious wars still occasionally rage about this topic).

It’s marginally OK for an old logic circuit which is all 5V TTL to have hidden power and GND pins. If you only have +5V on your board, then hiding the power pin can simplify your schematic somewhat. However, few designers design such circuits nowadays; 5V TTL (and 5V CMOS) are rapidly becoming antique technologies.

It’s always been unacceptable to hide the power pins on analog chips. First, analog often has multiple power connections (VCC, VEE) which need to be explicitly drawn out. Second, good design practice is to place decoupling caps on each and every power pin. Sometimes one places an inductor in series with power also. Since these should be drawn into the schematic, it is best done by attaching them to an explicit power pin. Therefore, one should never use hidden power pins for analog symbols.

New logic circuits often use multiple supplies for different chip sections (OVDD, DVDD, etc). It is also typical to have several logic families on a single board (5V, 3.3V etc.). Therefore, it’s best to explicitly place and wire the power pins on the symbol. Hidden power pins are a recipe for disaster since you can all too easily misconnect a 5V part to a 3.3V power net, for example.

To paraphrase Nancy Reagan: Just say “no” to hidden power pins.

That said, it may still be usefull to detach the power pins from the functional part of the symbol. To do so, define a seperate power symbol and give it the same refdes as the functional part. A run of gsch2pcb will treat the siblings properly as one single component. As neither gschem nor gsch2pcb explicitely know that the component is only complete with both symbols defined, you have to check yourself. With this workaround, you can draw all power related circuitry in one corner of the schematic where it does not interfere with the signal nets. In many cases this is advantageous with analog circuits.

Is there a specification or manual for creating gschem symbols? Where is it?

Yes. It is the Symbol Creation Guide.

Gschem configuration/customization

Gschem is configurable in more ways than can be describe here. Look at “system-gschemrc” for suggestions what else can be done.

How can I change the default size of floating text?

Put

(text-size 10)

into your gschemrc and replace “10” with your favorite size.

How can I have a different background color other than black?

Edit the system-gschemrc file and near the top you will find lines like:

; 
; Start of color section
; 
; Load up a color scheme has a light (almost white) background
; Comment out the first line and comment in the second line for a
; dark (black) background.  The dark background is the original look.
; 
(load (string-append gedadatarc "/gschem-darkbg")) ; dark background
;(load (string-append gedadatarc "/gschem-lightbg")) ; light background

Comment out the darkbg line (with a ;) and comment in the lightbg line. This will give you a light background instead of a black background. It also adjust all the other colors to be compatible with a light background.

If you want more control over the colors, please edit ${prefix}/share/gEDA/gschem-darkbg or ${prefix}/share/gEDA/gschem-lightbg or create your own file and load it in the system-gschemrc file.

A dark background is preferred by many users.

Printing/Output

How do I print schematics from the command line?

Running the script gschem-print.scm will create the Postscript file that is specified on the command line.

The command line below creates a Postscript file from a schematic file (replace MY_SCH with the name of your schematic and GEDA_SCHEME_DIR with the name of the directory where your gEDA scheme files are installed):

gschem -p -oMY_SCH.ps -sGEDA_SCHEME_DIR/gschem-print.scm MY_SCH.sch

The BASH script below, which I name gschem-print, creates a Postscript file for each schematic file that is specified on the command line and then outputs each Postscript file to the default printer:

#!/bin/bash

# gschem options
# -oPS_FILENAME output to Postscript file PS_FILENAME
# -sSCRIPT_FILENAME run script SCRIPT_FILENAME
# -p autoplace windows

for name in $*
do
base=”${name%.*}”
gschem -p -o$base.ps -sGEDA_SCHEME_DIR/gschem-print.scm $base.sch
lpr -P$PRINTER $base.ps
done

How can I get color postscript/PNG output?

Edit the system-gschemrc file or place the following into a gschemrc file (either ~/.gEDA/gschemrc or a gschemrc file in the local directory where you invoke gschem):

(output-color "enabled")      ; for color postscript output
(image-color "enabled")       ; for color PNG output (enabled by default)

To control the background of the PS output, change the following line in either gschem-darkbg (for the default black colored background) or gschem-lightbg (for the alternative light colored background):

(output-color-background 16 "black" "null" "0 0 0" 0 0 0)

The “0 0 0” is the RGB components (between 0..1) for the background color of the PS output.

To control the background of the PNG output, change the following line in either gschem-darkbg (for the default black colored background) or gschem-lightbg (for the alternative light colored background):

(background-color 0 "grey94" "null" "1 1 1" 255 255 255)

The 255 255 255 are the RGB components for the background color of the PNG image.

How can I get black and white postscript/PNG output?

For black and white PS output, place the following into a gschemrc file:

(output-color "disabled")      ; for monochrome postscript output

For black and white PNG images, place the following into a gschemrc file:

(image-color "disabled")       ; for monochromoe PNG output

How can I insert schematics into my LaTex document?

  1. Print the schematic to a file. This will be generic postscript (*.ps).
  2. Convert the postscript file to epsi with the tool ps2epsi. This is a script from the ghostscript suite.
  3. Include usepackage{graphicx} to the preamble of your latex document. Use the comand includegraphics to place your schematic.

A simple example:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
  \begin{image}
  \includegraphics[width=100mm]{ModulPID.epsi}
  \end{image}
\end{document}

How can I split postscript output over multiple pages?

gschem does not provide this functionality internally, however there is a program called “poster” which does exactly this. It can be downloaded from either here (GNU) or here (KDE Print).

Gschem installation/run-time problems

Gschem segfaults when I delete components on FC5 (and other Linux distributions)! Is there a work-around?

This bug seems to have appeared for users of Fedora Core 5 (and other linux distributions that use glib 2.10.x). The bug has been fixed by the developers and the bug fix will appear in the next version of gEDA/gaf.

In the mean time, you can work around this bug by setting the environment variable G_SLICE to “always-malloc”. Specifically, before you run gschem, do this:

bash:

export G_SLICE=always-malloc

csh:

setenv G_SLICE always-malloc

After installation gschem does not work!? What could be wrong?

If you run gschem and you get a window without a menu bar, no colors, and the program terminates when you press a key with the following message:

ERROR: Unbound variable: current-keymap

Or you get errors like this:

Gtk-CRITICAL : file gtkpixmap.c: line 97 (gtk_pixmap_new): assertion `val != NULL’ failed.
Gtk-CRITICAL : file gtkpixmap.c: line 97 (gtk_pixmap_new): assertion `val != NULL’ failed.
Tried to get an invalid color: 0
Tried to get an invalid color: 7
Tried to get an invalid color: 0
Tried to get an invalid color: 7

then gschem is not finding an rc file. There are two required rc files. The first is system-gschemrc and the second is system-commonrc.

Make sure these file are installed. The gschem.log file (which is created everytime you run gschem) holds valuable debugging information which should help in determining what is wrong. Check this file for where gschem is looking for the rc files.

Also, some older releases of gEDA/gaf had some bugs when the rc files were installed in other locations (other that ${prefix}/share/gEDA), so please upgrade to a more current release.

"Add Components" offers no symbols! What can I do about it?

Make sure that at least one of your config files contains a valid path to a symbol library. At startup, gschem checks for the following config files (on a Debian system):

  1. system gafrc file: /etc/gEDA/system-gafrc
  2. user gafrc file: ~/.gEDA/gafrc
  3. local gafrc file: $PWD/gafrc
  4. system gschemrc file: /etc/gEDA/system-gschemrc
  5. user gschemrc file: ~/.gEDA/gschemrc
  6. local gschemrc file: $PWD/gschemrc]

All of these config files may or may not append paths to the library search list. If a config file conatins the command

(reset-component-library)

the library search path will be emptied. Order is obviously important, as this command will erase any previously appended paths.