4 # PCB, interactive printed circuit board design
5 # Copyright (C) 2003 Dan McMahill
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.
23 # Johnstech Evaluation Socket for QFN packages
24 # Johnstech Socket Part Numbers 724810 through 724839
31 # $6: pad pitch (1/100 mm)
32 # $7: PCB pad width (1/100 mm)
33 # $8: Package pad length (1/100 mm)
34 # $9: Exposed paddle size, 0 for no exposed paddle (1/100 mm)
36 define(`PKG_GENERIC_JOHNSTECH7248_QFN',
38 # number of pins on left/right sides (pin1 is upper pin on left side)
39 define(`LRPINS', `eval($4 / 4)')
40 # number of pins on top/bottom sides
41 define(`TBPINS', `eval(`$4' / 2 - LRPINS)')
42 # pin pitch (1/1000 mil)
43 define(`PITCH',`eval(`$6'*100000/254)')
44 # y-coordinate for upper pin on left/right sides (1/1000 mil)
45 define(`LRYMAX', `eval((LRPINS-1)*PITCH/2)')
46 # x-coordinate for right pin on top/bottom sides (1/1000 mil)
47 define(`TBXMAX', `eval((TBPINS-1)*PITCH/2)')
48 # total horizontal package width (1/1000 mil)
49 define(`LRWIDTHMM', `ifelse(0,`$5',`787',`eval($5)')')
50 define(`LRWIDTH', `ifelse(0,`$5',`787',`eval(`$5'*10000000/254)')')
51 # total vertical package width (1/1000 mil)
52 define(`TBWIDTHMM', `ifelse(0,`$5',`551',`eval($5)')')
53 define(`TBWIDTH',`ifelse(0,`$5',`551',`eval(`$5'*10000000/254)')')
54 # how much pads extend beyond the package edge (1/1000 mil) (the 75 is 0.75 mm)
55 define(`EXTOUT', eval(75*100000/254))
56 # how much pads extend inward from the package pad edge (1/1000 mil)
57 define(`EXTIN', eval(5*100000/254))
58 # pad length/width (1/1000 mil)
59 define(`PADLENGTH', `eval(`$8'*100000/254)')
60 define(`PADWIDTH', `eval(`$7'*100000/254)')
62 define(`PADWIDTHMIL100', `eval(PADWIDTH/10)')
63 # min/max x coordinates for the pads on the left/right sides of the package (mil/100)
64 define(`LRXMAX',`eval((LRWIDTH/2 + EXTOUT - PADWIDTH/2)/10)')
65 define(`LRXMIN',`eval((LRWIDTH/2 -PADLENGTH - EXTIN + PADWIDTH/2)/10)')
66 # min/max y coordinates for the pads on the top/bottom sides of the package (mil/100)
67 define(`TBYMAX',`eval((TBWIDTH/2 + EXTOUT - PADWIDTH/2)/10)')
68 define(`TBYMIN',`eval((TBWIDTH/2 -PADLENGTH - EXTIN + PADWIDTH/2)/10)')
70 # pad size and drill size (mil/100) for the mounting holes
71 define(`MOUNTPAD', 7700)
72 define(`MOUNTDRILL', 2000)
73 # soldermask relief size for mounting holes (mil/100)
74 define(`MOUNTMASK', `eval(MOUNTPAD + 1000)')
76 # silkscreen width (mils/100)
78 # how much the silk screen is moved away from the package (1/1000 mil)
79 define(`SILKEXT', `eval(200*100000/254 + SILKW*10/2 + 5*1000)')
80 # upper right corner for silk screen (mil/100)
81 define(`SILKX', `eval((LRWIDTH/2 + SILKEXT )/10)')
82 define(`SILKY', `eval((TBWIDTH/2 + SILKEXT )/10)')
83 # refdes text size (mil/100)
84 define(`TEXTSIZE', 100)
85 # x,y coordinates for refdes label (mil/100)
86 define(`TEXTX', -SILKX)
87 define(`TEXTY', `eval(-SILKY - 1000 - TEXTSIZE/2)')
88 # square exposed paddle size (mil/100)
89 define(`EPSIZE', `eval(`$9'*10000/254)')
91 # location of mounting holes (mil/100)
92 define(`MOUNTX', `eval((LRWIDTH/2 + 39370)/10)')
93 define(`MOUNTY', `eval((TBWIDTH/2 + 39370)/10)')
95 # latch silkscreen width (mils/100)
97 # points for latch silk on the left/right sides of the part (mil/100)
98 define(`LATCHLRYMIN', `eval((-TBWIDTH/2 - 25*100000/254 )/10)')
99 define(`LATCHLRYMAX', `eval(( TBWIDTH/2 + 25*100000/254 )/10)')
100 define(`LATCHLRXMIN', SILKX)
101 define(`LATCHLRXMAX', `eval(( LRWIDTH/2 + 400*100000/254 )/10)')
102 # points for latch silk on the top/bottom sides of the part (mil/100)
103 define(`LATCHTBXMIN', `eval((-LRWIDTH/2 - 25*100000/254 )/10)')
104 define(`LATCHTBXMAX', `eval(( LRWIDTH/2 + 25*100000/254 )/10)')
105 define(`LATCHTBYMIN', SILKY)
106 define(`LATCHTBYMAX', `eval(( TBWIDTH/2 + 400*100000/254 )/10)')
108 # points for silk showing where the exposed paddle contacts are (mil/100)
110 ifelse(1, eval(TBWIDTHMM>4), define(`CONTL', 200))
111 ifelse(1, eval(TBWIDTHMM>5), define(`CONTL', 300))
113 # spacing between rows of EP contacts in 1/100 mm.
115 ifelse(1, eval(TBWIDTHMM>5), define(`CONTS', `eval(TBWIDTHMM*100 - 430)'))
117 define(`EPY', `eval((CONTL*100000/254)/10)')
118 define(`EPXMIN', `eval(((CONTS/2 - 20/2)*100000/254)/10)')
119 define(`EPXMAX', `eval(((CONTS/2 + 20/2)*100000/254)/10)')
121 # soldermask opening (mil/100)
122 define(`MASKSIZE', `eval((400*100000/254 + TBWIDTH)/10)')
125 # element_flags, description, pcb-name, value, mark_x, mark_y,
126 # text_x, text_y, text_direction, text_scale, text_flags
127 Element[0x00000000 "$1" "`$2'" "$3" 0 0 TEXTX TEXTY 0 TEXTSIZE 0x00000000]
133 forloop(`i', 1, LRPINS,
134 `define(`Y', `eval((-LRYMAX + PITCH*idx)/10)')'
135 `Pad[-LRXMAX Y -LRXMIN Y PADWIDTHMIL100 0 0 "CURPIN" "CURPIN" 0x00000000]'
136 `define(`CURPIN', incr(CURPIN))'
137 `define(`idx',incr(idx))'
142 forloop(`i', 1, TBPINS,
143 `define(`X', `eval((-TBXMAX + PITCH*idx)/10)')'
144 `Pad[X TBYMAX X TBYMIN PADWIDTHMIL100 0 0 "CURPIN" "CURPIN" 0x00000800]'
145 `define(`CURPIN', incr(CURPIN))'
146 `define(`idx',incr(idx))'
151 forloop(`i', 1, LRPINS,
152 `define(`Y', `eval(( LRYMAX - PITCH*idx)/10)')'
153 `Pad[LRXMAX Y LRXMIN Y PADWIDTHMIL100 0 0 "CURPIN" "CURPIN" 0x00000000]'
154 `define(`CURPIN', incr(CURPIN))'
155 `define(`idx',incr(idx))'
160 forloop(`i', 1, TBPINS,
161 `define(`X', `eval((TBXMAX - PITCH*idx)/10)')'
162 `Pad[X -TBYMAX X -TBYMIN PADWIDTHMIL100 0 0 "CURPIN" "CURPIN" 0x00000800]'
163 `define(`CURPIN', incr(CURPIN))'
164 `define(`idx',incr(idx))'
167 # Exposed paddle. Note that this pad also sets the soldermask
168 # relief for the entire part.
169 # Pad(X1, Y1, X2, Y3, width, clearance,
170 # soldermask, "pin name", "pin number", flags)
171 Pad[0 0 0 0 EPSIZE 0 MASKSIZE "CURPIN" "CURPIN" 0x00000100]
172 define(`CURPIN', incr(CURPIN))
175 # Pin(x, y, thickness, clearance, mask, drilling hole, name,
177 Pin[ MOUNTX MOUNTY MOUNTPAD 1000 MOUNTMASK MOUNTDRILL "Mount1" "CURPIN" 0x0]
178 define(`CURPIN', incr(CURPIN))
179 Pin[ -MOUNTX MOUNTY MOUNTPAD 1000 MOUNTMASK MOUNTDRILL "Mount2" "CURPIN" 0x0]
180 define(`CURPIN', incr(CURPIN))
181 Pin[ -MOUNTX -MOUNTY MOUNTPAD 1000 MOUNTMASK MOUNTDRILL "Mount3" "CURPIN" 0x0]
182 define(`CURPIN', incr(CURPIN))
183 Pin[ MOUNTX -MOUNTY MOUNTPAD 1000 MOUNTMASK MOUNTDRILL "Mount4" "CURPIN" 0x0]
185 # Silk screen around package
186 ElementLine[ SILKX SILKY SILKX -SILKY SILKW]
187 ElementLine[ SILKX -SILKY -SILKX -SILKY SILKW]
188 ElementLine[-SILKX -SILKY -SILKX SILKY SILKW]
189 ElementLine[-SILKX SILKY SILKX SILKY SILKW]
192 ElementLine[-SILKX -SILKY eval(-SILKX - 1500) eval(-SILKY - 1500) SILKW]
194 # Silk showing latch area
197 ElementLine[ LATCHTBXMIN -LATCHTBYMIN LATCHTBXMIN -LATCHTBYMAX LSILKW ]
198 ElementLine[ LATCHTBXMIN -LATCHTBYMAX LATCHTBXMAX -LATCHTBYMAX LSILKW ]
199 ElementLine[ LATCHTBXMAX -LATCHTBYMIN LATCHTBXMAX -LATCHTBYMAX LSILKW ]
202 ElementLine[ LATCHTBXMIN LATCHTBYMIN LATCHTBXMIN LATCHTBYMAX LSILKW ]
203 ElementLine[ LATCHTBXMIN LATCHTBYMAX LATCHTBXMAX LATCHTBYMAX LSILKW ]
204 ElementLine[ LATCHTBXMAX LATCHTBYMIN LATCHTBXMAX LATCHTBYMAX LSILKW ]
207 ElementLine[ -LATCHLRXMIN LATCHLRYMAX -LATCHLRXMAX LATCHLRYMAX LSILKW ]
208 ElementLine[ -LATCHLRXMAX LATCHLRYMAX -LATCHLRXMAX LATCHLRYMIN LSILKW ]
209 ElementLine[ -LATCHLRXMIN LATCHLRYMIN -LATCHLRXMAX LATCHLRYMIN LSILKW ]
212 ElementLine[ LATCHLRXMIN LATCHLRYMAX LATCHLRXMAX LATCHLRYMAX LSILKW ]
213 ElementLine[ LATCHLRXMAX LATCHLRYMAX LATCHLRXMAX LATCHLRYMIN LSILKW ]
214 ElementLine[ LATCHLRXMIN LATCHLRYMIN LATCHLRXMAX LATCHLRYMIN LSILKW ]
216 # Silk showing area for exposed paddle socket contacts
217 ElementLine[ EPXMIN -EPY EPXMIN EPY LSILKW ]
218 ElementLine[ EPXMAX -EPY EPXMAX EPY LSILKW ]
219 ElementLine[ EPXMIN EPY EPXMAX EPY LSILKW ]
220 ElementLine[ EPXMIN -EPY EPXMAX -EPY LSILKW ]
222 # packages with width >= 6.0 mm have 2 rows of contacts
223 ifelse(1, eval(TBWIDTHMM>5),
224 ElementLine[ -EPXMIN -EPY -EPXMIN EPY LSILKW ]
225 ElementLine[ -EPXMAX -EPY -EPXMAX EPY LSILKW ]
226 ElementLine[ -EPXMIN EPY -EPXMAX EPY LSILKW ]
227 ElementLine[ -EPXMIN -EPY -EPXMAX -EPY LSILKW ]
232 # -------------------------------------------------------------------
234 # The following macros take:
240 # $6: exposed paddle size (1/100 mm). 0 for no exposed paddle
243 # For an exposed paddle package, the paddle for an 'n' pin package is pin 'n+1'
246 define(`PKG_JOHNSTECH_QFN_80', `PKG_GENERIC_JOHNSTECH7248_QFN(`$1',`$2',`$3',`$4',`$5', `80',`36',`50', `$6')')
248 define(`PKG_JOHNSTECH_QFN_65', `PKG_GENERIC_JOHNSTECH7248_QFN(`$1',`$2',`$3',`$4',`$5', `65',`36',`50', `$6')')
249 # 0.50 mm pitch, 0.6 mm pad length
250 define(`PKG_JOHNSTECH_QFN_50', `PKG_GENERIC_JOHNSTECH7248_QFN(`$1',`$2',`$3',`$4',`$5', `50',`36',`50', `$6')')
251 # 0.50 mm pitch, 0.4 mm pad length
252 define(`PKG_JOHNSTECH_QFN_50S',`PKG_GENERIC_JOHNSTECH7248_QFN(`$1',`$2',`$3',`$4',`$5', `50',`36',`50', `$6')')
254 define(`PKG_JOHNSTECH_QFN_40', `PKG_GENERIC_JOHNSTECH7248_QFN(`$1',`$2',`$3',`$4',`$5', `40',`36',`50', `$6')')
257 # PKG_GENERIC_JOHNSTECH7248_QFN
263 # $6: pad pitch (1/100 mm)
264 # $7: PCB pad width (1/100 mm)
265 # $8: Package pad length (1/100 mm)
266 # $9: Exposed paddle size, 0 for no exposed paddle (1/100 mm)
267 # -------------------------------------------------------------------
271 ## Johnstech QFN Socket, Series 1MM (724812-724839)
274 define(`PKG_JOHNSTECH_QFN12_4', `PKG_JOHNSTECH_QFN_80(`$1',`$2',`$3', `12', `4', `210')')
275 #define(`PKG_JOHNSTECH_TQFN12_4', `PKG_JOHNSTECH_QFN_80(`$1',`$2',`$3', `12', `4', `210')')
277 define(`PKG_JOHNSTECH_QFN16_4', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `16', `4', `210')')
278 #define(`PKG_JOHNSTECH_TQFN16_4', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `16', `4', `210')')
280 define(`PKG_JOHNSTECH_QFN20_4', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `20', `4', `210')')
281 #define(`PKG_JOHNSTECH_TQFN20_4', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `20', `4', `210')')
283 define(`PKG_JOHNSTECH_QFN24_4', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `24', `4', `210')')
284 #define(`PKG_JOHNSTECH_TQFN24_4', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `24', `4', `260')')
287 define(`PKG_JOHNSTECH_QFN16_5', `PKG_JOHNSTECH_QFN_80(`$1',`$2',`$3', `16', `5', `310')')
288 #define(`PKG_JOHNSTECH_TQFN16_5', `PKG_JOHNSTECH_QFN_80(`$1',`$2',`$3', `16', `5', `310')')
290 define(`PKG_JOHNSTECH_QFN20_5', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `20', `5', `310')')
291 #define(`PKG_JOHNSTECH_TQFN20_5', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `20', `5', `310')')
293 define(`PKG_JOHNSTECH_QFN28_5', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `28', `5', `310')')
294 #define(`PKG_JOHNSTECH_TQFN28_5', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `28', `5', `325')')
296 define(`PKG_JOHNSTECH_QFN32_5', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `32', `5', `310')')
297 #define(`PKG_JOHNSTECH_TQFN32_5', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `32', `5', `310')')
300 define(`PKG_JOHNSTECH_QFN36_6', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `36', `6', `370')')
301 #define(`PKG_JOHNSTECH_TQFN36_6', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `36', `6', `370')')
303 define(`PKG_JOHNSTECH_QFN40_6', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `40', `6', `410')')
304 #define(`PKG_JOHNSTECH_TQFN40_6', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `40', `6', `410')')
307 define(`PKG_JOHNSTECH_QFN32_7', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `32', `7', `470')')
308 #define(`PKG_JOHNSTECH_TQFN32_7', `PKG_JOHNSTECH_QFN_65(`$1',`$2',`$3', `32', `7', `470')')
310 define(`PKG_JOHNSTECH_QFN44_7', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `44', `7', `470')')
311 #define(`PKG_JOHNSTECH_TQFN44_7', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `44', `7', `470')')
313 define(`PKG_JOHNSTECH_QFN48_7', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `48', `7', `560')')
314 #define(`PKG_JOHNSTECH_TQFN48_7', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `48', `7', `560')')
317 define(`PKG_JOHNSTECH_QFN56_8', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `56', `8', `665')')
318 #define(`PKG_JOHNSTECH_TQFN56_8', `PKG_JOHNSTECH_QFN_50S(`$1',`$2',`$3', `56', `8', `665')')
321 define(`PKG_JOHNSTECH_QFN68_10', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `68', `10', `770')')
322 #define(`PKG_JOHNSTECH_TQFN68_10', `PKG_JOHNSTECH_QFN_50(`$1',`$2',`$3', `68', `10', `770')')