diff --git a/readme.md b/readme.md index ad3e414..84b6f06 100644 --- a/readme.md +++ b/readme.md @@ -2542,6 +2542,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o | 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 10nF | | 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 100nF | | 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 1uF | +| 1 | `smd_qfp(QFP50P1200X1200X160_64N)` | SMD chip: ATSAM4S4BA, package : QFP50P1200X1200X160_64N | | 1 | `smd_resistor(L2012C, 1u)` | SMD choke 0805 1u | | 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 | | 1 | `smd_resistor(RES0402, 1)` | SMD resistor 0402 1 0.0625W | @@ -3896,6 +3897,12 @@ E.g. 475A is 4.7uF 10V on the parts list. | `smd_pot_flat(type)` | Flat at the back of the wiper | | `smd_pot_size(type)` | Base length, width and height | | `smd_pot_wiper(type)` | Wiper diameter, offset, thickness, height, d1, d2, d3, d4 | +| `smd_qfp_body_size(type)` | Size of the body | +| `smd_qfp_gullwing(type)` | Gullwing S, L, R1, R2 | +| `smd_qfp_pin_size(type)` | Pins dimensions | +| `smd_qfp_pins(type)` | Number of pins | +| `smd_qfp_pitch(type)` | Pin pitch | +| `smd_qfp_slant(type)` | Angle of the slope | | `smd_res_end_cap(type)` | End cap width | | `smd_res_power(type)` | Power rating in Watts, 0 for choke | | `smd_res_size(type)` | Body length, width and height | @@ -3934,6 +3941,7 @@ E.g. 475A is 4.7uF 10V on the parts list. | `smd_inductor(type, value)` | Draw an SMD inductor | | `smd_led(type, colour, cutout)` | Draw an SMD LED with specified `colour` | | `smd_pot(type, value)` | Draw an SMD pot | +| `smd_qfp(type, value)` | Draw and SMD QFP package | | `smd_resistor(type, value)` | Draw an SMD resistor with specified value | | `smd_soic(type, value)` | Draw an SMD SOIC | | `smd_sot(type, value)` | Draw an SMD transistor | @@ -3957,6 +3965,7 @@ E.g. 475A is 4.7uF 10V on the parts list. | 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 | | 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 | | 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 | +| 1 | `smd_qfp(QFP50P1200X1200X160_64N)` | SMD chip: ATSAM4S4BA, package : QFP50P1200X1200X160_64N | | 1 | `smd_resistor(L2012C, 10u)` | SMD choke 0805 10u | | 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 | | 1 | `smd_resistor(RES0402, 1R0)` | SMD resistor 0402 1R0 0.0625W | diff --git a/tests/PCB.scad b/tests/PCB.scad index b592781..040f884 100644 --- a/tests/PCB.scad +++ b/tests/PCB.scad @@ -86,6 +86,8 @@ test_pcb = ["test_pcb", "Test PCB", [ 26, 10, -90, "smd_sot", SOT23, "2N7000"], [ 28, 16, -90, "smd_sot", SOT223, "LM117"], + [ 30, 30, -90, "smd_qfp", QFP50P1200X1200X160_64N, "ATSAM4S4BA"], + [ 45, 35, 0, "2p54header", 4, 1], [ 60, 35, 0, "2p54header", 5, 1, false, "blue" ], [ 60, 40, 180, "2p54header", 5, 1, false, undef, true], diff --git a/tests/SMDs.scad b/tests/SMDs.scad index f4820c8..bf95eab 100644 --- a/tests/SMDs.scad +++ b/tests/SMDs.scad @@ -68,6 +68,11 @@ module smds() { layout([for(i = smd_inductors) smd_inductor_leads(i).x], 1) let(i = smd_inductors[$i]) smd_inductor(i, "4R7"); + + translate([20, 6]) + layout([for(q = smd_qfps) smd_qfp_body_size(q).x], 3) + let(q = smd_qfps[$i]) + smd_qfp(q, ["ATSAM4S4BA"][$i]); } if($preview) diff --git a/tests/png/pcb.png b/tests/png/pcb.png index 34e6830..1341a2d 100644 Binary files a/tests/png/pcb.png and b/tests/png/pcb.png differ diff --git a/tests/png/smds.png b/tests/png/smds.png index eceeb8e..0249c4a 100644 Binary files a/tests/png/smds.png and b/tests/png/smds.png differ diff --git a/vitamins/pcb.scad b/vitamins/pcb.scad index fa4e18d..b6374cb 100644 --- a/vitamins/pcb.scad +++ b/vitamins/pcb.scad @@ -929,7 +929,6 @@ module molex_254_housing(ways) { //! Draw a Molex KK housing for(side = [-1, 1]) translate([-depth / 2 - tab.x / 2, side * (pitch / 2 - tab.y / 4) * ways, tab.z / 2]) cube(tab, center = true); - } } @@ -1154,6 +1153,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon if(show(comp, "smd_inductor")) smd_inductor(comp[4], comp[5]); if(show(comp, "smd_pot")) smd_pot(comp[4], comp[5]); if(show(comp, "smd_coax")) smd_coax(comp[4]); + if(show(comp, "smd_qfp")) smd_qfp(comp[4], comp[5]); if(show(comp, "vero_pin")) vero_pin(param(4, false)); if(show(comp, "terminal")) terminal_block(comp[5], comp[4]); if(show(comp, "text")) color("white") linear_extrude(eps) resize([comp[4], comp[5]]) text(comp[6], font = param(7, "Liberation Mono"), valign = "center", halign = "center"); diff --git a/vitamins/smd.scad b/vitamins/smd.scad index 0a297d2..0aee17e 100644 --- a/vitamins/smd.scad +++ b/vitamins/smd.scad @@ -583,3 +583,63 @@ module smd_coax(type) { //! Draw an SMD coaxial connector cube([contact.x, contact.y / 2, tube_wall]); } } + +function smd_qfp_body_size(type) = type[1]; //! Size of the body +function smd_qfp_slant(type) = type[2]; //! Angle of the slope +function smd_qfp_pins(type) = type[3]; //! Number of pins +function smd_qfp_pitch(type) = type[4]; //! Pin pitch +function smd_qfp_pin_size(type) = type[5]; //! Pins dimensions +function smd_qfp_gullwing(type) = type[6]; //! Gullwing S, L, R1, R2 + +module smd_qfp(type, value) { //! Draw and SMD QFP package + vitamin(str("smd_qfp(", type[0], "): SMD chip: ", value, ", package : ", type[0])); + + size = smd_qfp_body_size(type); + offset = size.z / 2 * tan(smd_qfp_slant(type)); + d = 3 * offset; + pitch = smd_qfp_pitch(type); + pin = smd_qfp_pin_size(type); + pins = smd_qfp_pins(type); + g = smd_qfp_gullwing(type); + s = g[0]; // length of top flat + l = g[1]; // length of bottom flat + r1 = g[2]; // top radius + r2 = g[3] + pin.z / 2; // bottom radius + pz = -size.z / 2 + pin.z / 2; + gullwing = rounded_path([[-1, 0, 0], [s, 0, 0], r1, [pin.x - l + r2, 0, pz], r2, [pin.x, 0, pz]], $fn = 32); + + color(grey(20)) + hull() { + translate_z(size.z / 2) + linear_extrude(eps) + offset(delta = d, chamfer = true) + offset(-d) + square([size.x, size.y], center = true); + + translate_z(size.z - eps) + linear_extrude(eps) + offset(-offset) + square([size.x, size.y], center = true); + + linear_extrude(eps) + offset(-offset) + square([size.x, size.y], center = true); + } + + color(silver) + for(a = [0 : 90: 270]) + rotate(a) + for(i = [0 : pins / 4 - 1]) + translate([size.x / 2, (i - (pins / 4 - 1) / 2) * pitch, size.z / 2]) + sweep(gullwing, rectangle_points(pin.y, pin.z)); + + color("white") + translate_z(size.z) + linear_extrude(eps) { + resize([size.x * 0.9, size.y / 8]) + text(value, halign = "center", valign = "center"); + + translate([(-(pins / 4 - 1) * pitch) / 2, (-(pins / 4 - 1) * pitch) / 2]) + circle(r = pin.y, $fn = 32); + } +} diff --git a/vitamins/smds.scad b/vitamins/smds.scad index 92fcf4b..de16083 100644 --- a/vitamins/smds.scad +++ b/vitamins/smds.scad @@ -79,4 +79,8 @@ U_FL_R_SMT_1 = ["U_FL_R_SMT_1", [2.6, 2.6, 0.35], 0.2, [2, 1.7, 1.25], [1.86, 0. smd_coaxs = [U_FL_R_SMT_1]; +QFP50P1200X1200X160_64N = ["QFP50P1200X1200X160_64N", [10, 10, 1.6], 12, 64, 0.5, [1, 0.2, 0.1], [0.2, 0.6, 0.1, 0.1]]; + +smd_qfps = [ QFP50P1200X1200X160_64N ]; + use