Board File format. PCBNEW
Rubriques:
Files are in ascii format.
First line is something as:
PCBNEW-BOARD Version 0 date 5/1/2005-14:45:23
All the following descriptions are like this:
$DESCRIPTION
some
data
...
$endDESCRIPTION
Example:
$GENERAL
Ly 1FFF8001
Links
66
NoConn 0
Di 24940 20675 73708 40323
Ndraw 16
Ntrack
267
Nzone 1929
Nmodule 29
Nnets 26
$EndGENERAL
$SHEETDESCR
Sheet
A4 11700 8267
Title ""
Date "23 feb 2004"
Rev
""
Comp ""
Comment1 ""
Comment2
""
Comment3 ""
Comment4 ""
$EndSHEETDESCR
Tracks
and other items (texts, drawings ...) use one layer.
Pads
and vias use several layers.
There are 16 copper layers and 12
technical layers.
The layer parametre used in descriptions
has the value:
value |
layer name |
"Copper" layers |
0 |
Copper layer |
|
1 to 14 |
Inner layers |
|
15 |
Component layer |
|
16 |
Copper side adhesive layer |
Technical layers |
17 |
Component side adhesive layer |
|
18 |
Copper side Solder paste layer |
|
19 |
Component Solder paste layer |
|
20 |
Copper side Silk screen layer |
|
21 |
Component Silk screen layer |
|
22 |
Copper side Solder mask layer |
|
23 |
Component Solder mask layer |
|
24 |
Draw layer (Used for general drawings) |
|
25 |
Comment layer (Other layer used for general drawings) |
|
26 |
ECO1 layer (Other layer used for general drawings) |
|
27 |
ECO2 layer (Other layer used for general drawings) |
|
28 |
Edge layer. Items on Edge layer are seen on all layers |
Mask layer:
Sometimes, a mask layer parameter is used.
It is a 32 bits mask used to indicate a layer group usage (0 up to 32 layers).
A mask layer parameter is given in hexadecimal form.
Bit 0 is the copper layer, bit 1 is the inner 1 layer, and so on...(Bit 27 is the Edge layer).
Mask layer is the ORed mask of the used layers
Format:
PCBNEW-BOARD Version <version number> date <date>-<time>
Date and time are useful only for information (not used by pcbnew).
This data is useful only when loading file.
It is used by pcbnew for displaying activity when loading data.
$GENERAL |
Start description |
Ly 1FFF8001 |
Obsolete (used for old pcbnew compatibility) |
Links 66 |
Total number of connections |
NoConn 0 |
Remaining connections |
Di 24940 20675 73708 40323 |
|
Ndraw 16 |
Number of draw items like eged segments, texts... |
Ntrack 267 |
Number of track segments |
Nzone 1929 |
Number of zone segments |
Nmodule 29 |
Number of modulss |
Nnets 26 |
Number of nets |
$EndGENERAL |
End description |
This the page size and texts.
$SHEETDESCR |
Start description |
Sheet A4 11700 8267 |
<Page size> X_size Y_size |
Title "" |
Title text |
Date "23 feb 2004" |
Date text |
Rev "" |
Revision text |
Comp "" |
Company name text |
Comment1 "" |
Comment text, line 1 |
Comment2 "" |
Comment text, line 2 |
Comment3 "" |
Comment text, line 3 |
Comment4 "" |
Comment text, line 4 |
$EndSHEETDESCR |
End description |
This data bock is used for design settings
This is useful only for board edition.
$SETUP |
Start block "SETUP" |
InternalUnit 0.000100 INCH |
|
GridSize 500 500 |
Current grid X Y size (500 x 500 units) |
|
Y and Y user grid size, in mm or inches, NOT in internal units |
ZoneGridSize 100 |
Grid used for zone filling (100 units, i.e 0.01 inch) |
Layers 2 |
|
TrackWidth 250 |
Current track width |
TrackWidthHistory 170 |
Last used track widths |
TrackWidthHistory 250 |
|
TrackWidthHistory 400 |
|
TrackClearence 100 |
Isolation for DRC (Design rules check) |
ZoneClearence 200 |
Isolation used in zone filling |
DrawSegmWidth 120 |
Current segment width for drawings on technical layers |
EdgeSegmWidth 120 |
Current segment width for drawings on "edge layer" |
ViaSize 700 |
Current via size |
ViaDrill 250 |
Via drill for this board |
ViaSizeHistory 450 |
Last used via sizes |
ViaSizeHistory 650 |
|
ViaSizeHistory 700 |
|
TextPcbWidth 120 |
Current text width for texts on copper or technical layers. This is not for text on footprints |
TextPcbSize 600 600 |
Current text X Y size |
EdgeModWidth 120 |
Current Segment width for footprint edition |
TextModSize 120 600 |
Current text XY size for texts for footprint edition |
TextModWidth 120 |
Current text width for texts for footprint edition |
PadSize 700 700 |
Current X Y pad size (footprint edition) |
PadDrill 320 |
Current pad drill |
AuxiliaryAxisOrg 0 0 |
|
$EndSETUP |
End block "SETUP" |
$EQUIPOT describes a net name.
$EQUIPOT |
Start block |
Na 2 "N-000026" |
Na <internal net number> « net name » |
St ~ |
|
$EndEQUIPOT |
End block |
Note1:
Internal net number is an arbitrary number.
It is computed by pcbnew when compiling netlist.
Note2:
Net 0 is not a real net.
Net 0 is the net number used internally by pcbnew for all the no connected pads.
Example:
$EQUIPOT;
Na 0 ""
St ~
$EndEQUIPOT$EQUIPOT
Na 1 "DONE"
St ~
$EndEQUIPOT
$EQUIPOT
Na 2 "N-000026"
St ~
$EndEQUIPOT
$EQUIPOT
Na 3 "TD0/PROG"
St ~
$EndEQUIPOT
Decription =start by:
$MODULE <module name>
And ends with
$EndMODULE <module name>
Module description has four sections:
General description (fixed size)
Field description (variable size)
Drawing description (variable size)
Pad description. (variable size)
3D shape informations.
Note:
All coordinates are relative to the module position.
Its means the coordinates of segments, pads, texts ... are given for a module in position 0, rotation 0.
If a module is rotated or mirrored, real coordinates must be computed according to the real position and rotation.
$MODULE bornier6 |
$MODULE <module lib name> |
Po 62000 30500 2700 15 3EC0C28A 3EBF830C ~~ |
|
Li bornier6 |
Li <module lib name> |
Cd Bornier d'alimentation 4 pins |
Cd comment description (displayed when browsing libraries) |
Kw DEV |
Kw Keyword1 Keyword2 ... (for footprint selection by keywords) |
Sc 3EBF830C |
Sc TimeStampOp |
Op 0 0 0 |
|
Note:
Usually, components are on layer 15 (component layer) or 0 (copper layer).
If the component is on layer 0, it is"mirrored". The "mirror axis is the X axis
There are 2 to 12 fields
Field 0 = component reference (U1, R5 ...) (required)
Field 1 = component value (10K, 74LS02 ...) (required)
Other fields (optional) are comments.
Format:
T<field number> Xpos Ypos Xsize Ysize "text"
T0 500 -3000 1030 629 2700 120 N V 21 "P1" |
|
T1 0 3000 1201 825 2700 120 N V 21 "CONN_6" |
T1 = value |
Tells how to draw module shape.
Drawings are segment, circle, arc.
DS -6000 -1500 -6000 1500 120 21 |
|
DS 6000 1500 6000 -1500 120 21 |
An other Draw Segment |
Other Drawings are:
DC ox oy fx fy w |
|
DA x0 y0 x1 y1 angle width layer |
|
All the pads of this footprint are listed here (Many $PAD/$EndPAD sections here)..
See $PAD description.
3D shape informations:
The real shape description is a vrml file, build by Wings3d.
This shape can be scaled, moved and rotated.
This is because a single 3D shape can be used for many footprints (for instance, we use the shape resistor.wrl for several resistor footprints, by tuning the X, Y, Z scale of the 3D shape according to the different size of resistor footprints).
Some smd footprints are using this feature.
For the same reasons, the 3D shape can be moved (by the move factor) and/or rotated.
Real shape unit is 0.1 inch (1 unit vrml = 0.1 inch = 2.54 millimeter).
An other reason exists: when a footprint is very big ( a big connector) or very small (a small SMD resitor) whe must create a 3D shape small or bigger than real size, in order to use easily the 3D modeler.
$SHAPE3D |
Start description |
Na "device/bornier_6.wrl" |
FileName (default path is kicad/modules/packages3d/) |
Sc 1.000000 1.000000 1.000000 |
X Y Z scale factor |
Of 0.000000 0.000000 0.000000 |
X Y Z offset (move vector, in 3D units (0.1 inch)) |
Ro 0.000000 0.000000 0.000000 |
X Y Z rotation (in degree) |
$EndSHAPE3D |
End description |
The 3D shape coordinates are relative to the footprint coordinates.
The 3D shape must be scale, moved and rotated according to the parameters Sc Of and Ro,
and after moved and rotated according to the footprint coordinates and rotation.
If the footprint is « inverted » (that is, located on copper side) the 3D shape must be « inverted » too.
Note:
A footprint may have several 3D shapes (for instance an integrated circuit and his socket).
Pads have different shapes and attributes.
Pad shapes are:
Circle.
Oblong(or oval).
Rectangular (Square is like a rectangle).
Trapeze.
Pad attributes are:
Normal (Has usualy a hole)
Smd (used for Surface Mounted Devices). Has no hole.
Connector (used for connectors like a PC Board Bus connector)
Mechanical. (Like a hole for mechanical use)
And shape can be draw with an offset related to the drilling hole.
$PAD |
Start description |
Sh "2" C 1500 1500 0 0 2700 |
Shape: <pad name> shape Xsize Ysize Xdelta Ydelta Orientation |
Dr 600 0 0 |
Drill <Pad drill> Xoffset Yoffset |
At STD N 00E0FFFF |
Attributs: <Pad type> N <layer mask> |
Ne 8 "GND" |
Net reference of the pad: <netnumber> <net name> |
Po -3000 0 |
X_pos Y_pos (relative to the module position) |
$EndPAD |
End description |
Note:
<Pad type> is the Pad Attribute. It is one of: "STD" "SMD" "CONN" "HOLE" "MECA".
Shape is one of:
C (circle)
R (Rectangular).
O (Oblong)
T (Trapèze)
Example:
$PAD
Sh "3" C 1500 1500 0 0 2700
Dr 600 0 0
At STD N 00E0FFFF
Ne 10 "TD0_1"
Po -1000 0
$EndPAD
There are drawing items like segments, circles, texts, targets and cotations.
Draw segments are :
segments (strait line)
circles
arcs
$DRAWSEGMENT |
Start description |
Po 0 67500 39000 65500 39000 120 |
Position shape Xstart Ystart Xend Yend width |
De 28 0 900 0 0 |
Description layer type angle timestamp status |
$EndDRAWSEGMENT |
End description |
Note:
shape = 0
Angle is used only for arc segments (unused for line, left for compatibility).
$DRAWSEGMENT |
Start description |
Po 1 67500 39000 65500 39000 120 |
Position shape Xcentre Ycentre Xend Yend width |
De 28 0 900 0 0 |
Description layer type angle timestamp status |
$EndDRAWSEGMENT |
End description |
Note:
shape = 1
Angle is used only for arc segments (unused for circle, left for compatibility).
End is a point of this circle. (If Xend or Yend is 0, the other coordinate is the radius)
$DRAWSEGMENT |
Start description |
Po 2 67500 39000 65500 39000 120 |
Position shape Xstart Ystart Xend Yend width |
De 28 0 900 0 0 |
Description layer type angle timestamp status |
$EndDRAWSEGMENT |
End description |
Note:
shape = 2
start and end are the 2 points of the arc. angle is the arc angle (in 0.1 degree). Center coordinates are computed by pcbnew from start, end and angle.
Currently, only 90 degrees arcs are supported.(thereby, angle = 900)
Example:
$DRAWSEGMENT
Po 0 67500 34000 67500 39000 120
De 28 0 900 0 0
$EndDRAWSEGMENT
Example:
$TEXTPCB |
Start description |
Te "TDI" |
Text "string" |
Po 57250 35750 600 600 150 0 |
Position Xstart Ystart Xsize Ysize rotation |
De 15 1 0 0 |
|
$EndTEXTPCB |
End description |
Example:
$TEXTPCB
Te "TCK"
Po 57250 33500 600 600 150 0
De 15 1 0 0
$EndTEXTPCB
|
shape 1 |
|
shape 0 |
$MIREPCB |
Start description |
Po 0 28 28000 51000 5000 150 00000000 |
Position shape Xpos Ypos size width timestamp |
$EndMIREPCB |
End description |
$COTATION |
Start description |
Ge 0 24 0 |
|
Te "4,5500''" |
|
Po 50250 5791 600 800 170 0 1 |
Position (for text) Xpos Ypos Xsize Ysize width orient normal |
Sb 0 27500 6501 73000 6501 150 |
Coordinates of segments (axis, arrows...) |
Sd 0 73000 9000 73000 5081 150 |
|
Sg 0 27500 9000 27500 5081 150 |
|
S1 0 73000 6501 72557 6731 150 |
|
S2 0 73000 6501 72557 6271 150 |
|
S3 0 27500 6501 27943 6731 150 |
|
S4 0 27500 6501 27943 6271 150 |
|
$EndCOTATION |
End description |
Track section decribes tracks and vias on copper layers.
Each track (or via) has a two line descrition:
For a track segment:
Position shape Xstart Ystart Xend Yend width
Description layer 0 netcode timestamp status
Shape parameter is set to 0 (reserved for future changes).
For a via:
Position shape Xstart Ystart Xend Yend diameter
Description layer 1 netcode timestamp status
For a via, layer parameter gives :
On the 4 less significant bits: the starting layer of the via
On the 4 next bits: the ending layer.
For instance, a via starting at copper kayer (layer 0) end ending at component layer (layer 15 has the layer parametre set to F0 hexadecimal or 240 decimal.
Shape parameter is the via type (through = 3, blind = 2, buried = 1)
Timestamp parameters are set to 0 (reserved for future changes).
Status parameter can be set to 0 (Used internally for routing infos)..
$TRACK |
Start description |
Po 0 36750 37000 36550 37000 250 |
|
De 15 0 1 0 400 |
|
Po 0 39000 36750 38750 37000 250 |
An other track |
De 15 0 1 0 0 |
|
Po 3 53500 27000 53500 27000 650 |
This is a via (via "through") from layer 15 (component) to layer 0 (copper) |
De 15 1 14 0 0 |
|
$EndTRACK |
End description |
Zone section is like track section. (There is no via in Zone section).
$ZONE |
Start description |
Po 0 67100 33700 67100 38600 100 |
Same as track description |
De 0 0 2 3EDDB09D 0 |
|
$EndZONE |
End description |
$EndBOARD terminates the whole board description.
Must be the last line.
Page -