From db09f5a4ca032443e2d798fa0e9937a068ba7363 Mon Sep 17 00:00:00 2001
From: Krisjanis Rijnieks <krisjanis.rijnieks@gmail.com>
Date: Mon, 27 Jul 2020 19:39:02 +0300
Subject: [PATCH] Update ATtiny3216 and its footprint

---
 fab.dcm                                       |  8 ++-
 fab.lib                                       | 70 +++++++++----------
 .../SOIC-20_7.5x12.8mm_P1.27mm.kicad_mod      | 45 ++++++++++++
 3 files changed, 87 insertions(+), 36 deletions(-)
 create mode 100644 fab.pretty/SOIC-20_7.5x12.8mm_P1.27mm.kicad_mod

diff --git a/fab.dcm b/fab.dcm
index 2d6e26e..56785ab 100644
--- a/fab.dcm
+++ b/fab.dcm
@@ -129,10 +129,16 @@ $ENDCMP
 #
 $CMP Microcontroller_ATtiny1614-SSFR
 D AVR tinyAVRâ„¢ 1 Microcontroller IC 8-Bit 16MHz 16KB (16K x 8) FLASH 14-SOIC
-K avr microcontroller attiny 1614 soic 8bit 
+K avr microcontroller attiny 1614 soic 8bit
 F http://ww1.microchip.com/downloads/en/DeviceDoc/ATtiny1614-16-17-DataSheet-DS40002204A.pdf
 $ENDCMP
 #
+$CMP Microcontroller_ATtiny3216-SFR
+D AVR tinyAVRâ„¢ 1 Microcontroller IC 8-Bit 20MHz 32KB (32K x 8) FLASH 20-SOIC
+K avr microcontroller 8bit 3216 1-series soic
+F http://ww1.microchip.com/downloads/en/DeviceDoc/ATtiny3216_ATtiny1616-data-sheet-40001997B.pdf
+$ENDCMP
+#
 $CMP Microcontroller_ATtiny44V-SSU
 D AVR tinyAVRâ„¢ 1 Microcontroller IC 8-Bit 20MHz 4KB (4K x 8) FLASH 8-SOIC
 K AVR 8bit Microcontroller tinyAVR 1-series
diff --git a/fab.lib b/fab.lib
index 1885758..743767a 100644
--- a/fab.lib
+++ b/fab.lib
@@ -509,41 +509,6 @@ X VCC 8 1400 200 0 L 40 40 1 1 B
 ENDDRAW
 ENDDEF
 #
-# ATtiny3216
-#
-DEF ATtiny3216 U 0 20 Y Y 1 F N
-F0 "U" 0 875 50 H V C BNN
-F1 "ATtiny3216" 0 -875 50 H V C TNN
-F2 "fab:fab-SOIC-20_7.5x12.8mm_P1.27mm" 0 0 50 H I C CIN
-F3 "" 0 0 50 H I C CNN
-$FPLIST
- SOIC*7.5x12.8mm*P1.27mm*
-$ENDFPLIST
-DRAW
-S -500 -800 500 800 0 1 10 f
-X VCC 1 -600 675 100 R 50 50 1 1 W
-X PB1 10 -600 -675 100 R 50 50 1 1 B
-X PB0 11 600 -675 100 L 50 50 1 1 B
-X PC0 12 600 -525 100 L 50 50 1 1 B
-X PC1 13 600 -375 100 L 50 50 1 1 B
-X PC2 14 600 -225 100 L 50 50 1 1 B
-X PC3 15 600 -75 100 L 50 50 1 1 B
-X ~RESET~/UPDI/PA0 16 600 75 100 L 50 50 1 1 B
-X PA1 17 600 225 100 L 50 50 1 1 B
-X PA2 18 600 375 100 L 50 50 1 1 B
-X PA3 19 600 525 100 L 50 50 1 1 B
-X PA4 2 -600 525 100 R 50 50 1 1 B
-X GND 20 600 675 100 L 50 50 1 1 W
-X PA5 3 -600 375 100 R 50 50 1 1 B
-X PA6 4 -600 225 100 R 50 50 1 1 B
-X PA7 5 -600 75 100 R 50 50 1 1 B
-X PB5 6 -600 -75 100 R 50 50 1 1 B
-X PB4 7 -600 -225 100 R 50 50 1 1 B
-X PB3 8 -600 -375 100 R 50 50 1 1 B
-X PB2 9 -600 -525 100 R 50 50 1 1 B
-ENDDRAW
-ENDDEF
-#
 # AVRISP
 #
 DEF AVRISP M 0 40 N N 1 L N
@@ -1516,6 +1481,41 @@ X PB0 9 -600 300 100 R 50 50 1 1 B
 ENDDRAW
 ENDDEF
 #
