changeset 115:a7276a03289d

M4 library: new metric QFP footprints
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 12 Jun 2020 07:25:04 +0000
parents f3e81535819b
children bb9908f36e23
files ifctf-part-lib/m4-fp/common.m4 ifctf-part-lib/m4-fp/qfpmnf.inc
diffstat 2 files changed, 141 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ifctf-part-lib/m4-fp/common.m4	Fri Jun 12 03:21:37 2020 +0000
+++ b/ifctf-part-lib/m4-fp/common.m4	Fri Jun 12 07:25:04 2020 +0000
@@ -108,7 +108,8 @@
 include(qfn.inc)
 include(qfp.inc)
 include(qfp2.inc)
-include(qfpdj.inc)
+#include(qfpdj.inc)
+include(qfpmnf.inc)
 include(resistor_adjust.inc)
 include(rules.inc)
 include(smt.inc)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ifctf-part-lib/m4-fp/qfpmnf.inc	Fri Jun 12 07:25:04 2020 +0000
@@ -0,0 +1,139 @@
+# 
+#  QFP packages, MNF version based on qfpdj.inc
+#
+# $1: canonical name
+# $2: name on PCB
+# $3: value
+# $4: number of pins
+# $5: body size in mm (0 if rectangular 20x14 mm)
+# $6: pad pitch in 1/100 mm
+# $7: pad thickness in 1/100 mm
+# $8: pad min offset ( edge nearest package ), um units
+# $9: pad max offset ( edge furthest away from package ), um units
+# $10: soldermask delta in um units
+# $11: 1 to suppress edge cut and bring the silk outline in a little
+#
+# all internal units are um
+#
+define(`PKG_QFP_MNF',
+       `define(`QUARTER',  ifelse(0,`$5',eval($4 * 3 / 10),eval($4 / 4)))
+	define(`QUARTER2', eval(`$4' / 2 - QUARTER))
+	define(`WIDTH', ifelse(0,`$5',`20000',eval(`$5'*1000)))
+	define(`WIDTH2',ifelse(0,`$5',`14000',eval(`$5'*1000)))
+	define(`PITCH',eval(`$6'*10))
+	define(`BORDER',  eval((WIDTH-(QUARTER-1)*PITCH)/2))
+	define(`BORDER2', eval((WIDTH2-(QUARTER2-1)*PITCH)/2))
+	define(`CENTER', eval(WIDTH2 / 2))
+	define(`NUMPINS', `$4')
+	define(`PADTHICKNESS',eval(`$7'*10))
+	define(`PADMINOFFSET',eval(`$8'+PADTHICKNESS/2))
+	define(`PADMAXOFFSET',eval(`$9'-PADTHICKNESS/2))
+	define(`MASKTHICKNESS', eval(PADTHICKNESS + `$10'))
+	define(`CLEARANCE', `10mil');
+	define(`FARPIN', eval(WIDTH-BORDER))
+	define(`FARPIN2',eval(WIDTH2-BORDER2))
+	define(`PIN1INMIDDLE',0)
+	define(`STARTPIN',ifelse(1,eval(PIN1INMIDDLE),eval(((QUARTER+1)/2)+1),`1'))
+	define(`REDUCEDSILK', `$11'))
+Element[0x00 "$1" "$2" "$3" 0 0 100mil CENTER`um' 0 100 0x00]
+(
+
+	# left row
+define(`X', 0)
+define(`QFPPIN',`STARTPIN')
+define(`idx',0)
+define(`MYPAD', `Pad[$1`um' $2`um' $3`um' $4`um' PADTHICKNESS`um' CLEARANCE MASKTHICKNESS`um' "$5" "$5" ifelse($5, 1, 0x00, 0x100)]')
+forloop(`i', 1, QUARTER,
+	`define(`Y', eval(BORDER+(PITCH*idx)))'
+	`MYPAD(eval(X-PADMAXOFFSET), Y, eval(X-PADMINOFFSET), Y, QFPPIN)'
+	`define(`QFPPIN', incr(QFPPIN))'
+	`define(`idx',incr(idx))'
+)
+
+	# bottom row
+define(`Y', WIDTH)
+define(`idx',0)
+forloop(`i', 1, QUARTER2,
+	`define(`X', eval(BORDER2+(PITCH*idx)))'
+	`MYPAD(X, eval(Y+PADMAXOFFSET), X, eval(Y+PADMINOFFSET), QFPPIN)'
+	`define(`QFPPIN', incr(QFPPIN))'
+	`define(`idx',incr(idx))'
+)
+
+	# right row
+define(`X', WIDTH2)
+define(`idx',0)
+forloop(`i', 1, QUARTER,
+	`define(`Y', eval(FARPIN-(PITCH*idx)))'
+	`MYPAD(eval(X+PADMAXOFFSET), Y, eval(X+PADMINOFFSET), Y, QFPPIN)'
+	`define(`QFPPIN', incr(QFPPIN))'
+	`define(`idx',incr(idx))'
+)
+
+	# top row
+define(`idx',0)
+define(`Y', 0)
+forloop(`i', 1, QUARTER2,
+	`define(`X',eval(FARPIN2-(PITCH*idx)))'
+	`MYPAD(X, eval(Y-PADMAXOFFSET), X, eval(Y-PADMINOFFSET), QFPPIN)'
+	`define(`QFPPIN', incr(QFPPIN))'
+	`ifelse(eval(QFPPIN > NUMPINS), 1, `define(`QFPPIN', 1)')'
+	`define(`idx',incr(idx))'
+)
+
+define(`EDGECUT', `28mil')
+define(`CIRCLEOFFSET', `35mil')
+
+ifelse(REDUCEDSILK, 1, `
+	ElementLine[125um 125um eval(WIDTH2-125)`um' 125um 0.25mm]
+	ElementLine[eval(WIDTH2-125)`um' 125um eval(WIDTH2-125)`um' eval(WIDTH-125)`um' 0.25mm]
+	ElementLine[eval(WIDTH2-125)`um' eval(WIDTH-125)`um' 125um eval(WIDTH-125)`um' 0.25mm]
+	ElementLine[125um eval(WIDTH-125)`um' 125um 125um 0.25mm]
+',`
+	ElementLine[EDGECUT 0 WIDTH2`um' 0 0.25mm]
+	ElementLine[WIDTH2`um' 0 WIDTH2`um' WIDTH`um' 0.25mm]
+	ElementLine[WIDTH2`um' WIDTH`um' 0 WIDTH`um' 0.25mm]
+	ElementLine[0 WIDTH`um' 0 EDGECUT 0.25mm]
+	ElementLine[0 EDGECUT EDGECUT 0 0.25mm]
+')
+
+	ElementArc[CIRCLEOFFSET CIRCLEOFFSET 10mil 10mil 0 360 10mil]
+
+)')
+
+# -------------------------------------------------------------------
+# ThanX to Johan Andersson (johan@homemail.com), modified by Thomas Nau
+# the definition of a plcc package for base code to make qfp package.
+# modified for correct pad numbering by Holm Tiffe
+#
+# Code from plcc.inc modified by Thomas Olson to make this qfp.inc definition.
+# Although in retrospec quad flat packs are more diverse than this algorithm will do.
+# Many qfp are the same physical size but have more thus narrower pads.
+# $1: canonical name
+# $2: name on PCB
+# $3: value
+# $4: number of pins
+# $5: body size in mm
+# $6: pad pitch in 1/100 mmm
+# $7: pad thickness
+#
+
+# pins 1.9-2.1mm long
+define(`PKG_QFP_100',`PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5',`100',`50',`508',`2540',`150',`0')')
+define(`PKG_QFP_80L',`PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5', `80',`40',`508',`2540',`150',`0')')
+define(`PKG_QFP_65L',`PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5', `65',`40',`508',`2540',`150',`0')')
+define(`PKG_QFP_50L',`PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5', `50',`25',`508',`2540',`150',`0')')
+
+# pins 1.6mm long
+define(`PKG_QFP_80', `PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5', `80',`40',`508',`2032',`150',`0')')
+define(`PKG_QFP_65', `PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5', `65',`40',`508',`2032',`150',`0')')
+define(`PKG_QFP_50', `PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5', `50',`25',`508',`2032',`150',`0')')
+
+# pins 1mm long
+define(`PKG_LQFP_80',`PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5', `80',`40',`127',`1270',`150',`1')')
+define(`PKG_LQFP_65',`PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5', `65',`40',`127',`1270',`150',`1')')
+define(`PKG_LQFP_50',`PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5', `50',`25',`127',`1270',`150',`1')')
+define(`PKG_LQFP_40',`PKG_QFP_MNF(`$1',`$2',`$3',`$4',`$5', `40',`25',`127',`1270',`100',`1')')
+
+# -------------------------------------------------------------------
+