aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2018-04-24 10:58:05 +0200
committerFredrik Thulin <fredrik@thulin.net>2018-04-24 10:58:05 +0200
commit0900cae0efc7485fbf92480588e1835cbe4353b2 (patch)
treefee739b6ea586d544acb403a7c8c0a88ff3dd3d8
parentb5fb3c639793a7f3fb9cbc1bc252ab7375f6b05f (diff)
ERC fixes
-rw-r--r--.gitignore1
-rwxr-xr-xconvert.sh4
-rwxr-xr-xfix-pcb.py20
-rw-r--r--rev03-KiCad/Cryptech Alpha.kicad_pcb27
4 files changed, 26 insertions, 26 deletions
diff --git a/.gitignore b/.gitignore
index 58e05f4..9df8473 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ tmp
*.kicad_pcb-bak
*.bak
*-cache.lib
+*saved*
diff --git a/convert.sh b/convert.sh
index 0f4fa25..bfdcfe7 100755
--- a/convert.sh
+++ b/convert.sh
@@ -69,8 +69,10 @@ cd ${kicaddir}
rename 's/-SchDoc//' rev02_*
sed -i -e 's/-SchDoc//g' *.{sch,lib}
-# Change some PCB parameters
+# Change some PCB parameters. Haven't figured out how to set global defauls in fix-pcb.py yet.
sed -i -e 's/trace_min 0.254/trace_min 0.15/g' "Cryptech Alpha.kicad_pcb"
+sed -i -e 's/[(]via_min_drill 0.508/(via_min_drill 0.25/g' "Cryptech Alpha.kicad_pcb"
+sed -i -e 's/[(]via_min_size 0.889/(via_min_size 0.5/g' "Cryptech Alpha.kicad_pcb"
# show ratsnest
sed -i -e 's/visible_elements 7FFFF77F/visible_elements 7FFFFF7F/g' "Cryptech Alpha.kicad_pcb"
# Power layers
diff --git a/fix-pcb.py b/fix-pcb.py
index 52dc67f..3f0b0c8 100755
--- a/fix-pcb.py
+++ b/fix-pcb.py
@@ -15,7 +15,7 @@ def remove_tracks(board, layer):
in KiCAD.
"""
for this in [x for x in board.GetTracks() if x.GetLayerName() == layer]:
- print('Removing track {} on Layer 4'.format(this))
+ print('Removing track {} on {}'.format(this, layer))
board.Delete(this)
#def set_tracks_width(board, layer, width):
@@ -111,7 +111,6 @@ def show_via_widths(board):
def change_netclass_drill_size(board, from_, to_):
- #help(board.GetDesignSettings())
names = board.GetAllNetClasses()
for name, net in names.iterator():
if net.GetViaDrill() == pcbnew.FromMM(from_):
@@ -258,11 +257,26 @@ def fix_layer_B_aka_GBL(board):
layer_zone_fixes(board, 'B.Cu', gnd_clearance=0.15)
+def fix_layer_Dwgs_User(board):
+ """
+ The Dwgs.User layer has three extra pin-1 marking for the ARM and the two SDRAM chips,
+ as well as chip outlines for the same chips as 'segments'. KiCad gets confused by this
+ and doesn't render the segments (probably since they are copper on a non-copper layer).
+
+ They cause ERC warnings so we remove them.
+ """
+ for this in [x for x in board.GetDrawings() if x.GetLayerName() == 'Dwgs.User']:
+ print("Removing drawing on Dwgs.User: {}".format(this))
+ board.Delete(this)
+ remove_tracks(board, 'Dwgs.User')
+
+
def main(in_fn='rev03-KiCad/convert.kicad_pcb', out_fn='rev03-KiCad/Cryptech Alpha.kicad_pcb'):
board = pcbnew.LoadBoard(in_fn)
# normalize contents to be able to use diff to show changes made
pcbnew.SaveBoard(in_fn + '.before-fix-pcb', board)
+ # Copper layers
fix_layer_F_aka_GTL(board)
fix_layer_In1_aka_GP1(board)
fix_layer_In2_aka_G1(board)
@@ -271,6 +285,8 @@ def main(in_fn='rev03-KiCad/convert.kicad_pcb', out_fn='rev03-KiCad/Cryptech Alp
fix_layer_In5_aka_G2(board)
fix_layer_In6_aka_GP4(board)
fix_layer_B_aka_GBL(board)
+ # Non-copper layers
+ fix_layer_Dwgs_User(board)
change_via_drill_size(board, 1.0, 0.5)
# Changing these via widths minimizes diff on layer In1/GP1, but creates diff on
diff --git a/rev03-KiCad/Cryptech Alpha.kicad_pcb b/rev03-KiCad/Cryptech Alpha.kicad_pcb
index 155ef73..3ab76c0 100644
--- a/rev03-KiCad/Cryptech Alpha.kicad_pcb
+++ b/rev03-KiCad/Cryptech Alpha.kicad_pcb
@@ -2,8 +2,8 @@
(general
(thickness 1.6)
- (drawings 6665)
- (tracks 9205)
+ (drawings 6662)
+ (tracks 9189)
(zones 0)
(modules 386)
(nets 304)
@@ -49,8 +49,8 @@
(edge_width 0.1)
(via_size 0.889)
(via_drill 0.25)
- (via_min_size 0.889)
- (via_min_drill 0.508)
+ (via_min_size 0.5)
+ (via_min_drill 0.25)
(uvia_size 0.508)
(uvia_drill 0.127)
(uvias_allowed no)
@@ -14434,9 +14434,6 @@
(gr_arc (start 77.9399 -30.718) (end 77.9526 -30.4132) (angle -175.2281119) (layer B.SilkS) (width 0.1524))
(gr_arc (start 74.9204 -38.6264) (end 75.0454 -38.6264) (angle -360) (layer B.SilkS) (width 0.0625))
(gr_arc (start 76.9204 -39.6264) (end 77.2204 -39.6264) (angle -360) (layer B.SilkS) (width 0.15))
- (gr_arc (start 35.5918 -19.5136) (end 36.0918 -19.5136) (angle -360) (layer Dwgs.User) (width 0.1))
- (gr_arc (start 76.4204 -39.5264) (end 76.9204 -39.5264) (angle -360) (layer Dwgs.User) (width 0.1))
- (gr_arc (start 90.4204 -39.5264) (end 90.9204 -39.5264) (angle -360) (layer Dwgs.User) (width 0.1))
(gr_arc (start 8.69626 42.65333) (end 9.54293 42.65333) (angle -360) (layer Eco2.User) (width 0.254))
(gr_line (start 22.42 -30.02) (end 22.42 -30.8) (layer F.SilkS) (width 0.15))
(gr_line (start 21.875 -29.475) (end 22.42 -30.02) (layer F.SilkS) (width 0.15))
@@ -28388,22 +28385,6 @@
(segment (start 38.50639 -13.7922) (end 39.82857 -12.47003) (width 0.3) (layer In5.Cu) (net 206))
(segment (start 19.52 -32.015) (end 22.305 -34.8) (width 0.15) (layer In5.Cu) (net 292))
(segment (start 22.305 -34.8) (end 35.475 -34.8) (width 0.15) (layer In5.Cu) (net 292))
- (segment (start 44.9534 -57.3848) (end 67.9534 -57.3848) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 44.9534 -80.3848) (end 67.9534 -80.3848) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 44.9534 -57.3848) (end 44.9534 -80.3848) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 67.9534 -57.3848) (end 67.9534 -80.3848) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 34.6918 -46.6136) (end 62.6918 -46.6136) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 34.6918 -18.6136) (end 62.6918 -18.6136) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 62.6918 -18.6136) (end 62.6918 -46.6136) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 34.6918 -18.6136) (end 34.6918 -46.6136) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 75.5204 -38.6264) (end 75.5204 -61.0264) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 85.8204 -38.6264) (end 85.8204 -61.0264) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 75.5204 -38.6264) (end 85.8204 -38.6264) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 75.5204 -61.0264) (end 85.8204 -61.0264) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 81.0204 -61.0264) (end 91.3204 -61.0264) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 81.0204 -38.6264) (end 91.3204 -38.6264) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 81.0204 -38.6264) (end 81.0204 -61.0264) (width 0.1) (layer Dwgs.User) (net 1))
- (segment (start 91.3204 -38.6264) (end 91.3204 -61.0264) (width 0.1) (layer Dwgs.User) (net 1))
(segment (start 5.1 18.4) (end 98.59999 18.4) (width 1) (layer In1.Cu) (net 1))
(segment (start 2.1 15.4) (end 5.1 18.4) (width 1) (layer In1.Cu) (net 1))
(segment (start 2.1 15.4) (end 2.1 -84.39999) (width 1) (layer In1.Cu) (net 1))