Next: Editing symbols, Up: Symbols [Contents][Index]

### 4.1 Symbol Creation

This section has been written by Ales Hvezda for the gEDA project and later adapted for Lepton.

#### 4.1.1 Overview

This document describes the creation of component symbols, including style conventions, and hints/tips and things to look out for when drawing symbols for the gEDA/gaf system.

#### 4.1.2 Component Symbol Creation

Component symbols (from here on known as symbols) are drawn using `lepton-schematic`. You can start with a blank page or a known-to-be good symbol that is similar to the one you want to create.

#### 4.1.2.1 Preparing

Before you open `lepton-schematic` to create your symbol, there are a few questions you should ask yourself, that will effect how you create your symbol:

1. Is this symbol purely for aesthetic purposes (a graphic)? If so, several steps are simplified.
2. Do I want to simulate the component in question, with e.g. SPICE?
3. Do I want to use this symbol in a schematic that includes power distribution? This will become important when deciding what pins to draw.
4. Does this symbol represent a component that comes several in a package? This is called slotting in gEDA’s language, and has special rules.

Once you’ve answered those questions, the following guide will be more useful to you.

To start building your symbol:

1. Open `lepton-schematic`.
2. The default empty page has boxes on it. Use the selection tool (the one that looks like a black mouse cursor) to select everything on the page. Hit the `Delete` key to delete it.
3. Zoom in at least one step (View → Zoom, or hit the `Z` key).
4. Make sure the snap-to-grid functionality is ON (Options → Toggle Snap On/Off, or `O S`).
5. Make sure grid snap size is set to 100 (Options → Snap Grid Spacing..., or `O Shift-S`).

#### 4.1.2.2 Drawing your Symbol

Use the ‘`line`’, ‘`box`’, ‘`circle`’, and ‘`arc`’ tools (in the ‘`Add`’ menu) to create a simplified visual representation of your device. Make sure that the only color you use is `graphic` (green). Do not place any pins on the device until the next step.

To check what color you are using to draw, go to Edit → Color... (or hit `E O`).

#### 4.1.2.3 Placing Pins on your Symbol

If you have decided your symbol is graphical in nature (e.g., does not connect to anything, is just artwork), you can skip this step.

Add your first pin.

1. Select Add → Pin, or hit `A P`. Once that is done, click from the end of your pin, to one of the edges of your symbol. A ’0’ and the word ’unknown’ should pop up near your new pin. Please note that the direction you draw your pins is important. If you draw them starting from the edge of your symbol to outside of your symbol, you will end up with text outside of the symbol!
2. Click on the selection tool, and use it to select the pin you just drew. The pin and text with it should change colors, and boxes should be drawn around the ends of the pin.
3. Select Edit → Edit..., or hit `E E` (or right click, and hit ‘`Edit...`’). This will bring up the edit dialog for this pin.

In the Edit dialog for a pin, you should see four attributes (name=value pairs) already associated with your new pin. These attributes can be edited by clicking on the attribute in the list at the top of the edit window, then clicking on the field you want to edit. Note that when selected, the ‘`Add Attribute`’ section of this dialog does not reflect what has been selected, as it is only meant for addition, not for editing.

Let’s look at each attribute already associated with your pin, and edit some of the values. I recommend expanding the size of the edit window until all attributes are visible.

- All pins should have a pinseq attribute. This number dictates the order pins are looked at on this symbol in SPICE, `lepton-netlist`, and other tools. For our first pin, start this sequence number at `1`, incrementing it on each new pin, as we add them.
- All pins should have a pinnumber attribute. This is the number of the pin, on the package of the item you are drawing a symbol for. pinnumber values can be alphanumeric (i.e. like `E` or `C`).
- All pins should have a pinlabel attribute. This attribute is the name or label of the pin (not the pin number).
- All pins should have a pintype attribute. This attribute describes the kind of a pin.
- pinseq and pinnumber attributes of several pins can be automatically numbered by Attributes → Autonumber Text....

Possible pintype values are: in, out, io, oc, oe, pas, tp, tri, clk, pwr. See pintype attribute for more info.

Next: Editing symbols, Up: Symbols [Contents][Index]