4 # PCB, interactive printed circuit board design
5 # Copyright (C) 1994,1995,1996 Thomas Nau
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 # Contact addresses for paper mail and Email:
22 # Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
23 # Thomas.Nau@rz.uni-ulm.de
24 # Improvments by D.J. Barrow dj_barrow@ariasoft.ie
25 # Further improved by W. Kazubski <wk@ire.pw.edu.pl>
34 # $5: body size in mm (0 if rectangular 20x14 mm)
35 # $6: pad pitch in 1/100 mmm
36 # $7: pad thickness in 1/100 mmm
37 # $8: pad min offset ( edge nearest package )
38 # $9: pad max offset ( edge furthest away from package )
39 # $10: pin 1 in middle
40 # $11: Exposed paddle size, 0 for no exposed paddle (1/100 mm)
42 define(`PKG_GENERIC_QFP',
43 `define(`QUARTER', `ifelse(0,`$5',`eval($4 * 3 / 10)',`eval($4 / 4)')')
44 define(`QUARTER2', `eval(`$4' / 2 - QUARTER)')
45 define(`OFFSET', `eval((QUARTER +1) /2)')
46 define(`WIDTH', `ifelse(0,`$5',`78740',`eval(`$5'*1000000/254)')')
47 define(`WIDTH2',`ifelse(0,`$5',`55118',`eval(`$5'*1000000/254)')')
48 define(`PITCH',`eval(`$6'*100000/254)')
49 define(`PINREACH', `eval(((QUARTER-1)*PITCH/10)/2)')
50 define(`PINREACH2', `eval(((QUARTER2-1)*PITCH/10)/2)')
51 define(`HALFWIDTH', `eval(WIDTH / 2)')
52 define(`HALFWIDTH2', `eval(WIDTH2 / 2)')
53 define(`NUMPINS', `$4')
54 define(`PADTHICKNESS',`eval(`$7'*10000/254)')
55 define(`PADMINOFFSET',`eval(`$8'*100+PADTHICKNESS/2)')
56 define(`PADMAXOFFSET',`eval(`$9'*100-PADTHICKNESS/2)')
57 define(`PIN1INMIDDLE',`$10')
58 define(`CUTSIZE',`3300')
59 define(`EDGECUT',`ifelse(1,eval(PIN1INMIDDLE),`HALFWIDTH',`eval(HALFWIDTH-CUTSIZE)')')
60 define(`EDGECUT2',`ifelse(1,eval(PIN1INMIDDLE),`HALFWIDTH2',`eval(HALFWIDTH2-CUTSIZE)')')
61 define(`STARTPIN',`ifelse(1,eval(PIN1INMIDDLE),`eval(((QUARTER+1)/2)+1)',`1')')
62 define(`CIRCLECENTRE',`eval(-EDGECUT)')
63 define(`CIRCLECENTRE2',`ifelse(1,eval(PIN1INMIDDLE),`0',`eval(-EDGECUT2)')')
64 define(`PADMASK', `eval(2*150 + PADTHICKNESS)')
65 define(`PADCLEAR', `3000')
66 define(`EPCLEAR', `500')
67 define(`EPSIZE', `eval(`$11'*10000/254)')
68 define(`EPMASK', `eval(2*200 + EPSIZE)')
69 define(`SILKW', `800')
70 define(`SLX', `eval(-HALFWIDTH2 + SILKW/2)')
71 define(`SRX', `eval( HALFWIDTH2 - SILKW/2)')
72 define(`SUY', `eval(-HALFWIDTH + SILKW/2)')
73 define(`SLY', `eval( HALFWIDTH - SILKW/2)')
76 Element[0x00000000 "$1" "`$2'" "$3" 0 0 -2000 -6000 0 100 0x00000000]
80 define(`QFPPIN',`STARTPIN')
82 define(`PADIN',`eval(-HALFWIDTH2-PADMINOFFSET)')
83 define(`PADOUT',`eval(-HALFWIDTH2-PADMAXOFFSET)')
84 forloop(`i', 1, QUARTER,
85 `define(`Y', `eval(-PINREACH+((PITCH*idx)/10))')'
86 `Pad[PADOUT Y PADIN Y PADTHICKNESS PADCLEAR PADMASK "QFPPIN" "QFPPIN" 0x00000100]'
87 `define(`QFPPIN', incr(QFPPIN))'
88 `define(`idx',incr(idx))'
93 define(`PADIN',`eval(HALFWIDTH+PADMINOFFSET)')
94 define(`PADOUT',`eval(HALFWIDTH+PADMAXOFFSET)')
95 forloop(`i', 1, QUARTER2,
96 `define(`X', `eval(-PINREACH2+((PITCH*idx)/10))')'
97 `Pad[X PADOUT X PADIN PADTHICKNESS PADCLEAR PADMASK "QFPPIN" "QFPPIN" 0x00000900]'
98 `define(`QFPPIN', incr(QFPPIN))'
99 `define(`idx',incr(idx))'
104 define(`PADIN',`eval(HALFWIDTH2+PADMINOFFSET)')
105 define(`PADOUT',`eval(HALFWIDTH2+PADMAXOFFSET)')
106 forloop(`i', 1, QUARTER,
107 `define(`Y', `eval(PINREACH-((PITCH*idx)/10))')'
108 `Pad[PADOUT Y PADIN Y PADTHICKNESS PADCLEAR PADMASK "QFPPIN" "QFPPIN" 0x00000100]'
109 `define(`QFPPIN', incr(QFPPIN))'
110 `define(`idx',incr(idx))'
115 define(`PADIN',`eval(-HALFWIDTH-PADMINOFFSET)')
116 define(`PADOUT',`eval(-HALFWIDTH-PADMAXOFFSET)')
117 forloop(`i', 1, QUARTER2,
118 `define(`X',`eval(PINREACH2-((PITCH*idx)/10))')'
119 `Pad[X PADOUT X PADIN PADTHICKNESS PADCLEAR PADMASK "QFPPIN" "QFPPIN" 0x00000900]'
120 `define(`QFPPIN', incr(QFPPIN))'
121 `ifelse(eval(QFPPIN > NUMPINS), 1, `define(`QFPPIN', 1)')'
122 `define(`idx',incr(idx))'
125 # exposed paddle (if this is an exposed paddle part)
126 ifelse(1, eval(EPSIZE>0),
127 `Pad[0 0 0 0 EPSIZE EPCLEAR EPMASK "QFPPIN" "QFPPIN" 0x00000100]'
128 `define(`QFPPIN', incr(QFPPIN))'
132 ElementLine[-EDGECUT2 SUY SRX SUY SILKW]
134 ElementLine[SRX SUY SRX SLY SILKW]
136 ElementLine[SRX SLY SLX SLY SILKW]
138 ElementLine[SLX SLY SLX -EDGECUT SILKW]
140 ElementLine[SLX -EDGECUT -EDGECUT2 SUY SILKW]
142 ElementArc[CIRCLECENTRE2 CIRCLECENTRE 1000 1000 0 360 SILKW]
146 # -------------------------------------------------------------------
147 # ThanX to Johan Andersson (johan@homemail.com), modified by Thomas Nau
148 # the definition of a plcc package for base code to make qfp package.
149 # modified for correct pad numbering by Holm Tiffe
151 # Code from plcc.inc modified by Thomas Olson to make this qfp.inc definition.
152 # Although in retrospec quad flat packs are more diverse than this algorithm will do.
153 # Many qfp are the same physical size but have more thus narrower pads.
158 # $5: body size in mm
159 # $6: pad pitch in 1/100 mmm
161 # $8: pad min offset ( edge nearest package )
162 # $9: pad max offset ( edge furthest away from package )
163 # $10: pin 1 in middle
166 # pins 1.9-2.1mm long
167 define(`PKG_QFP_100',`PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5',`100',`50',`20',`100',`0',`$6')')
168 define(`PKG_QFP_80L',`PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `80',`50',`20',`100',`0',`$6')')
169 define(`PKG_QFP_65L',`PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `65',`40',`20',`100',`0',`$6')')
170 define(`PKG_QFP_50L',`PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `50',`28',`20',`100',`0',`$6')')
173 define(`PKG_QFP_80', `PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `80',`40',`20', `80',`0',`$6')')
174 define(`PKG_QFP_65', `PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `65',`40',`20', `80',`0',`$6')')
175 define(`PKG_QFP_50', `PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `50',`28',`20', `80',`0',`$6')')
176 define(`PKG_QFP_40', `PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `40',`25',`20', `80',`0',`$6')')
179 define(`PKG_LQFP_80',`PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `80',`40', `5', `50',`0',`$6')')
180 define(`PKG_LQFP_65',`PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `65',`40', `5', `50',`0',`$6')')
181 define(`PKG_LQFP_50',`PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `50',`28', `5', `50',`0',`$6')')
182 define(`PKG_LQFP_40',`PKG_GENERIC_QFP(`$1',`$2',`$3',`$4',`$5', `40',`25', `5', `50',`0',`$6')')
184 # -------------------------------------------------------------------