+# Microcontroller_ATtiny3216-SFR
+#
+DEF Microcontroller_ATtiny3216-SFR U 0 20 Y Y 1 F N
+F0 "U" -500 800 50 H V L TNN
+F1 "Microcontroller_ATtiny3216-SFR" 100 800 50 H V L TNN
+F2 "fab:SOIC-20_7.5x12.8mm_P1.27mm" 0 0 50 H I C CIN
+F3 "" 0 0 50 H I C CNN
+$FPLIST
+ SOIC*7.5x12.8mm*P1.27mm*
+$ENDFPLIST
+DRAW
+S -500 -700 500 700 0 1 10 f
+X VCC 1 0 800 100 D 50 50 1 1 W
+X PB1 10 -600 400 100 R 50 50 1 1 B
+X PB0 11 -600 500 100 R 50 50 1 1 B
+X PC0 12 -600 -200 100 R 50 50 1 1 B
+X PC1 13 -600 -300 100 R 50 50 1 1 B
+X PC2 14 -600 -400 100 R 50 50 1 1 B
+X PC3 15 -600 -500 100 R 50 50 1 1 B
+X ~RESET~/UPDI/PA0 16 600 400 100 L 50 50 1 1 B
+X PA1 17 600 300 100 L 50 50 1 1 B
+X PA2 18 600 200 100 L 50 50 1 1 B
+X PA3 19 600 100 100 L 50 50 1 1 B
+X PA4 2 600 0 100 L 50 50 1 1 B
+X GND 20 0 -800 100 U 50 50 1 1 W
+X PA5 3 600 -100 100 L 50 50 1 1 B
+X PA6 4 600 -200 100 L 50 50 1 1 B
+X PA7 5 600 -300 100 L 50 50 1 1 B
+X PB5 6 -600 0 100 R 50 50 1 1 B
+X PB4 7 -600 100 100 R 50 50 1 1 B
+X PB3 8 -600 200 100 R 50 50 1 1 B
+X PB2 9 -600 300 100 R 50 50 1 1 B
+ENDDRAW
+ENDDEF
+#
 # Microcontroller_ATtiny412_SSFR
 #
 DEF Microcontroller_ATtiny412_SSFR U 0 20 Y Y 1 F N
diff --git a/fab.pretty/SOIC-20_7.5x12.8mm_P1.27mm.kicad_mod b/fab.pretty/SOIC-20_7.5x12.8mm_P1.27mm.kicad_mod
new file mode 100644
index 0000000..1271a7e
--- /dev/null
+++ b/fab.pretty/SOIC-20_7.5x12.8mm_P1.27mm.kicad_mod
@@ -0,0 +1,45 @@
+(module SOIC-20_7.5x12.8mm_P1.27mm (layer F.Cu) (tedit 5F1F0306)
+  (descr "SOIC, 20 Pin, fab version")
+  (tags "SOIC fab")
+  (attr smd)
+  (fp_text reference REF** (at 0 -7.35) (layer F.SilkS)
+    (effects (font (size 1 1) (thickness 0.15)))
+  )
+  (fp_text value Val** (at 0 0) (layer F.SilkS)
+    (effects (font (size 1.27 1.27) (thickness 0.15)))
+  )
+  (fp_line (start 0 6.51) (end 3.86 6.51) (layer F.SilkS) (width 0.12))
+  (fp_line (start 0 6.51) (end -3.86 6.51) (layer F.SilkS) (width 0.12))
+  (fp_line (start 0 -6.51) (end 3.86 -6.51) (layer F.SilkS) (width 0.12))
+  (fp_line (start 0 -6.51) (end -3.86 -6.51) (layer F.SilkS) (width 0.12))
+  (fp_line (start -2.75 -6.4) (end 3.75 -6.4) (layer F.Fab) (width 0.1))
+  (fp_line (start 3.75 -6.4) (end 3.75 6.4) (layer F.Fab) (width 0.1))
+  (fp_line (start 3.75 6.4) (end -3.75 6.4) (layer F.Fab) (width 0.1))
+  (fp_line (start -3.75 6.4) (end -3.75 -5.4) (layer F.Fab) (width 0.1))
+  (fp_line (start -3.75 -5.4) (end -2.75 -6.4) (layer F.Fab) (width 0.1))
+  (pad 1 smd rect (at -4.65 -5.715) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 2 smd rect (at -4.65 -4.445) (size 2 0.6) (layers F.Cu F.Paste B.Mask))
+  (pad 3 smd rect (at -4.65 -3.175) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 4 smd rect (at -4.65 -1.905) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 5 smd rect (at -4.65 -0.635) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 6 smd rect (at -4.65 0.635) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 7 smd rect (at -4.65 1.905) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 8 smd rect (at -4.65 3.175) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 9 smd rect (at -4.65 4.445) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 10 smd rect (at -4.65 5.715) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 11 smd rect (at 4.65 5.715) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 12 smd rect (at 4.65 4.445) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 13 smd rect (at 4.65 3.175) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 14 smd rect (at 4.65 1.905) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 15 smd rect (at 4.65 0.635) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 16 smd rect (at 4.65 -0.635) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 17 smd rect (at 4.65 -1.905) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 18 smd rect (at 4.65 -3.175) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 19 smd rect (at 4.65 -4.445) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (pad 20 smd rect (at 4.65 -5.715) (size 2 0.6) (layers F.Cu F.Paste F.Mask))
+  (model ${KISYS3DMOD}/Package_SO.3dshapes/SOIC-20W_7.5x12.8mm_P1.27mm.wrl
+    (at (xyz 0 0 0))
+    (scale (xyz 1 1 1))
+    (rotate (xyz 0 0 0))
+  )
+)
-- 
GitLab