X11
Pcb
is freely redistributable!
Pcb
.
Pcb
.
Pcb
from a shell.
ASCII
files used by Pcb
.
Copyright (C) 1994,1995,1996,1997 Thomas Nau
This program is free software; you may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANT-ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Pcb
is a handy tool for laying out printed circuit
boards.
It was first written for an Atari ST in 1990 and ported to UNIX
and
X11
in 1994.
I never had the intention to create another professional layout system,
but to write a tool which supports people like you who do some
home-developing of hardware. For this reason it has no auto-router nor
auto-placement code.
The second release 1.2 included menus for the first time. This made
PCB
easier to use and thus a more important tool.
Release 1.3 introduced undo for highly-destructive commands, more straightforward action handling and scalable fonts. Layer-groups were introduced to group signal-layers together.
Release 1.4 provided support for add-on device drivers. Two layers (the solder and the component side) were added to support SMD elements. The handling of libraries was also improved in 1.4.1. Support for additional devices like GERBER plotters started in 1.4.4. The undo feature was expanded and the redo-feature added in 1.4.5.
Release 1.5 provides support for rats-nest generation from simple net lists. It also allows for automatic clearances around pins that pierce a polygon. A variety of other enhancments including a Gerber RS274X driver and NC drill file generation have also been added. harry eaton (haceaton@aplcomm.jhuapl.edu) was responsible for most of the changes found in this release.
Special thanks goes to:
Bernhard Daeubler (Bernhard.Daeubler@physik.uni-ulm.de) Harald Daeubler (Harald.Daeubler@physik.uni-ulm.de) Roland Merk (merk@faw.uni-ulm.de) Erland Unruh (Erland.Unruh@malmo.trab.se) Albert John FitzPatrick III (ajf_nylorac@acm.org) Boerge Strand (borges@ifi.uio.no) harry eaton (haceaton@aplcomm.jhuapl.edu) Andre M. Hedrick (hedrick@Astro.Dyer.Vanderbilt.Edu)
who did most of the alpha and beta testing, helped to port PCB
to
several operating systems and platforms and corrected several typos in the
manuals. In addition to these, many others donated time for bug-fixing and
other important work. Some of them can be identified in the source code
files. Thanks to all of them.
Each layout consists of several, mostly independent, objects. This chapter
gives an overview of the object types and their relationship to each other.
For a complete description of how to use Pcb
, refer to
section Getting Started.
The layout is generated on-screen on a grid that has its origin in the
upper left corner of the screen.
The x coordinate increases to the right, y increases down to the bottom.
All distances and sizes in Pcb
are measured in mils (0.001 inch).
One unit on the display grid is one mil in distance on the board.
The sections in this chapter are sorted by the
order of appearance of the objects within a layout file.
The top object is the layout itself. It uses a set of symbols
that resides at the first logical level. Each symbol is uniquely identified
by a seven bit ASCII
code. All layout objects share the same set of
symbols. These symbols are used to form text objects on the silkscreen
and copper layers. Undefined symbols are drawn as filled rectangles.
Every font file is preprocessed by a user-defined command when it is loaded. For details see `fontCommand', section Non-Standard X11 Application Resources.
Vias are identical to the pins used by elements except that they can be added or removed individually. The purpose of vias is to provide connections between different layers. Don't use vias for adding elements to the layout, even if that seems easier than creating a new element. Vias are useful for defining arbitrary drill points such as those used for mounting a board. You can assign a name to a via even though you probably won't ever want to. Vias reside at the first logical level; therefore, each via exists on all layers. (i.e. blind vias are not supported)
Elements represent the components on a board.
Elements are loaded from ASCII
coded files in a
similar manner to the layout file itself.
They are composed of lines and arcs on the silk-screen
layer (used to define the package outline) , pins
(or pads for SMD) and three labels that define the
description, the element's layout-name (which also
appears on the silk- screen layer) and its value.
Element pins are contained on the first logical level
and so reside on all layers.
A mark is used to position the element with
respect to the cursor cross-hair during pasting.
SMD elements use pads instead of pins.
Pads are handled similarly to lines on a layer but they must be oriented
either vertically or horizontally.
Pads can have either rounded or square ends.
All parts of an element are treated as one unit.
It is not possible to delete a single pin or break
an element into pieces on the layout.
You can resize separate pieces of an element,
but doing so is usually a bad idea.
Elements are supported by several special layers: silk, pins/pads and far-side. The silk layer shows the package outline and also holds legend text and element names. The pins/pads layer is used to toggle whether the element's pins and pads are displayed. The far-side layer controls visibility of objects (silkscreen and pads) that are on the far (i.e. not currently viewed) side of the board.
Every element file is preprocessed by a user-defined command when the file is read.
For details see `elementCommand', section Non-Standard X11 Application Resources. m4
, the default
value of `elementCommand', allows you to create libraries for
package definitions that are shared by all elements.
The element libraries distributed with Pcb
expect m4
or an
equivalent to be the elementCommand.
Pcb
can create a list of
all connections from one (or all) elements to the others or a list of
unconnected pins.
It can also verify the layout connections against a netlist file.
The element's `layout-name' is the name used to identify an element
in a netlist file.
The pin numbering for an element is established
by the order of appearance of the pin definitions in a layout or element
file.
In other words, the first pin appearing in the file is pin one, the
next pin is pin two and so on.
Sometimes the names assigned to pins are simply numbers, but using
numbers to name pins has no effect on the actual pin numbering.
Presently, some of the library parts
are incorrectly implemented regarding pin-numbering. All of the DIL (Dual-
Inline-Pins) parts
are correct and some of the others are too, but you should verify the pin numbering
of any non-DIL part (use the Report Menu to see what Pcb
thinks a pin's
number is) before using the rats nest feature with a library part. Hopefully sometime
soon a someone will volunteer to revamp the element libraries and make
their fixes available.
Every layout consists of several layers that can be used independently or treated as a group. Layer groups can be used to logically separate (and color-code) different traces (e.g. power and signal); however, all layers within a group reside on the same physical copper layer of a board, so using different layers within the same group won't provide electrical separation where they touch or overlap. For details, see `layerGroups', section Non-Standard X11 Application Resources. Each layer is drawn in a color defined in the resource file (for details see `layerColor', section Non-Standard X11 Application Resources) and identified by a name that you can change. Layers are really just containers for line, polygon, and text objects. The component and solder layers contain SMD elements as well, but the file structure doesn't reflect that fact directly. Each layer group represents a physical layer on the printed circuit board. If you want to make a four layer board, you'll need to have four layer groups. Connections between layer groups are established only through element pins and vias. The relationship between a specific layer and the board itself is configureable from the `Edit layer groups' option in the `Objects' menu. The layer groups corresponding to the physical layers component-side and solder-side are always defined, and you must map at least one logical layer to each. Of course, you are not obligated to put tracks on either of them. SMD-elements always reside on either the component-side or the solder-side layer group. You can swap which side of the board you are viewing by pressing <Key>Tab. You can decide which layer group will be the solder side and which will be the component side. The layers groups just have a name or number associated with them - where they are sandwiched in the board is left to the manufacturing processes.
Lines are used to draw tracks on the pc board.
When in the line mode, each <Btn1>
press establishes one end of a line.
Once the second point is defined, the line is drawn
and a new line started where the first one ended.
You can abondon the new starting point in favor
of another by pressing Shift<Btn1>.
The undo function (<Key>u) will take you back
point by point if you use it while in the line mode.
New lines can be restricted to 45 degree angles if desired. You can toggle this
restriction on and off while creating lines by pressing <Key>. (that is the
period key).
It is simple to edit a line type object by breaking it into pieces (insert point mode),
moving an end point (or the whole line) (<Btn2Down><drag><Btn2Up>),
or changing the layer it resides on (<Key>m moves the line under the pointer
to the active layer).
In the case when two line segments meet at exactly the same
point you can delete the intermediate point, otherwise the delete mode removes an entire line.
Feel free to experiment
since Pcb
will allow you to undo anything that materially affects your work.
Sometimes it's useful to fill large areas with solid copper.
The way to do this is with polygons.
Polygons can be created in either the polygon mode or the rectangle mode.
In the polygon mode, you'll have to define each corner of the polygon
with a mouse click (<Btn1>). When the last point is clicked
exactly on top of the starting point, the polygon is finished.
Since this can be hard to do, the Shift<Key>p will enter the
final point for you, closing the polygon.
If the 45 degree angle restriction is turned on
and you try to close the polygon when it is not possible, you'll get a
warning instead. If you haven't finished entering a polygon, but want to
undo one (or more) of the points that you've already defined, use the
undo command (<Key>u).
With the rectangle tool, defining
the two opposite corners is sufficient, but of course the resulting
polygon is a rectangle.
Like lines, a polygon can by edited by deleting, inserting and moving the points
that define it.
Pcb
is capable of handling complex polygons, but
using a number of simpler ones improves performance of the connection tracing code.
A new feature in version 1.5 of Pcb
automatically creates clearance
regions around pins and vias that pierce a polygon. This means that they
aren't electrically connected to the polygon unless you add "thermals"
to cross the clearance region.
Thermals can be added and removed by selecting the thermal mode and clicking
<Btn1> on the pin or via.
Remember that this only creates connections to the polygon on the active layer.
The great advantage to this new polygon behavior is that simple or complex ground
or power planes can be easily made with polygons and seen on the screen.
If you don't want this auto-clearance behavior, or you load a layout created by
an earlier version of Pcb
, the old behavior
(shorts to all piercing pins and vias) is available. A `ChangeSize'
operation (<Key>s) toggles a polygon between the new and old polygon/pin
behavior.
Text objects should be used to label a layout or to put additional information on the board, but not to identify elements because elements have their own labels. Text is always horizontal when first created, but the rotate mode can align it along 0, 90, 180 and 270 degree angles. Text can be moved from any layer to the silk-screen layer with a command in the `selection menu'. Text that is moved to the silk-screen layer will appear on the solder-side silk-screen if it originating on a solder-side layer. Otherwise moving it to the silk-screen layer will put it on the component-side silk-screen. To move text back to a copper layer from the silk-screen, use the `MoveToCurrentLayer' (<Key>m) command. Text on the far side of the board will automatically appear mirror-imaged.
TEXT OBJECTS ON A COPPER LAYER CREATE COPPER LINES BUT THEY ARE NOT SCANNED FOR CONNECTIONS OR TESTED FOR CREATING SHORTS VS. THE NETLIST.
The goal of this chapter is to give you enough information to learn how
Pcb
works and how to develop your layouts to make the best use of Pcb
's
features. All event translations (i.e. the buttons and keys you
press) refer to the default application resource file shipped with Pcb
.
There is probably no need to change them unless your window
manager uses some of the button events itself; however, if you want
to customize the behavior of Pcb
then changing the resource file
is usually the best way to do it.
Get yourself a printout of this chapter and User Commands, if you haven't already done so, and follow the examples. An example layout may be found in `example/68HC11'. An example illustrating some version 1.5 features is found in `example/LED' along with its corresponding netlist file `example/LED.NET'.
Start Pcb
(the actual command will use all lower-case letters)
without any additional options.
If you get the error message:
can't find default font-symbol-file 'default_font'
then the font searchpath or filename in the application resource
file is wrong. Be sure that your m4
program supports searchpaths.
If not, get GNU m4
.
For other messages, see section Troubleshooting.
Another quick-start is provided by pcbtest.sh
in the `src'
directory.
The main window consists of five areas: the menu at the top, the control panel in the upper left corner, the mode buttons located below the control panel, the drawing area to the right of these, and the status line at the bottom of the window.
The status-line is located at the bottom edge of the main window. During normal operation the status information is visible there. When a selected menu operation requires an additional button click, the status-line is replaced by a message telling you to position the cursor and click. When a text input is required, the status-line is replaced by the Input-field which has a prompt for the typed input.
The status-line shows, from left to right, the side of the board that you are viewing (<Key>Tab changes this), if an absolute (abs) or relative (rel) grid is used, if new lines are restricted to 45 degrees, whether rubberband move and rotate mode is on (-R), the current grid values, and the zoom factor. This information is followed by the line-width, via-size and drilling hole in mil, text scaling, the active buffer number and the name of the layout. An asterisk appearing at the left edge indicates the layout has been modified since the last save. Note that the name of the layout is not the same thing as the filename of the layout.
The input-field pops up (temporarily replacing the status-line) whenever user input is required. Two keys are bound to the input field: <Key>Escape aborts the input, <Key>Return finishes it.
The present cursor position is displayed in the upper right corner of the window.
Normally this position is an absolute coordinate, but with
version 1.5 of Pcb
you can anchor a marker at
the current cursor location by pressing Ctrl<Key>m then the
display will read both the absolute cursor position as well as the difference
between it and the marker. Pressing Ctrl<Key>m again turns the marker off.
The control panel, located at the left side of the window, is used to turn on and off the display of layer groups and to select the active drawing layer. If a layer hasn't been named, the label "(unknown)" is used as the defualt.
The upper control box is used to switch layers on and off. Click <Btn1Down> on one or more of them. Each click toggles the setting. The currently active layer can't be switched off. The layout is refreshed when the pointer reenters the drawing area. This prevents excessive redrawing when the visibility of several layers is changed. When the layers are grouped, clicking on these fields will toggle the visibility of all layers in the same group. This is a good idea because layers in the same group reside on the same physical layer of the actual board. Use the `Edit layer groups' option in the `Objects' menu to change the layer groupings. Grouping layers is only useful for helping you to color-code signals in your layout. Note that grouping layers actually reduces the number of different physical layers available for your board, thus to make an eight layer board, you cannot group any layers.
far side turns on and off the visibility of elements (including SMD pads) on the opposite board side, as well as silk screening on that side. It does not automatically hide the x-ray view of the other copper layers, these must be turned off separately if desired. Use the tab key to view the entire board from the other side. To see a view of what the back side of the board will actually look like, make the solder layer the active layer then press tab until the status line says "solder" on the right, then turn off the visibility of all other layers except pins/pads, vias, and silk.
The lower control menu, named active, is used to change the active drawing layer. <Btn1Down> pops up a menu to select a one. Each entry is labeled with the layer's name and drawn in its color. The new drawing layer is automatically made visible. Try changing the active layer's name to ABC by selecting `set name of layer' from the `File' menu. Changing the active layer also is available with <Key>1..8.
The mode selector buttons reside below the control panel.
They are used to select the operation mode of Pcb
. A mode can be
thought of as a tool that gets used when <Btn1> is pressed.
Each mode causes the cursor to take on a unique shape that identifies the tool.
The buttons themselves are icons that illustrate their function.
The drawing modes can also be selected from the keyboard:
<Key>Escape reset mode <Key>F1 via-mode <Key>F2 line-mode <Key>F3 pastebuffer-mode <Key>F4 rectangle-mode <Key>F5 text-mode <Key>F6 polygon-mode <Key>Insert insert-point-mode <Key>F7 thermal-mode
The <Key>Space cycles through all of the modes in the mode button palette.
Reset-mode is really no mode, and <Btn1> has no effect with this setting. Some of the modes are very simple, such as the via-mode. Clicking <Btn1> while in this mode creates a via at the cross-hair position. The pastebuffer-mode is similar. With this mode, <Btn1> copies the contents of the active buffer to the layout, but only those parts that reside on visible layers are copied. The rotate-mode allows you to rotate elements and text objects 90 degrees counter-clockwise with each click. The line-mode is explained in detail in section Lines. Rectangle-mode, polygon-mode and thermal-mode are explained in detail in section Polygons. Remember that the thermal-mode will only create and destroy thermals to polygons on the active layer.
The insert-point-mode is an editing tool that allows you to add
points into lines or polygons. With version 1.5 of Pcb
, the
insert-point-mode enforces the 45 degree line
rule. You can force only the shorter line segment to 45
degrees by holding the shift key down while inserting the point.
The delete-mode deletes the smallest object beneath the cursor with each
<Btn1> click.
If you use click at an end-point
that two lines have in common, it will replace the two lines with a single line
spanning the two remaining points. This can be used to delete an "inserted"
point in a line, restoring the previous line.
The drawing area is made from a viewport widget that also includes two scrollbars. The cursor changes shape depending on the current operation mode when the pointer is moved into the drawing area. A crosshair follows the X11 pointer with respect to the grid setting. Move around and watch the cursor position displayed in the upper right of the window. Now select a new grid from the Display menu. The new value is updated in the statusline. Now move again and watch the difference. A different way to change the grid is Shift<Key>g to decrease or <Key>g to increase it. The grid setting is saved along with the data when you save a pcb layout. For homemade layouts a value around 50 is a good setting. The cursor also may be moved with the cursor keys or, for larger distances, by pressing the shift modifier together with a cursor key.
The menus are located at the top of the drawing area. Most, but not all, of their functions are also available from the keyboard. Some of the entries such as center require a certain cursor position. In this case a statusline will popup at the bottom with wording similar to the following:
move pointer to the appropriate screen position and press a button
Any mouse button will do the job, whereas any key except the cursor keys will cancel the operation. For details see section Actions.
X11R5
and later)
which simplifies adjusting the offsets. With earlier releases the printout
will always appear in the upper left corner with respect to the media margins.
A selection of several device drivers is available from the printer control
dialog. Presently PostScript, encapsulated PostScript,
and GerberX are supported. GerberD support may be forthcoming.
It requires a rastering engine that pcb presently lacks.
This optional window is used to display all kind of messages including
the ones written to stderr by external commands. The main advantage is
that its contents are saved in a scrolling list until the
program exits. Disabling this feature by setting the resource
useLogWindow to false will generate popup windows to display
messages. The stderr of external commands will appear on Pcb
s
stderr which normally is the parent shell. I suggest you iconify
the window after startup for example by setting *log.iconic to
true. If raiseLogWindow is set true,
the window will deiconify and raise itself whenever new messages are to be
displayed.
First appearing in 1.4.1 the library window is one of the best new features in my opinion. It simplifies loading circuits quiet a lot just by selecting the appropriate type from the menu at the top. A circuit is then selected by simply double-clicking on the text line. For details on libraries check-out section Library File Format and section Library Contents File Format.
There are several ways of creating new objects: you may draw them yourself, you may copy an existing object or you may load an element from a file or library. Creating new objects is normally related to a special mode depending on the object type. The notation of key and button events is the same as described in the X11 Intrinsics manual.
The operation mode may be selected by one of the mode selectors in the bottom left corner, by one of the function keys listed earlier in this chapter, or by pressing the space bar to cycle through the modes. <Btn1Down> sends a notify request to the application which responds by creating or changing the appropriate object or at least takes the first step to do so. Switching to a mode causes the cursor to take on a unique shape and also causes the cooresponding mode selector button to be drawn with thick lines. You can use either cue to see which mode is currently selected.
Removing objects is possible using <Key>BackSpace (or <Key>Delete on some machines) which deletes the object at the cursor location. If more than one object is located at the same position, the smallest matching type will be chosen. If two or more of the same type are the smallest at the position, then the newest one will be deleted. You also may change to remove-mode and click <Btn1Down> at the location of the objects which are to be removed. If you "remove" the end-point where two lines connect, it will remove the point of connection leaving a single line that spans the far end points.
Rotating works in a similar fashion. Change the mode and press <Btn1Down> at the object's location. Remember only text and elements can be rotated. (Anything including groups of objects may be rotated inside a buffer using the rotate buffer menu option.)
Insert mode provides the capability of inserting new points into existing polygons or lines. The 45 degree line clipping is now enforced when selected. Press and hold the shift key while positioning the new point to only clip the line segment to the nearer of the two existing points to 45 degrees. You can also toggle the 45-degree clipping in the middle of a point insertion by pressing the <Key>. If the shift key is not depressed and the 45 degree line clipping mode is on, both new line segments must be on 45 degree angles which greatly restricts where the new point may be placed. In some cases this can cause confusion as to whether an insertion has been started since the two new lines may be forced to lie parallel on top of the original line until the pointer is moved far from the end points.
Removing objects, changing their size or moving them only applies to objects that are visible when the command is executed.
There are several keystrokes and button events refering to an object without identifying its type. Here's a list of them:
<Btn1Down> creates (or deletes) an object depending on the current mode.
<Key>BackSpace or <Key>Delete removes the visible object at the cursor location. When more than one object exists at the location, the order of removal is: pin, via, line, text, polygon and element. Only one object is removed for each keystroke. If two or more of the same type match, the newest one is removed.
Use <Key>s and Shift<Key>s to change the size (width) of lines, text objects, pins, pads and vias, or to toggle the style of polygons (whether pins and vias automatically have clearances).
<Key>n changes the name of pins, pads, vias and elements, the string of a text object, or the currently displayed label of an element.
<Key>u (undo) recovers from an unlimited number of operations such as removing, moving, copying or selecting objects.
Shift<Key>r restores the last undone operation provided no other changes have been made since the undo was performed.
<Key>tab changes the board side you are viewing.
For a complete list of keystrokes and button events see section Default Translations.
To draw new lines you have to be in line-mode. Get there either by selecting it from the Modes menu or by pressing <Key>F2. Each successive notify event creates a new line. The adjustment to 45 degree lines is done automatically if it is selected from the Display menu. You can toggle the 45 degree mode setting by pressing the <Key>. (That is the period key). Press <Key>Escape to leave line-mode.
<Key>l, Shift<Key>l and the entries in the Sizes menu change the initial width of new lines. This width also is displayed in the statusline.
A polygon is drawn by defining all of its segments as a series of consecutive line segments. If the first point matches a new one and if the number of points is greater than two, then the polygon is closed. Since matching up with the first point may be difficult, you may use Shift<Key>p to close the polygon. The Shift<Key>p won't work if clipping to 45 degree lines is selected and the final segment cannot match this condition. I suggest you create simple convex polygons in order to avoid a strong negative impact on the performance of the connection scanning routines. The rectangle-mode is just an easy way to generate rectangular polygons. Polygon-mode also is selected by <Key>F6 whereas rectangle-mode uses <Key>F4. Pressing a <Btn1Down> at two locations creates a rectangle by defining two of its corners. <Key>Insert brings you to insert-point-mode which lets you add additional points to an already existing polygon. Single points may be removed by moving the crosshair to them and selecting one of the delete actions (remove-mode, BackSpace, or Delete. This only works if the remaining polygon will still have three or more corners. Pressing <Key>u or <Key>p while entering a new polygon brings you back to the previous corner. Removing a point does not force clipping to 45 degree angles (because it's not generally possible). Newly created polygons will not connect to pins or vias that pierce it unless you create a thermal (using the thermal mode) to make the connection. If the edge of a polygon gets too close to a pin or via that lies outside of it, a warning will be issued and the pin will be given a special color. Increasing the distance between them will remove the warning color.
Pressing <Key>F5 or clicking one of the text selector buttons changes to text-mode. Each successive notify event (<Btn1Down>) pops up the input line at the bottom and queries for a string. Enter it and press <Key>Return to confirm or <Key>Escape to abort. The text object is created with its upper left corner at the current pointer location. The initial scaling is changed by <Key>t and Shift<Key>t or from the Sizes menu.
Now switch to rotate-mode and press <Btn1Down> at the text-objects location. Text objects on the solder side of the layout are automatically mirrored and flipped so that they are seen correctly when viewing the solder-side.
Use <Key>n to edit the string.
TEXT OBJECTS ON COPPER LAYERS CREATE COPPER LINES BUT THEY ARE NOT SCANNED FOR CONNECTIONS. If they are moved to the silkscreen layer, they no longer create copper.
The initial size of new vias may be changed by <Key>v and Shift<Key>v or by selecting the appropriate entry from the Sizes menu. Mod1<Key>v and Mod1 Shift<Key>v do the same for the drilling hole of the via. The statusline is updated with the new values. Creating a via is similar to the other objects. Switch to via-mode by using either the selector button or <Key>F1 then press <Key>Space or <Btn1Down> to create one. <Key>n changes the name of a via.
Some of the functions related to elements only work if both the package layer and the pin layer are switched on.
Now that you're familiar with many of the basic commands, it is time to put the first element on the layout. First of all, you have to load data into the paste buffer. There are three ways to do this:
1) load the data from a library 2) load the data from a file 2) copy data from an already existing element
We don't have any elements on the screen yet so we use number one.
Select lsi from the menu in the library window press <Btn1Down> twice at the appropriate text-line to get the MC68030 CPU. The data is loaded and the mode is switched to pastebuffer-mode. Each notify event now creates one of these beasts. Leave the mode by selecting a different one or by <Key>Escape which resets all modes.. The crosshair is located at the mark position as defined by the data file. Rotating the buffer contents is done by selecting the rotate entry of the Buffer menu or by pressing Shift<Key>F3. The contents of the buffer are valid until new data is loaded into it either by a cut-and-paste operation or by loading a new data file. There are 5 buffers available. Switching between them is done by selecting a menu entry or by Shift<Key>1..5. Each of the two board sides has its own buffers.
The release includes all data files for the circuits which have been used by the demo layout. The elemetns in the LED example are not found in the library, but you can lift them form the exmaple itself if you want. If you have problems with the color of the crosshair change the resource crosshairColor setting to a different one.
Now load a second circuit, the MC68882 FPU for example. Create the circuit as explained above. You now have two different unnamed elements. Unnamed means that the layout-name of the element hasn't been set yet. Selecting description from the Display menu displays the description string of the two circuits which are CPU and FPU. The values of the circuits are set to MC68030 and MC68882. Each of the names of an element may be changed by <Key>n at the elements location and editing the old name in the bottom input line. Naming pins and vias is similar to elements. You can hide the element name so that it won't appear on the board silkscreen by pressing Non<key>h with the cursor over the element. Doing so again un-hides the element name.
Entering :le and selecting an element data file is the second way to load circuits.
The third way to create a new element is to copy an existing one. Please refer to section Moving and Copying.
To display the pinout of a circuit move to it and press Shift<Key>d or select show pinout from the Objects menu. A new window pops up and displays the complete pinout of the element. This display can be difficult to read if the component has been rotated 90 degrees :-( therefore, the new window will show an un-rotated view so the pin names are readable. <Key>d displays the name of one or all pins/pads inside the drawing area, this is only for display on-screen, it has no effect on any printing of the layout.
You also may want to change a pin's or pad's current size by pressing <Key>s to increase or Shift<Key>s to decrease it. While this is possible, it is not recommended since care was probably taken to define the element structure in the first place. You can also change the thickness of the element's silkscreen outline with the same keys. Finally, you can change whether a pin or SMD pad is rounded or square with the <Key>q. SMD pads should usually have squared ends.
SMD elements and silkscreen objects are drawn in the "invisible object" color if they are located on the opposite side of the board.
For information on element connections refer to section Connection Lists.
The linestack and element-buffer of former releases have been replaced by 5 multi-purpose buffers that are selected by Shift<Key>1..5. The status line shows which buffer is the active one. You may load data from a file or layout into them. Cut-and-paste works too. If you followed the instructions earlier in this chapter you should now have several objects on the screen. Move the crosshair to one of them and press <Btn3Down> to toggle its selection flag. The object is redrawn in a different color. You also may want to try Mod1<Btn3Down>, move the pointer while holding the button down and release it on a different location. This selects all objects inside the rectangle. Using Shift Mod1<Btn3Down> unselects all objects. Now change to pastebuffer-mode and select some operations from the Buffer menu. Copying objects to the buffer is available as Ctrl<Key>x while cutting them uses Ctrl Shift<Key>x as shortcut. Both clear the buffer before new data is added. If you use the menu entries, you have to supply a crosshair position by pressing a mouse button. The objects are attached to the pastebuffer relative to that crosshair location. Element data or PCB data may be merged into an existing layout by loading the datafiles into the pastebuffer. Both operations are available from the File menu or as user commands.
All objects can be moved including element-names, by <Btn2Down>, draging the pointer while holding the button down and releasing it at the new location of the object. If you use Mod1<Btn2Down> instead, the object is copied. Copying does not work for element-names of course. You have to use the cut-and-paste (or copy-and-paste) paradigm for copying and moving groups of objects. Please refer to section Pastebuffer. If you want to give a small nudge to an object, but you don't think that the mouse will give you the fine level of control that you want, you can position the cursor over the object, press <Key>[, then move it with the cursor arrow keys, then press <Key>] when it's at the desired position. Remember that all movements are forced onto grid coordinates, so you may want to reduce the grid spacing first.
After your first experience with Pcb
you will probably want to save
your work. :s name passes the data to an external program which
is responsible for saving it. For details see saveCommand in
section Non-Standard X11 Application Resources.
Saving also is available from the File menu, either with or
without supplying a filename. Pcb
reuses the last
filename if you do not pass a new one to the save routine.
To load an existing layout either select load layout data from the File menu or use :l filename. A file selectbox pops up if you don't specify a filename. Merging existing layouts into the new one is supported either by the File menu or by :m filename.
Pcb
saves a backup of the current layout depending on the resource
backup. The file is named `/tmp/PCB.%i.backup'. During critical
sections of the program or when data would be lost it is saved as
`/tmp/PCB.%i.save'.
%i is replaced by the process ID.
Pcb
now has support for device drivers,
PostScript
, encapsulated PostScript,
and Gerber X drivers are
available so far. The Gerber X
driver generates a NC drill file for automated drilling.
I recommend the use of GhostScript
if you
don't have a PostScript
printer for handling the PostScript
output. Printing always generates
a complete set of files for a specified driver.
See the page about
the Print() action for addtional information about the filenames.
The control panel offers a number of options. Most of them are not avilable
for Gerber output because it wouldn't make sense to scale the gerber output
for example (you'd get an incorrectly made board!) The options are:
X11
geometry specification.
This entry is only available if you use X11R5
or later.
For earlier releases the user defined size or, if not available, A4
is used.
Well known size are:
A3 A4 A5 letter tabloid ledger legal executive
X11R5
or later. A zero
offset is used for earlier releases.
The created file includes some labels which are guaranteed to stay unchanged
awk
script to produce several printouts on one piece of paper by
duplicating the code and putting some translate
commands in front.
Note, the normal PostScript
units are 1/72 inch.
After completing parts of your layout you may want to check if all drawn connections match the ones you have in mind. This is probably best done in conjunction with a net-list file: see section Rats Nest. To demonstrate the use of the appropriate commands execute the following steps:
1) create at least two elements and name them 2) create some connections between their pins 3) optionally add some vias and connections to them
Now select lookup connection from the Connections menu,
move the cursor to a pin or via and press any mouse button. Pcb
will look for all other pins and/or vias connected to the one you have
selected and display the objects in a different color.
Now try some of the reset options available from the same menu.
There also is a way to scan all connections of one element. Select a single element from the menu and press any button at the element's location. All connections of this element will be saved to the specified file. Either the layout name of the element or its canonical name is used to identify pins depending on the one which is displayed on the screen (may be changed by Display menu).
An automatic scan of all elements is initiated by choosing all elements. It behaves in a similar fashion to scanning a single element except the resource resetAfterElement is used to determine if connections should be reset before a new element is scanned. Doing so will produce very long lists because the power lines are rescanned for every element. By default the resource is set to false for this reason.
To scan for unconnected pins select unused pins from the same menu.
Some commands mentioned earlier in this chapter also are able to operate on all selected and visible objects. Now go back to the layout and toggle the selection flag of a single one by <Btn3Down>. Try Mod1<Btn3Down>, move the pointer while holding the button down and release it on a different location. This selects all objects inside the rectangle. Using Shift Mod1<Btn3Down> unselects all objects.
The entries of the Selection menu are hopefully self-explanatory.
If you have a netlist that cooresponds to the layout you are working on, you can use the rats-nest feature to add rat-lines to the layout. First you will need to load a netlist file (see :rn, section User Commands). <Key>w adds rat-lines on the active layer using the current line thickness shown in the status line (usually you'll want them to be thin lines). Only those rat-lines that fill in missing connectivity (since you have probably routed some connections already) are added. If the layout is already completely wired, nothing will be added, and you will get a message that the wiring is complete.
Rat-lines are lines having the special property that they only connect to pins and pads at their end points. Rat-lines are drawn on the screen with a stippled pattern to make them easier to identify since they have special behavior and cannot remain in a completed layout. Rat-lines are added in the minimum length straight-line tree pattern (always ending on pins or pads) that satisfies the missing connectivity in the circuit. Used in connection with rubberband moves and rotates, they are extremely useful for deciding where to place elements on the board. Rat-lines will normally criss-cross all over which gives rise to the name "rats nest" describing a layout connected with them. If a SMD pad is unreachable on the active layer, a warning will be issued about it and the rat-line to that pad will not be generated.
A common way to use rats nests is to place the elements on the board, add all the rat-lines, and then use a series of rubberband moves/rotates until the rats nest appears to have the minimum tangling. You may want to iterate this step several times. Don't worry if the layout looks messy - as long as you can get a sense for whether the criss-crossing is better or worse as you move things, you're fine. After moving some elements arround, you may want to optimize the rats nest <Key>o so that the lines are drawn between the closest points (this can change once you've moved components). Adding rat-lines only to selected pads/pins (Shift<Key>w) is often useful to layout a circuit a little bit at a time. Sometimes you'll want to delete all the rat-lines (<Key>e) or selected rat-lines (Shift<Key>e) in order to reduce confusion. With a little practice you'll be able to achieve a near optimal component placement with the use of a rats nest.
Rat-lines are not only used for assisting your element placement, they can also help you to route traces on the board. Use the <Key>m to convert a rat-line under the cursor into a normal line on the active layer. Inserting a point into a rat-line will also cause the two new lines to be normal lines on the board. Another way that you can use rat-lines is to hide the layer that they are on, then use the <Key>f with the cursor over a pad or pin. All of the pins and pads belonging to that net will be highlighted. You can then route those tracks, turn off the highlighting (Shift<Key>f) and repeat the process. Be sure to erase the rat-lines (<Key>e erases them all) once you've duplicated their connectivity by adding your own lines. When in doubt, the <Key>o will delete only those rat-lines that are no longer needed.
If connections exist on the board that are not listed in the netlist when <Key>w is pressed, warning messages are issued and the affected pins and pads are drawn in a special warnColor until the next Notify() event. If the entire layout agrees completely with the netlist, a message informs you that the layout is complete and no rat-lines will be added (since none are needed). If the layout is complete, but still has rat-lines then you will be warned that rat-lines remain. There shouldn't be any rat-lines left in a completed layout, only normal lines.
The Shift<Key>w is used to add rat-lines to only those missing connections among the selected pins and pads. This can be used to add rat-lines in an incremental manner, or to force a rat-line to route between two points that are not the closest points within the net. Often it is best to add the rats nest in an incremental fashion, laying out a sub-section of the board before going further. This is easy to accomplish since new rat-lines are never added where routed connectivity already makes the necessary connections.
The entering of user-commands is initiated by the action routine
Command() (the (":")
character) and finished by either
<Key>Return
or <Key>Escape to confirm or to abort. These two keybindings
cannot be changed from the resource file.
The triggering event, normally a key press, is ignored.
The input area will replace the bottom statusline. It pops
up when Command() is called. The arguments of the user-commands
are passed to the external commands without modification.
See also, the resource saveInTMP.
There are simple usage dialogs for each command and one for the complete set of commands.
vi
users and
have the same functionality as s combined with q.
There are several resources which may be set or reset in addition to the standard toolkit command-line options. For a complete list refer to section Non-Standard X11 Application Resources.
The synopsis is:
pcb [-option ...] [-toolkit_option ...] [layout-file]
or
pcb -specialoption
Pcb
command-line options.
XBell()
and
must be in the range -100..100.
There are some special options available in addition to normal command line options. Each of these must be the only option specified on a command line. The available special options are:
This chapter gives an overview about the additional X11
resources which
are defined by Pcb
as well as the defined action routines.
X11
application resources.
In addition to the toolkit resources, Pcb
defines the
following resources:
Pcb
has an automatic backup feature which saves the current data
every n seconds. The default is 300 seconds. A value of zero disables
the feature. The backup file is named `/tmp/PCB.%i.backup'.
%i is replaced by the process ID.
See also, the command-line option -backup.
Pcb
uses this value to determine the page width when creating lists.
N, the number of characters per line, defaults to 80.
See also, the command-line option -c.
X11
server because only
the colormap index is used in the boolean operation and Pcb
doesn't
create its own colormap. The default setting is XtDefaultForeground.
Pcb
uses a user defined command to read element files. This resources
is used to set the command which is executed by the users default shell.
Two escape sequences are defined to pass the selected filename (%f) and the
current search path (%p). The command must write the element data
to its standard output. The default value is
M4PATH="%p";export M4PATH;echo 'include(%f)' | m4Using the GNU version of
m4
is highly recommended.
See also, the command-line option -lelement.
cat %fSee also, the command-line option -lfile.
cat %fSee also, the command-line option -lfont.
X11
server because only
the colormap index is used in the boolean operation and Pcb
doesn't
create its own colormap. The default setting is XtDefaultForeground.
Pcb
uses a command to read element data from libraries.
The resources is used to set the command which is executed by the users
default shell. Three escape sequences are defined to pass the selected
filename (%f), the current search path (%p) as well (%a) as the three
parameters template, value and package to the command.
It must write the element data to its standard output. The default value is
/usr/X11R6/lib/X11/pcb/QueryLibrary.sh %p %f %a
Pcb
uses the command specified
by this resource to list the contents of a library.
/usr/X11R6/lib/X11/pcb/ListLibraryContents.sh %p %fis the default.
PostScript
device. Predefined
values are a3, a4, a5, letter, tabloit,
ledger, legal, and executive.
The second way is to specify the medias width, height and margins in mil.
The resource defaults to a4 size.
%f
in the string. It must read the data from
its standard input. The default command is:
cat - > %fSee also, the command-line option -sfile.
XBell()
which sets the volume of the X
speaker.
The value lies in the range -100..100 and it defaults to the maximum volume of
100.
Refer also to section Command-Line Options.
All user accessible commands may be bound to almost any X
event. Almost
no default binding for commands is done in the binaries, so it is vital for the
application that at least a systemwide application resource file exists.
This file normally resides in the `X11/lib/app-defaults' directory and
is called `Pcb'. You can also execute any argument using the ":a" command
(see section User Commands).
The bindings to which the manual refers to are the ones as defined by the
shipped resource file.
Take special care about translations related to the functions keys and the
pointer buttons because most of the window managers use them too.
Change the file according to your hardware/software environment.
You may have to replace all occurances of baseTranslations to
translations if you use a X11R4
server.
Passing Object as an argument to an action routine causes the object at the cursor location to be changed, removed or whatever. If more than one object is located at the crosshair position the smallest type is used. If there are two of the same type the newer one is taken. SelectedObjects will handle all selected and visible objects.
None<Key>w: AddRats(AllRats) !Shift<Key>w: AddRats(SelectedRats) None<Key>o: DeleteRats(AllRats) AddRats(AllRats) !Shift<Key>o: DeleteRats(SelectedRats) AddRats(SelectedRats)
!Mod1<Key>s: Change2ndSize(Object, +5) !Mod1 Shift<Key>s: Change2ndSize(Object, -5)
None<Key>n: ChangeName(Object)
X
event (or use the :a user command). If value begins with
a + or - then the value will be added (or subtracted) from the current
size, otherwise the size is set equal to value. Range checking is
done to insure that none of the maximum/minimums of any size are violated.
If Object is passed then a single object at the cursor location is
changed. If any of the Selected arguments are passed then all selected
and visible objects of that type are changed. If the type being modified is
an element, then the thickness of the silkscreen lines defining the element
is changed.
Default:
None<Key>s: ChangeSize(Object, +5) !Shift<Key>s: ChangeSize(Object, -5)
None<Key>q: ChangeSquare(ToggleObject)
<Key>colon: Command()
!Shift<Key>c: Connection(Reset) None<Key>f: Connection(Find) !Shift<Key>f: Connection(Reset)
None<Key>e: DeleteRats(AllRats) !Shift<Key>e: DeleteRats(SelectedRats)
Pcb
is able to handle several labels of an element. One of them
is a description of the functionality (eg resistor), the second should be
a unique identifier (R1) whereas the last one is a value (100k).
The Display() action selects which of the names is displayed.
It also controls which name will be affected by the ChangeName command.
If ToggleGrid is passed, Pcb
changes between relative
('rel' in the statusline) and absolute grid (an 'abs' in the statusline).
Relative grid means the cursor position where the last change
of the grid setting occured is used as the grid origin; while (0,0) is used
in the absolute grid case.
Passing Pinout displays the pinout of the element at the current
cursor location whereas PinOrPadName toggles displaying of the
pins or pads name under the cursor. If none of them matches but the cursor
is inside of an element, the flags is toggled for all of its pins and pads.
For details about rubberbands see also the details about Mode.
Default:
None<Key>c: Display(Center) None<Key>d: Display(PinOrPadName) !Shift<Key>d: Display(Pinout) None<Key>r: Display(ClearAndRedraw)
!Ctrl<key>m: MarkCrosshair()
Pcb
is implemented by selecting a mode
and calling Mode(Notify). The arguments Line, Polygon,
Rectangle, Text and Via are used to create the
appropriate object whenever Mode(Notify) is called. Some of them,
such as Polygon, need more than one call for one object to be created.
InsertPoint adds points to existing polygons or lines.
Save and Restore are used to temporarily save the mode, switch
to another one, call Mode(Notify) and restore the saved one. Have
a look at the application resource file for examples.
Copy and Move modes are used to change an object's location and,
optionally, to create a new one. The first call of Mode(Notify) attaches
the object at the pointer location to the crosshair whereas the second
one drops it to the layout. The rubberband version of move performs the
move while overriding the current rubberband mode.
Passing PasteBuffer attaches the contents of the currently selected
buffer to the crosshair. Each call to Mode(Notify) pastes this contents
to the layout. Mode(Cycle) cycles through the modes available in the
mode-button pallete.
Mode(None) switches all modes off.
Default:
<Key>Escape: Mode(None) <Key>space: Mode(Cycle) None<Key>BackSpace: Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore) None<Key>Delete: Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore) None<Key>F1: Mode(Via) None<Key>F2: Mode(Line) None<Key>F3: Mode(PasteBuffer) None<Key>F4: Mode(Rectangle) None<Key>F5: Mode(Text) None<Key>F6: Mode(Polygon) None<Key>F7: Mode(Thermal) None<Key>Insert: Mode(InsertPoint) None<Key>[: Mode(Save) Mode(Move) Mode(Notify) None<Key>]: Mode(Notify) Mode(Restore) None<Btn1Down>: Mode(Notify) !Shift Ctrl<Btn1Down>: Mode(Save) Mode(Remove) Mode(Notify) Mode(Restore) None<Btn2Down>: Mode(Save) Mode(Move) Mode(Notify) None<Btn2Up>: Mode(Notify) Mode(Restore) !Mod1<Btn2Down>: Mode(Save) Mode(Copy) Mode(Notify) !Mod1<Btn2Up>: Mode(Notify) Mode(Restore) Shift Mod1<Btn2Down>: Mode(Save) Mode(RubberbandMove) Mode(Notify)
X
server's pointer follows because the necessary
events are generated by Pcb
. All movements are performed with respect
to the currently set grid value.
Default:
None<Key>Up: MovePointer(0, -1) !Shift<Key>Up: MovePointer(0, -10) None<Key>Down: MovePointer(0, 1) !Shift<Key>Down: MovePointer(0, 10) None<Key>Right: MovePointer(1, 0) !Shift<Key>Right: MovePointer(10, 0) None<Key>Left: MovePointer(-1, 0) !Shift<Key>Left: MovePointer(-10, 0)
None<Key>m: MoveToCurrentLayer(Object) !Shift<Key>m: MoveToCurrentLayer(SelectedObjects)
!Ctrl<Key>x: PasteBuffer(Clear) PasteBuffer(AddSelected) Mode(PasteBuffer) !Shift Ctrl<Key>x: PasteBuffer(Clear) PasteBuffer(AddSelected) RemoveSelected() Mode(PasteBuffer) !Shift<Key>1: PasteBuffer(1) !Shift<Key>2: PasteBuffer(2) !Shift<Key>3: PasteBuffer(3) !Shift<Key>4: PasteBuffer(4) !Shift<Key>5: PasteBuffer(5) None<Key>F3: Mode(PasteBuffer)
None<Key>p: Polygon(Close) !Shift<Key>p: Polygon(Close)
POSIX (extention) 8.3 filename --------------------------------------------- *_componentmask.* cmsk.* *_componentsilk.* cslk.* *_soldermask.* smsk.* *_soldersilk.* sslk.* *_drill.* dril.* *_groundplane.* gpl.* *_group[1..8].* [..8].*The output may be sent to a postprocessor by starting the filename with the pipe
("|")
character. Any "%f"
in a command is replaced
with the current filename. The function is available from the file menu.
There are no defaults.
<Message>WM_PROTOCOLS: Quit()
!Shift<Key>r: Redo()
None<Btn3Down>: Select(ToggleObject) !Mod1<Btn3Down>: Mode(Save) Mode(None) Select(Block) !Mod1<Btn3Up>: Select(Block) Mode(Restore)
None<Key>g: SetValue(Grid, +5) !Shift<Key>g: SetValue(Grid, -5) None<Key>l: SetValue(LineSize, +5) !Shift<Key>l: SetValue(LineSize, -5) None<Key>t: SetValue(TextScale, +10) !Shift<Key>t: SetValue(TextScale, -10) None<Key>v: SetValue(ViaSize, +5) !Shift<Key>v: SetValue(ViaSize, -5) !Mod1<Key>v: SetValue(ViaDrillingHole, +5) !Mod1 Shift<Key>v: SetValue(ViaDrillingHole, -5) None<Key>z: SetValue(Zoom, -1) !Shift<Key>z: SetValue(Zoom, +1)
None<Key>Tab: SwapSides()
None<Key>1: SwitchDrawingLayer(1) ... None<Key>8: SwitchDrawingLayer(8)
None<Key>h: ToggleHideName(Object) !Shift,Key>h: ToggleHideName(SelectedElements)
Pcb
allows you to recover
from most operations that materially affect you work.
Calling Undo() without any parameter recovers
from the last (non-undo) operation. ClearList is used to release the
allocated memory. ClearList is called whenever a new layout is started
or loaded. See also Redo.
Default:
None<Key>u: Undo() !Shift Ctrl<Key>u: Undo(ClearList)
!Shift Mod1<Btn3Down>: Mode(Save) Mode(None) Unselect(Block) !Shift Mod1<Btn3Up>: Unselect(Block) Mode(Restore)
This section covers all default translations of key and button events as
defined in the shipped default application resource file. Most of them have
already been listed in section Actions. Pcb
makes use of a nice X11
feature; calling several action routines for one event.
All files used by Pcb
are read from the standard output of a command
or written to the standard input of one as plain seven bit ASCII
. This
makes it possible to use any editor to change the contents of a layout file.
It is the only way for element or font description files to be created.
To do so you'll need to study the example files `example/*' and
`default_font' which are shipped with Pcb
.
For an overview refer to section Introduction.
The following sections provide the necessary information about the syntax of
the files.
Netlist files are not created by Pcb
, but it does use them. For information
on the format of a netlist file see the :rn,
section User Commands. Rat lines are added on the current layer using the current
The commands described allow you to add almost any additional
functionality you may need. Examples are compressed read and write access as
well as archives. The commands themselves are defined by the resources
elementCommand, fileCommand, fontCommand,
libraryCommand, libraryContentsCommand and saveCommand.
Note that the commands are not saved along with the data.
It is considered an advantage to have the layout file contain all necessary
information, independent of any other files.
One thing common to all files is they may include comments, newlines, and carriage returns at any place except within quoted strings.
Here are the basic type definitions used in the other sections of this chapter.
Description = Name DeltaAngle = Number DrillingHole = Number Flags = Number FontPosition = Number Grid = Number GridOffsetX = Number GridOffsetY = Number Group = GroupMember [,GroupMember]... GroupMember = decimal | [cs] GroupString = """ Group [:Group]... """ Height = Number LayerNumber = Number LayoutName = Name Name = quoted_string Number = decimal | hex Spacing = Number StartAngle = Number SymbolID = Number | charconst Thickness = Number TextData = quoted_string TextFlags = Flags TextScale = scale TextX = Number TextY = Number Value = Name Width = Number X = Number X1 = Number X2 = Number Y = Number Y1 = Number Y2 = Number charconst = "'" <any character> "'" comment = "#" {<any character up to a newline>}... decimal = [0-9]+ direction = [0-3] hex = 0x[0-9a-fA-F]+ scale = [1-<positive integer>] quoted_string = """ <anything except \n and \r> """ zoom = [0-MAX]
The layout file describes a complete layout including symbols, vias, elements and layers with lines, rectangles and text. This is the most complex file of all.
File = Header Font PCBData Header = PCBName [GridData] [CursorData] [PCBFlags] [Groups] PCBName = "PCB(" Name Width Height ")" GridData = "Grid(" Grid GridOffsetX GridOffsetY ")" CursorData = "Cursor(" X Y zoom ")" PCBFlags = "Flags(" Flags ")" Groups = "Groups(" GroupString ")" Font = {FontData}... FontData = {Symbol}... Symbol = "Symbol(" SymbolID Spacing ")" "(" {SymbolData}... ")" SymbolData = {SymbolLine}... SymbolLine = "SymbolLine(" X1 Y1 X2 Y2 Thickness ")" PCBData = {Via | Layer | Element}... Via = "Via(" X Y Thickness DrillingHole Name Flags ")" Element = "Element(" Flags Description LayoutName Value \ TextX TextY direction scale TextFlags")" "(" {ElementData}... [Mark] ")" ElementData = {ElementLine | Pad | Pin | ElementArc }... ElementArc = "ElementArc(" X Y Width Height StartAngle DeltaAngle Thickness ")" ElementLine = "ElementLine(" X1 Y1 X2 Y2 Thickness ")" Mark = "Mark(" X Y ")" Pad = "Pad(" X1 Y1 X2 Y2 Thickness Name Flags")" Pin = "Pin(" X Y Thickness DrillingHole Name Flags ")" Layer = "Layer(" LayerNumber Name ")" "(" {LayerData}... ")" LayerData = {Line | Polygon | Text}... Line = "Line(" X1 Y1 X2 Y2 Thickness Flags")" Polygon = "Polygon(" Flags ")" \ "(" {Points}... ")" Points = "(" X Y ")" Text = "Text(" X Y direction scale TextData Flags")"
bit 4: do rubberband moves and rotates if set bit 5: display description of elements if set bit 6: display unique name of an element if set bit 7: use absolute grid if set bit 8: don't clip lines to 45 degrees
bit 0: always clear bit 1: always set bit 2: set if via was found during a connection search bit 5: display the vias name bit 6: via has been selected Other bits have special meaning and should not be changed by the user. See const.h for more information
bit 2: set if line was found during a connection search bit 4: line is a rat-line bit 6: line has been selected
bit 2: set if polygon was found during a connection search bit 4: polygon is a 1.5 style polygon that automatically clears pins bit 6: polygon has been selected
bit 6: the text has been selected bit 7: the text is on the solder (back) side of the board bit 10: the text is on the silkscreen layer
Element files are used to describe one component which then may be used
several times within one or more layouts. You will normally split the
file into two parts, one for the pinout and one for the package description.
Using m4
allows you to define pin names as macros in one file and
include a package description file which evaluates the macros. See
the resource elementCommand for more information. The pins (and pads)
must appear in squential order in the element file (new in 1.5) so that
pin 1 must be the first PIN(...) in the file.
Doing things this way makes it possible to use one package file for several different circuits. See the sample files `dil*'.
The lowest x and y coordinates of all subobjects of an element are used as an attachment point for the crosshair cursor of the main window.
File = {Element}... Element = "Element(" Flags Description LayoutName Value \ TextX TextY direction scale TextFlags")" "(" {ElementData}... [Mark] ")" ElementData = {ElementLine | Pad | Pin | ElementArc }... ElementArc = "ElementArc(" X Y Width Height StartAngle DeltaAngle Thickness ")" ElementLine = "ElementLine(" X1 Y1 X2 Y2 Thickness ")" Mark = "Mark(" X Y ")" Pad = "Pad(" X1 Y1 X2 Y2 Thickness Name Flags")" Pin = "Pin(" X Y Thickness DrillingHole Name Flags ")"
bit 4: the element name is hidden bit 6: element has been selected bit 7: element is located on the solder side
bit 2: set if pad was found during a connection search bit 5: display the pads name bit 6: pad has been selected bit 7: pad is located on the solder side
bit 0: always set bit 1: always clear bit 2: set if pin was found during a connection search bit 5: display the pins name bit 6: pin has been selected bit 8: pin is drawn as a square bit 10: set if the pin is member of the groundplane
A number of user defined symbols are called a font. There is only one per layout. All symbols are made of lines. See the file `default_font' as an example.
The lowest x and y coordinates of all lines of a font are transformed to (0,0).
File = Font Font = {FontData}... FontData = {Symbol}... Symbol = "Symbol(" SymbolID FontPosition ")" "(" {SymbolData}... ")" SymbolData = {SymbolLine}...
ASCII
code of the symbol and its distance to
the next symbol. Undefined symbols are drawn as filled rectangles.
The ASCII
code may be passed as a character constant or as a hexadecimal
value.
There is nothing like a special library format. The ones that have been
introduced in 1.4.1 just use some nice (and time consuming) fetures of GNU
m4
. The only predefined format is the one of the contents file
which is read during startup. It is made up of two basic line types:
menu entry = "TYPE="name contents line = template":"package":"value":"description name = String template = String package = String value = String description = String String = <anything except ":", "\n" and "\r">
No leading whitespaces or comments are allowed in this file. If you need either one, define a command that removes them before loading. Have a look to the libraryContentsCommand resource.
The menu entry will appear in the selection menu at the top and of the library window.
This section provides an overview about the existing m4
definitions
of the elements. There are basically two different types of files. One
to define element specific data like the pinout, package and so on, the
other to define the values. For example the static RAM circuits 43256 and
62256 are very similar. They therefore share a common definition in the
macro file but are defined with two different value labels.
The macro file entry:
define(`Description_43256_dil', `SRAM 32Kx8') define(`Param1_43256_dil', 28) define(`Param2_43256_dil', 600) define(`PinList_43256_dil', "pin1', `pin2', ...')
And the list file:
43256_dil:N:43256:62256
The macro must define a description, the pin list and up to two additional parameters that are passed to the package definitions. The first one is the number of pins whereas the second one defines for example the width of a package.
It is very important to select a unique identifier for each macro. In the example this would be 43256_dil which is also the templates name. It is required by some low-level macros that Description_, Param1_, Param2_ and PinList_ are prepended.
The list file uses a syntax:
template:package:value[:more values]
This means that the shown example will create two element entries with the sam package and pinout but with different names.
A number of packages are defined in `common.m4'. Included are:
DIL packages with suffix D, DW, J, JD, JG, N, NT, P PLCC TO3 generic connectors DIN 41.612 connectors zick-zack (SD suffix) 15 pin multiwatt
If you are going to start your own library please take care about m4
functions. Be aware of quoting and so on and, most important check your
additional entry by calling the macro:
CreateObject(`template', `value', `package suffix')
If quoting is incorrect an endless loop may occur (broken by a out-of-memory message).
The scripts in the `lib' directory handle the creation of libraries as well as of their contents files. Querying is also supported.
I know quiet well that this description of the library implementation is not what some out there expect. But in my opinion it's much more useful to look at the comments and follow the macros step by step.
Compiling and installing the package should be straightforward. If any problems occur, please contact the author (Thomas.Nau@rz.uni-ulm.de) to find a solution and include it into the next release.
This section covers the steps which are necessary to compile the package.
Most X11
related options are automatically covered by imake
which is called from xmkmf
. The ones special to Pcb
have to be edited in `config.h'.
In order of appearance:
X11
s config files. Define this as follows:
EXTRA_INCLUDES = -I/usr/openwin/share/includeThis is probably true for Suns which use
OpenWindows
.
EXITCALL = -DHAS_ATEXIT if atexit() is supported (SYSV) EXITCALL = -DHAS_ON_EXIT if on_exit() and no atexit() is supported EXITCALL = if none of them is supportedPlease check your manpages for details.
If you have to make system dependent changes please include them into a #ifdef Architecture ... #endif construct and mail a copy to the author (Thomas.Nau@rz.uni-ulm.de).
Now run xmkmf -a
which creates the `Makefiles' and runs
make depend
. This should finish without any problems except some
systems which complain about missing include files. Don't worry about any
such warnings at this time, the package should compile without any problems.
After xmkmf -a
has created the new `Makefile' you are able to
create the manpages, the application resource, the info file, the
TeX
output and a reference card by executing
(cd doc; make) (cd src; make Pcb.ad)
You'll need TeX
, texindex
and, if you want PostScript
,
dvips
to build the manuals. Preformatted documentation for the
default configuration may be found in the `./doc.ps' directory.
A simple make builds everything.
Generate a printed copy to make your life easier.
TeX-3.0
failed, TeX-3.14
worked just fine.
After reaching this point, it is time for make
. It should build
everything without any errors.
If it doesn't refer to section Troubleshooting.
You have to be root to install the package or at least a user with
the appropriate priveleges in some X11
directories. Set the umask to
022 or else some files will not be found because the directory isn't
world readable.
If you do not have the appropriate permissions you should run
`./pcbtest.sh' in the `src' directory to run Pcb
from
the installation directory.
make install
and make install.man
install the program,
the fonts, the application default resource file, all element and package
data as well as the manpage into the X11
directories.
make install.info
does the same for the GNU
info file.
There are some known problems. Most of them are related to
missing parts of a standard X11
distribution. Some others are caused by
third party applications such as X
servers. To make this list more
complete please mail your problems and, if available, solutions to the author.
The mail address may be found at the beginning of this chapter.
In any case, read section Problems related to X11.
By the way, you MUST HAVE AN ANSI COMPILER
to make Pcb
work.
If the shell script create_sed_script.sh
fails with an error
of awk
check your system for nawk
or get the GNU gawk
.
See the script for details.
Another source of problems are older versions of flex
and bison
.
Pcb
definitely works with flex-2.4.7
and bison-1.22
or
later. The problems will result in a syntax error while parsing files.
You will have to add -lfl to the SYS_LIBRARIES identifier in
`Imakefile'. See also, section FreeBSD and NetBSD.
The following list gives you just an idea because I'm not able to test
all Pcb
releases on all platforms.
X11R4
, X11R5
, and OpenWindows
You have to install several X11
tools (imake
) and include files
or, better, install a complete X11R5
release. Hewlett-Packard doesn't
support the Athena Widgets. So the header files and libraries are missing
from the application media, but they are available as a patch.
They also do not ship the ANSI
compiler with the normal operating
system release so you have to buy one or use GCC
.
Some of the tools are available as patches.
In addition, Pcb
has been successfully tested on these platforms with
HPUX 9.*, 10.*
running self-compiled X11R5
.
There are no known problems with Sun machines if they use X11R5
instead
of OpenWindows
. Pcb
compiled successfully with all kinds of
SPARCstations Solaris-2.[345]
.
For problems with OpenWindows
refer to section Problems related to X11.
If xmkmf
is missing, try
/usr/openwin/bin/imake -DUseInstalled -I/usr/openwin/lib/config make Makefile make includes make depend
instead. I got it compiled but the linker complained about missing symbols.
The problem may be related to the mixed OpenWindows
- X11R5
environment which is installed on the test machine.
Anyway the code was executable and I haven't got a core yet.
Pcb
has been tested on some boxes running either IRIX-4.0.5
or
IRIX-5.3
. The former one uses a X11R4
server.
There are no problems except some additionally needed
compiler flags. For known problems
with X11R4
, see section Problems related to X11. Check `Imakefile', too.
Pcb
compiled and runs without problems on DEC UNIX V3.2c
if you
do the following instead of calling xmkmf -a
:
xmkmf make Makefiles make includes make depend
John DuBois <spcecdt@deeptht.armory.com> wrote:
SCO-ODT-3.0
requires the latest version of tls003, the Athena
widget library (available from sosco.sco.com). The main problems
I have encountered are it core dumps fairly often, especially
while loading/dropping elements...
I'll see what I am able to do as soon as I have access to an SCO
system.
Since the X11
version of Pcb
has been developed on a Linux
system here are no known problems.
If Pcb
complains about syntax errors even in the demo files get
rid of your lex
and yacc
implementation. Replace them by
GNU flex
and bison
. Don't forget to change the SYS_LIBRARIES
in `Imakefile' from -ll to -lfl. You also need to define:
YACC = bison -y LEX = flex
There are a some problems related to X11R4
or systems derived from
X11
such as OpenWindows
. See section Sun SPARC architecture. You at least have to change
all occurances of baseTranslations in the resource files to
translations if you are using a X11R4
server. Look at the
X11R5
Intrinsics manual for details.
The panner widget (print dialog box) appears only in release X11R5
and
later. It really simplifies adjusting the offsets.
With earlier releases the printout will always appear in the center of the
page.
You may have some problems in a mixed X11-OpenWindows
environment.
If you want to try it anyway you have to add an additional path for
include files and define another symbol in `Imakefile',
EXTRA_INCLUDES = -I/usr/openwin/include
Pcb
has been tested successfully with X11R6
under Linux 1.1.59
and later.
If your TeX
installation complains about a missing `texinfo.tex'
file copy the one included in this release (directory `doc'
to your TeX
macro directory.
Note, there are probably newer versions of this file available from some
FTP sites.
TeX-3.0
failed, TeX-3.14
worked just fine. Check our FTP server
ftp.uni-ulm.de for ready-to-print versions of the manuals.
Pcb
This document was generated on 1 January 1998 using the texi2html translator version 1.51.