Update "missing" (automake) script to a later version
[geda-pcb/pcjc2.git] / lib / plcc.inc
blobcbe7458bdbd2bb6a66d58701a8d398d98ad16050
2 #                             COPYRIGHT
3
4 #   PCB, interactive printed circuit board design
5 #   Copyright (C) 1994,1995,1996 Thomas Nau
6
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.
11
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.
16
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.
20
21 #   Contact addresses for paper mail and Email:
22 #   Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
23 #   Thomas.Nau@rz.uni-ulm.de
24
26 # PLCC packages
29 # -------------------------------------------------------------------
30 # ThanX to Johan Andersson (johan@homemail.com), modified by Thomas Nau
31 # the definition of a plcc package
32 # modified for correct pad numbering by Holm Tiffe
34 # modified 11-Dec-1999 Larry Doolittle <LRDoolittle@lbl.gov>
35 # to shorten the pads by 10 mils; PUSHOUT=5 PUSHIN=40
37 # modified 22-Dec-1999 Larry Doolittle <LRDoolittle@lbl.gov>
38 # put back the 10 mils on the outside; PUSHOUT=5, PUSHIN=50
40 # One last tweak 12-Jan-2000 LRD, now that the shop complained I
41 # didn't leave them any room to solder (looks like the 22-Dec
42 # change was backwards);  PUSHOUT=20, PUSHIN=40
44 # $1: canonical name
45 # $2: name on PCB
46 # $3: value
47 # $4: number of pins
48 # $5: additional border (will be ignored)
50 define(`PKG_PLCC',
51         `define(`NUMPINS', `$4')
52         ifelse(eval(NUMPINS == 32),1,`define(`QUARTER',7)',`define(`QUARTER', `eval($4 /4)')')
53         define(`OFFSET', `eval((QUARTER +1) /2)')
54         define(`WIDTH', `eval((QUARTER-1) *50 +2*75)')
55         ifelse(eval(NUMPINS == 32),1,`define(`SIDE',`eval((NUMPINS-2*QUARTER)/2)')', `define(`SIDE',QUARTER)')
56         define(`HEIGHT', `eval((SIDE-1)* 50 + 2*75)')
57         define(`CENTER', `eval(WIDTH / 2)')
58         define(`PUSHOUT', 20)    # was 15
59         define(`PUSHIN', 40)     # was 50
60 Element(0x00 "$1" "`$2'" "$3" 100 CENTER 0 100 0x00)
62         # top left half
63 define(`X', CENTER)
64 define(`Y', 0)
65 define(`count', 1)
66 forloop(`i', 1, OFFSET,
67         `PAD(X, eval(Y-PUSHOUT), X, eval(Y+PUSHIN), 20, count)' `define(`count', incr(count))'
68         `define(`X', eval(X-50))'
69         )
72         # left row
73 define(`X', 0)
74 define(`Y', 75)
75 define(`count', `eval(OFFSET+1)')
76 forloop(`i', 1, SIDE,
77         `PAD(eval(X-PUSHOUT), Y, eval(X+PUSHIN), Y, 20, count)' `define(`count', incr(count))'
78         `define(`Y', eval(Y+50))'
79         )
81         # bottom row
82 define(`X', 75)
83 define(`Y', HEIGHT)
84 forloop(`i', 1, QUARTER,
85         `PAD(X, eval(Y+PUSHOUT), X, eval(Y-PUSHIN), 20, count)' `define(`count', incr(count))'
86         `define(`X', eval(X+50))'
89         # right row
90 define(`X', WIDTH)
91 define(`Y', eval(HEIGHT-75))
92 forloop(`i', 1, SIDE,
93         `PAD(eval(X+PUSHOUT), Y, eval(X-PUSHIN), Y, 20, count)' `define(`count', incr(count))'
94         `define(`Y', eval(Y-50))'
97         # top right row
98 define(`X', eval(WIDTH-75))
99 define(`Y', 0)
100 forloop(`i', 1, eval(OFFSET-1),
101         `PAD(X, eval(Y-PUSHOUT), X, eval(Y+PUSHIN), 20, count)' `define(`count', incr(count))'
102         `ifelse(eval(count > NUMPINS), 1, `define(`count', 1)')'
103         `define(`X', eval(X-50))'
106 #       ElementLine(50 0 WIDTH 0 20)
107 #       ElementLine(WIDTH 0 WIDTH WIDTH 20)
108 #       ElementLine(WIDTH WIDTH 0 WIDTH 20)
109 #       ElementLine(0 WIDTH 0 50 20)
110 #       ElementLine(0 50 50 0 20)
112 # Modified by Thomas Olson to eliminate silkscreen blobbing over pads.
113 # Approach one: eliminate ElementLine transgression over pads. leave corners
114 # only.
116 define(`OLWIDTH', eval(WIDTH-50))
117 define(`OLHEIGHT', eval(HEIGHT-50))
118         
119         ElementLine(OLWIDTH 0 WIDTH 0 10)
120         ElementLine(WIDTH 0 WIDTH 50 10)
121         ElementLine(WIDTH OLHEIGHT WIDTH HEIGHT 10)
122         ElementLine(WIDTH HEIGHT OLWIDTH HEIGHT 10)
123         ElementLine(50 HEIGHT 0 HEIGHT 10)
124         ElementLine(0 HEIGHT 0 OLHEIGHT 10)
125         ElementLine(0 50 50 0 10)
127 # Approach two: move outline to edge of pads.
128 # The outline should be 15 off. But since the pad algorithm
129 # is not making the square pads correctly I give it a total of 30
130 # to clear the pads.
132 # Try 40 mils, and parameterize it.  1/12/00 LRD
133 define(`NOSMUDGE', 40)
134 define(`OLWIDTH', eval(WIDTH+NOSMUDGE))
135 define(`OLHEIGHT', eval(HEIGHT+NOSMUDGE))
137         ElementLine(50 -NOSMUDGE OLWIDTH -NOSMUDGE 10)
138         ElementLine(OLWIDTH -NOSMUDGE OLWIDTH OLHEIGHT 10)
139         ElementLine(OLWIDTH OLHEIGHT -NOSMUDGE OLHEIGHT 10)
140         ElementLine(-NOSMUDGE OLHEIGHT -NOSMUDGE 50 10)
141         ElementLine(-NOSMUDGE 50 50 -NOSMUDGE 10)
143         ElementArc(CENTER 100 20 20 0 360 10)
145         Mark(0 0)
148 # -------------------------------------------------------------------
149 # the definition of a plcc package with through-hole socket
151 # for example, Assmann A-CCS##-{Z,G} series
152 # or mil-max 940-XX-XXX-24-000000 series.
154 # mil-max specifies 0.035" drill hole and 0.062" pad.
155 # Assman says 0.0315" hole.  Also the mil-max outside
156 # dimensions are ever so slightly larger than Assmann so
157 # use those.  See for example
158 # http://www.milmax.com/images/products/pdf/092.PDF
160 # modified for correct pin numbering by Holm Tiffe
161 # $1: canonical name
162 # $2: name on PCB
163 # $3: value
164 # $4: number of pins
165 # $5: additional border
167 define(`PKG_PLCC_SOCKET',
168         `define(`QUARTER', `eval($4 /4)')
169         define(`OFFSET', eval((QUARTER +1) / 2))
170         define(`BORDER', `$5')
171         define(`WIDTH', `eval((OFFSET+1) *100 +2*BORDER)')
172         define(`CENTER', `eval(WIDTH / 2)')
173         define(`NUMPINS', `$4')
174         define(`PADSIZE', `62')
175         define(`DRILL', `35')
176 Element(0x00 "$1" "`$2'" "$3" eval(BORDER+200) CENTER 0 100 0x00)
178 # PLCC - 44 is a  special case, pad 1 in inner row
180 ifelse(eval(NUMPINS == 44 || NUMPINS == 28 || NUMPINS == 32), 1, `(
182 define(`X',eval(CENTER+50))
183 define(`Y',eval(BORDER+100))
184 define(`count',1)
186 ifelse(eval(NUMPINS == 44),1,`define(`ltr',3)',`define(`ltr',2)')
187 ifelse(eval(NUMPINS == 32),1,`define(`QUARTER',9)')
189 # top left row
190 forloop(`i', 1, ltr,
191         `PIN(X, Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
192         `PIN(eval(X-100), eval(Y-100), PADSIZE, DRILL, count)' `define(`count', incr(count))'
193         `define(`X', eval(X-100))'
196 #left row
197 define(`X',eval(X-100))
198 forloop(`i', 1, eval((QUARTER-1)/2),
199         `PIN(X, Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
200         `PIN(eval(X+100), Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
201         `define(`Y', eval(Y+100))'
203 PIN(X, Y, PADSIZE, DRILL, count)
204 define(`count', incr(count))
206 # bottom row
207 define(`X',eval(X+100))
208 define(`Y',eval(Y+100))
209 forloop(`i', 1, eval(ltr*2-1),
210         `PIN(X, Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
211         `PIN(X, eval(Y-100), PADSIZE, DRILL, count)' `define(`count', incr(count))'
212         `define(`X', eval(X+100))'
214 PIN(X, Y, PADSIZE, DRILL, count)
215 define(`count', incr(count))
217 # right row
218 define(`X',eval(X+100))
219 define(`Y',eval(Y-100))
220 forloop(`i', 1, eval((QUARTER-1)/2),
221         `PIN(X, Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
222         `PIN(eval(X-100), Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
223         `define(`Y', eval(Y-100))'
225 PIN(X, Y, PADSIZE, DRILL, count)
226 define(`count', incr(count))
228 # top rigth row
229 define(`X',eval(X-100))
230 define(`Y',eval(Y-100))
231 forloop(`i', 1, eval(ltr-1),
232         `PIN(X, Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
233         `PIN(X, eval(Y+100), PADSIZE, DRILL, count)' `define(`count', incr(count))'
234         `define(`X', eval(X-100))'
236 PIN(X, Y, PADSIZE, DRILL, count)
238 ifelse(eval(NUMPINS == 32),1,`define(`HEIGHT',eval(WIDTH+100))',`define(`HEIGHT',WIDTH)')
239         ElementLine(0 0 WIDTH 0 20)
240         ElementLine(WIDTH 0 WIDTH HEIGHT 20)
241         ElementLine(WIDTH HEIGHT 0 HEIGHT 20)
242         ElementLine(0 HEIGHT 0 0 20)
243         ElementLine(0 100 100 0 10)
244         ElementLine(eval(CENTER-50) 0 CENTER 50 10)
245         ElementLine(CENTER 50 eval(CENTER+50) 0 10)
247         Mark(CENTER BORDER)
250 #------------------------------------------------------------------------
251 # all other sockets, currently 20,52,68 and 84 pins
253 )', `(
255 # the default case, Pad 1 is on outer top row, in the middle
258 #top left row
260 define(`X',CENTER)
261 define(`Y',BORDER)
262 define(`count',1)
263 forloop(`i', 1, eval((QUARTER-1)/4),
264         `PIN(X, Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
265         `PIN(X, eval(Y+100), PADSIZE, DRILL, count)' `define(`count', incr(count))'
266         `define(`X',eval(X-100))'
268 PIN(X, Y, PADSIZE, DRILL, count)
269 define(`count', incr(count))
271 # left row
272 define(`Y',eval(BORDER+100))
273 define(`X',BORDER)
274 forloop(`i', 1, eval((QUARTER-1)/2),
275         `PIN(X, Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
276         `PIN(eval(X+100), Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
277         `define(`Y',eval(Y+100))'
279 PIN(X, Y, PADSIZE, DRILL, count)
280 define(`count', incr(count))
282 # bottom row
283 define(`X',eval(BORDER+100))
284 define(`Y',eval(WIDTH-BORDER))
285 forloop(`i', 1, eval((QUARTER-1)/2),
286         `PIN(X, Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
287         `PIN(X, eval(Y-100), PADSIZE, DRILL, count)' `define(`count', incr(count))'
288         `define(`X',eval(X+100))'
290 PIN(X, Y, PADSIZE, DRILL, count)
291 define(`count', incr(count))
293 # right row
294 define(`X',eval(WIDTH-BORDER))
295 define(`Y',eval(WIDTH-BORDER-100))
296 forloop(`i', 1, eval((QUARTER-1)/2),
297         `PIN(X, Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
298         `PIN(eval(X-100), Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
299         `define(`Y',eval(Y-100))'
301 PIN(X, Y, PADSIZE, DRILL, count)
302 define(`count', incr(count))
304 #top right row
306 define(`X',eval(WIDTH-BORDER-100))
307 define(`Y',BORDER)
308 forloop(`i', 1, eval((QUARTER-1)/4),
309         `PIN(X, Y, PADSIZE, DRILL, count)' `define(`count', incr(count))'
310         `PIN(X, eval(Y+100), PADSIZE, DRILL, count)' `define(`count', incr(count))'
311         `define(`X',eval(X-100))'
314         ElementLine(0 0 WIDTH 0 20)
315         ElementLine(WIDTH 0 WIDTH WIDTH 20)
316         ElementLine(WIDTH WIDTH 0 WIDTH 20)
317         ElementLine(0 WIDTH 0 0 20)
318         ElementLine(0 100 100 0 10)
319         ElementLine(eval(CENTER-50) 0 CENTER 50 10)
320         ElementLine(CENTER 50 eval(CENTER+50) 0 10)
322         Mark(CENTER BORDER)
324 )')')