Root/modules/qfn.fpd

1/* MACHINE-GENERATED ! */
2
3frame pad_via {
4    __0: vec @(hole/2, hole/2)
5    __1: vec @(-hole/2, -hole/2)
6    hole . __0
7}
8
9frame pad_vias {
10    table
11        { ?variant, EV, Vias, hole }
12        { "HVQFN", 1.05mm, 20, 0.3mm }
13
14    table
15        { dx, dy }
16        { 1, 0 }
17        { 0, 1 }
18        { -1, 0 }
19        { 0, -1 }
20
21    set CV = (Vias/4-1)/2*EV
22
23    loop i = 0, Vias/4-1
24
25    __0: vec @((-dy-dx)*CV, (dx-dy)*CV)
26    __1: vec .(dx*i*EV, dy*i*EV)
27    frame pad_via .
28}
29
30frame paste_pad {
31    __0: vec @(SX/2, SY/2)
32    __1: vec @(-SX/2, -SY/2)
33    pad " " . __0 paste
34}
35
36frame paste {
37    set x = SE*(xi-SNX/2-0.5)
38
39    set y = SE*(yi-SNY/2-0.5)
40
41    loop xi = 1, SNX
42
43    loop yi = 1, SNY
44
45    __0: vec @(x, y)
46    frame paste_pad .
47}
48
49frame center_hole {
50    table
51        { ?variant, r }
52        { "CC2543", 0.8mm }
53
54    __0: vec @(r, r)
55    __1: vec @(-r, -r)
56    hole . __0
57}
58
59frame center {
60    set pin = pins+1
61
62    __0: vec @(X2/2, Y2/2)
63    __1: vec @(-X2/2, -Y2/2)
64    pad "$pin" . __0 bare
65    frame paste @
66    frame center_hole @
67}
68
69frame pad_round {
70    set ?round = 1
71
72    __0: vec @(px, py)
73    __1: vec @(-px, -py)
74    rpad "$pin" __0 .
75}
76
77frame pad_rect {
78    set ?round = 0
79
80    __0: vec @(px, py)
81    __1: vec @(-px, -py)
82    pad "$pin" __0 .
83}
84
85frame pad {
86    set px = (dx*X1+dy*Y1)/2
87
88    set py = (dy*X1+dx*Y1)/2
89
90    set pin = side*pins/4+i+1
91
92    __0: vec @(px, py)
93    __1: vec @(-px, -py)
94    __2: vec @(px, -py)
95    frame pad_rect @
96    frame pad_round @
97}
98
99frame side {
100    set pos = i-(pins/4-1)/2
101
102    loop i = 0, pins/4-1
103
104    __0: vec @(E*pos*dx, E*pos*dy)
105    frame pad .
106}
107
108frame pads {
109    table
110        { side, dx, dy }
111        { 0, 0, -1 }
112        { 1, 1, 0 }
113        { 2, 0, 1 }
114        { 3, -1, 0 }
115
116    __0: vec @(dy*C1/2, -dx*C2/2)
117    frame side .
118}
119
120frame index {
121}
122
123frame outline {
124    table
125        { index, dx, _, dy }
126        { 1, -1, 0, 0 }
127        { 0, 0, 0, -1 }
128        { 0, 1, 0, 0 }
129        { 0, 0, 0, 1 }
130
131    set mx = dx*C1/2
132
133    set my = dy*C2/2
134
135    set cx = mx+my
136
137    set cy = my-mx
138
139    set ax = -Y1/2*dx
140
141    set ay = -Y1/2*dy
142
143    set bx = -Y1/2*dy
144
145    set by = Y1/2*dx
146
147    __0: vec @(cx, cy)
148    w: vec .(ax, ay)
149    line __0 . w
150    __2: vec __0(bx, by)
151    line __0 . w
152    __1: vec .(index*(ax-bx), index*(ay-by))
153    line __2 . w
154}
155
156package "QFN$pins-$variant"
157unit mm
158allow holes
159
160table
161    { pins, variant, X1, Y1, X2, Y2, E, C1, C2, SE, SNX, SNY, SX, SY, round }
162    { 16, "LFCSP_LQ", 0.35mm, 1.2mm, 2.43mm, 2.43mm, 0.65mm, 4.1mm, 4.1mm, 1mm, 2, 2, 0.7mm, 0.7mm, 0 }
163    { 28, "Atmel", 0.24mm, 0.7mm, 2.4mm, 2.4mm, 0.45mm, 4.1mm, 4.1mm, 1mm, 2, 2, 0.8mm, 0.8mm, 0 }
164    { 28, "MCHP-ML", 0.37mm, 1mm, 4.25mm, 4.25mm, 0.65mm, 5.7mm, 5.7mm, 1mm, 3, 3, 0.65mm, 0.65mm, 0 }
165    { 28, "SiLabs", 0.25mm, 0.9mm, 3.3mm, 3.3mm, 0.5mm, 4.8mm, 4.8mm, 1.1mm, 3, 3, 0.9mm, 0.9mm, 0 }
166    { 32, "VHHD-2", 0.26mm, 0.69mm, 3.7mm, 3.7mm, 0.5mm, 5.1mm, 5.1mm, 0.8mm, 3, 3, 0.55mm, 0.55mm, 0 }
167    { 32, "VHHD-6", 0.26mm, 0.69mm, 3.4mm, 3.4mm, 0.5mm, 5.1mm, 5.1mm, 1.2mm, 2, 2, 0.75mm, 0.75mm, 0 }
168    { 32, "CC2543", 0.26mm, 0.69mm, 3.4mm, 3.4mm, 0.5mm, 5.1mm, 5.1mm, 1.2mm, 0, 0, 0.75mm, 0.75mm, 0 }
169    { 32, "HVQFN", 0.3mm, 1.08mm, 4.85mm, 4.85mm, 0.65mm, 6.9mm, 6.9mm, 1.7mm, 2, 2, 1mm, 1mm, 0 }
170    { 32, "Freescale", 0.25mm, 0.9mm, 3.6mm, 3.6mm, 0.5mm, 5mm, 5mm, 1.2mm, 2, 2, 0.9mm, 0.9mm, 1 }
171    { 48, "Freescale", 0.25mm, 0.9mm, 5.1mm, 5.1mm, 0.5mm, 7mm, 7mm, 1.1mm, 3, 3, 0.8mm, 0.8mm, 0 }
172
173set w = 5mil
174
175set zone_ratio_35 = ((SNX-1)*SE+SX)*((SNY-1)*SE+SY)/(X2*Y2)
176
177set paste_ratio_20 = SX*SY*SNX*SNY/(X2*Y2)
178
179frame pads @
180frame center @
181frame outline @
182frame pad_vias @
183measy side.__0 >> side.__0 3mm
184meas side.__0 -> side.__0 -1mm
185measy center.__1 >> center.__0 2.3mm
186measy pad.__1 >> pad.__1 3.5mm
187measy pad.__1 -> pad.__0 1mm
188meas pad.__1 -> pad.__2 -1mm
189measy paste_pad.__1 -> paste_pad.__0 1.8mm
190measy paste.__0 -> paste.__0 -C1
191measy paste_pad.__1 >> paste_pad.__0 -C1-1mm
192

Archive Download this file

Branches:
master



interactive