From 5ca29ee4e9b202a1dd1d78874f5dcbdb5f2c2213 Mon Sep 17 00:00:00 2001 From: daniel Date: Sun, 9 Jul 2023 22:07:57 +0200 Subject: [PATCH] mcu jumper --- ergogen/config.yaml | 61 ++++++------- ergogen/footprints/promicro.js | 152 +++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+), 29 deletions(-) create mode 100644 ergogen/footprints/promicro.js diff --git a/ergogen/config.yaml b/ergogen/config.yaml index 1935454..867abb2 100644 --- a/ergogen/config.yaml +++ b/ergogen/config.yaml @@ -225,7 +225,7 @@ pcbs: A: ENCB B: GND C: ENCA - D: undefined + D: scroolwheel_undefined rotary: what: rotary where: [scrollwheel] @@ -249,18 +249,10 @@ pcbs: where: mcu params: orientation: down - GND: GND_MCU - VCC: VCC_MCU - RAW: RAW_MCU - RST: RST_MCU - P2: SDA - P3: SCL - P4: CS - P5: col0 - P6: col1 - P7: col2 - P8: col3 - P9: col4 + RAW: RAW_P1 + GND1: undefined + RST: RST_GND + VCC: VCC_GND P21: ENCA P20: ENCB P19: row0 @@ -269,85 +261,96 @@ pcbs: P14: row3 P16: row4 P10: row5 + P1: RAW_P1 + GND2: RST_GND + GND3: VCC_GND + P2: SDA + P3: SCL + P4: CS + P5: col0 + P6: col1 + P7: col2 + P8: col3 + P9: col4 jumper_f_raw: what: jumper where: mcu params: from: RAW - to: RAW_MCU + to: RAW_P1 side: "F" adjust: - shift: [-11.45, -4] + shift: [-11.45, -2.5] rotate: -90 jumper_f_rst: what: jumper where: mcu params: from: RST - to: RST_MCU + to: RST_GND side: "F" adjust: - shift: [-8.9, -4] + shift: [-8.9, -2.5] rotate: -90 jumper_f_vcc: what: jumper where: mcu params: from: VCC - to: VCC_MCU + to: VCC_GND side: "F" adjust: - shift: [-6.35, -4] + shift: [-6.35, -2.5] rotate: -90 jumper_f_gnd: what: jumper where: mcu params: from: GND - to: GND_MCU + to: RST_GND side: "F" adjust: - shift: [-8.9, 4] + shift: [-8.9, 2.5] rotate: 90 jumper_b_raw: what: jumper where: mcu params: from: RAW - to: RAW_MCU + to: RAW_P1 side: "B" adjust: - shift: [-11.45, 4] + shift: [-11.45, 2.5] rotate: 90 jumper_b_rst: what: jumper where: mcu params: from: RST - to: RST_MCU + to: RST_GND side: "B" adjust: - shift: [-8.9, 4] + shift: [-8.9, 2.5] rotate: 90 jumper_b_vcc: what: jumper where: mcu params: from: VCC - to: VCC_MCU + to: VCC_GND side: "B" adjust: - shift: [-6.35, 4] + shift: [-6.35, 2.5] rotate: 90 jumper_b_gnd: what: jumper where: mcu params: from: GND - to: GND_MCU + to: RST_GND side: "B" adjust: - shift: [-8.9, -4] + shift: [-8.9, -2.5] rotate: -90 niceview: what: niceview diff --git a/ergogen/footprints/promicro.js b/ergogen/footprints/promicro.js new file mode 100644 index 0000000..582aa52 --- /dev/null +++ b/ergogen/footprints/promicro.js @@ -0,0 +1,152 @@ +// Arduino ProMicro atmega32u4au +// Params +// orientation: default is down +// if down, power led will face the pcb +// if up, power led will face away from pcb + +module.exports = { + params: { + designator: 'MCU', + orientation: 'down', + RAW: {type: 'net', value: 'RAW'}, + GND1: {type: 'net', value: 'GND'}, + RST: {type: 'net', value: 'RST'}, + VCC: {type: 'net', value: 'VCC'}, + P21: {type: 'net', value: 'P21'}, + P20: {type: 'net', value: 'P20'}, + P19: {type: 'net', value: 'P19'}, + P18: {type: 'net', value: 'P18'}, + P15: {type: 'net', value: 'P15'}, + P14: {type: 'net', value: 'P14'}, + P16: {type: 'net', value: 'P16'}, + P10: {type: 'net', value: 'P10'}, + P1: {type: 'net', value: 'P1'}, + P0: {type: 'net', value: 'P0'}, + GND2: {type: 'net', value: 'GND'}, + GND3: {type: 'net', value: 'GND'}, + P2: {type: 'net', value: 'P2'}, + P3: {type: 'net', value: 'P3'}, + P4: {type: 'net', value: 'P4'}, + P5: {type: 'net', value: 'P5'}, + P6: {type: 'net', value: 'P6'}, + P7: {type: 'net', value: 'P7'}, + P8: {type: 'net', value: 'P8'}, + P9: {type: 'net', value: 'P9'} + }, + body: p => { + const standard = ` + (module ProMicro (layer F.Cu) (tedit 5B307E4C) + ${p.at /* parametric position */} + + ${'' /* footprint reference */} + (fp_text reference "${p.ref}" (at 0 0) (layer F.SilkS) ${p.ref_hide} (effects (font (size 1.27 1.27) (thickness 0.15)))) + (fp_text value "" (at 0 0) (layer F.SilkS) hide (effects (font (size 1.27 1.27) (thickness 0.15)))) + + ${''/* illustration of the (possible) USB port overhang */} + (fp_line (start -19.304 -3.81) (end -14.224 -3.81) (layer Dwgs.User) (width 0.15)) + (fp_line (start -19.304 3.81) (end -19.304 -3.81) (layer Dwgs.User) (width 0.15)) + (fp_line (start -14.224 3.81) (end -19.304 3.81) (layer Dwgs.User) (width 0.15)) + (fp_line (start -14.224 -3.81) (end -14.224 3.81) (layer Dwgs.User) (width 0.15)) + + ${''/* component outline */} + (fp_line (start -17.78 8.89) (end 15.24 8.89) (layer F.SilkS) (width 0.15)) + (fp_line (start 15.24 8.89) (end 15.24 -8.89) (layer F.SilkS) (width 0.15)) + (fp_line (start 15.24 -8.89) (end -17.78 -8.89) (layer F.SilkS) (width 0.15)) + (fp_line (start -17.78 -8.89) (end -17.78 8.89) (layer F.SilkS) (width 0.15)) + ` + function pins(def_neg, def_pos) { + return ` + ${''/* pin names */} + (fp_text user RAW (at -13.97 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user GND (at -11.43 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user RST (at -8.89 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user VCC (at -6.35 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P21 (at -3.81 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P20 (at -1.27 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P19 (at 1.27 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P18 (at 3.81 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P15 (at 6.35 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P14 (at 8.89 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P16 (at 11.43 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P10 (at 13.97 ${def_pos}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + + (fp_text user P01 (at -13.97 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P00 (at -11.43 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user GND (at -8.89 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user GND (at -6.35 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P02 (at -3.81 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P03 (at -1.27 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P04 (at 1.27 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P05 (at 3.81 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P06 (at 6.35 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P07 (at 8.89 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P08 (at 11.43 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P09 (at 13.97 ${def_neg}4.8 ${p.rot + 90}) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + + (fp_text user P01 (at -13.97 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P02 (at -11.43 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user GND (at -8.89 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user GND (at -6.35 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P02 (at -3.81 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P03 (at -1.27 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P04 (at 1.27 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P05 (at 3.81 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P06 (at 6.35 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P07 (at 8.89 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P08 (at 11.43 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P09 (at 13.97 ${def_pos}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + + (fp_text user RAW (at -13.97 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user GND (at -11.43 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user RST (at -8.89 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user VCC (at -6.35 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P21 (at -3.81 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P20 (at -1.27 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P19 (at 1.27 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P18 (at 3.81 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P15 (at 6.35 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P14 (at 8.89 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P16 (at 11.43 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + (fp_text user P10 (at 13.97 ${def_neg}4.8 ${p.rot + 90}) (layer B.SilkS) (effects (font (size 0.8 0.8) (thickness 0.15)))) + + ${''/* and now the actual pins */} + (pad 1 thru_hole circle (at -13.97 ${def_pos}7.62 ${p.rot}) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.RAW.str}) + (pad 2 thru_hole circle (at -11.43 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.GND1.str}) + (pad 3 thru_hole circle (at -8.89 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.RST.str}) + (pad 4 thru_hole circle (at -6.35 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.VCC.str}) + (pad 5 thru_hole circle (at -3.81 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P21.str}) + (pad 6 thru_hole circle (at -1.27 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P20.str}) + (pad 7 thru_hole circle (at 1.27 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P19.str}) + (pad 8 thru_hole circle (at 3.81 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P18.str}) + (pad 9 thru_hole circle (at 6.35 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P15.str}) + (pad 10 thru_hole circle (at 8.89 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P14.str}) + (pad 11 thru_hole circle (at 11.43 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P16.str}) + (pad 12 thru_hole circle (at 13.97 ${def_pos}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P10.str}) + + (pad 13 thru_hole circle (at -13.97 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P1.str}) + (pad 14 thru_hole circle (at -11.43 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P0.str}) + (pad 15 thru_hole circle (at -8.89 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.GND2.str}) + (pad 16 thru_hole circle (at -6.35 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.GND3.str}) + (pad 17 thru_hole circle (at -3.81 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P2.str}) + (pad 18 thru_hole circle (at -1.27 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P3.str}) + (pad 19 thru_hole circle (at 1.27 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P4.str}) + (pad 20 thru_hole circle (at 3.81 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P5.str}) + (pad 21 thru_hole circle (at 6.35 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P6.str}) + (pad 22 thru_hole circle (at 8.89 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P7.str}) + (pad 23 thru_hole circle (at 11.43 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P8.str}) + (pad 24 thru_hole circle (at 13.97 ${def_neg}7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) ${p.P9.str}) + ` + } + if(p.orientation == 'down') { + return ` + ${standard} + ${pins('-', '')}) + ` + } else { + return ` + ${standard} + ${pins('', '-')}) + ` + } + } +}