Example #1
0
# Micro USB
micro_usb = myelin_kicad_pcb.Component(
    footprint="myelin-kicad:micro_usb_b_smd_molex",
    identifier="USB",
    value="usb",
    desc=
    "Molex 1050170001 (Digikey WM1399CT-ND) surface mount micro USB socket with mounting holes.",
    pins=[
        Pin(1, "V", ["5V"]),
        Pin(5, "G", ["GND"]),
    ],
)

# Power LED
power_led_r = myelin_kicad_pcb.R0805("330R", "5V", "power_led_anode", ref="R1")
power_led = myelin_kicad_pcb.DSOD323("led", "GND", "power_led_anode", ref="L1")

# Outputs for 3 x GND
# Outputs for 3 x 5V
# Output for -5V
power_outputs = [
    myelin_kicad_pcb.Component(
        footprint="myelin-kicad:pin_60mil",
        identifier="P?",
        value="5V",
        pins=[Pin(1, "", "5V")],
    ) for out_id in range(3)
] + [
    myelin_kicad_pcb.Component(
        footprint="myelin-kicad:pin_60mil",
Example #2
0
        Pin(1, "", ["GND"]),
        Pin(2, "", ["5V"]),
        Pin(3, "", ["GND"]),
        Pin(4, "", ["5V"]),
        Pin(5, "", ["GND"]),
        Pin(6, "", ["5V"]),
    ],
)
power_cap = myelin_kicad_pcb.C0805("10u", "5V", "GND", ref="C2")

# Econet data line termination / biasing
# --------------------------------------

# 1k/220R/1k voltage divider drawing 2.25mA and giving 2.25/2.75V on D-/D+

termination_r1 = myelin_kicad_pcb.R0805(
    "1k", "5V", "bias_P", ref="R2")
termination_r2 = myelin_kicad_pcb.R0805(
    "220R", "bias_P", "bias_M", ref="R3")
termination_r3 = myelin_kicad_pcb.R0805(
    "1k", "bias_M", "GND", ref="R4")
termination_r4 = myelin_kicad_pcb.R0805(
    "56R", "bias_P", "econet_data_line_P", ref="R5")
termination_r5 = myelin_kicad_pcb.R0805(
    "56R", "bias_M", "econet_data_line_M", ref="R6")


# Clock
# -----

# This is based on Simon Inns' AVR clock: http://www.waitingforfriday.com/?p=19
Example #3
0
        Pin(17, "B1", ["ext_D4"]),
        Pin(18, "B0", ["ext_D3"]),
        # Ideally we would generate this ourselves, but it needs to be
        # !nOE NAND !nCS, which needs extra logic.
        Pin(19, "nCE", ["ext_dbuf_nCE"]),
        Pin(20, "VCC", ["3V3"]),
    ],
)
dbuf_cap = myelin_kicad_pcb.C0805("100n",
                                  "GND",
                                  "3V3",
                                  ref="C4",
                                  handsoldering=False)
dbuf_nCE_pullup = myelin_kicad_pcb.R0805("19k",
                                         "ext_dbuf_nCE",
                                         "3V3",
                                         ref="R1",
                                         handsoldering=False)

addr_buf_lo = myelin_kicad_pcb.Component(
    footprint="Housings_SSOP:SSOP-20_4.4x6.5mm_Pitch0.65mm",
    identifier="ABUFL",
    value="74LVC245",
    pins=[
        Pin(1, "A->B", ["3V3"]),
        Pin(2, "A0", ["A0"]),
        Pin(3, "A1", ["A1"]),
        Pin(4, "A2", ["A2"]),
        Pin(5, "A3", ["A3"]),
        Pin(6, "A4", ["A11"]),
        Pin(7, "A5", ["nOE"]),
        ],
    )
    return myelin_kicad_pcb.Component(
        footprint="myelin-kicad:cherry_mx_pcb_mount",
        identifier=ref,
        value="keyswitch",
        pins=[
            Pin(1, "1", a_net),
            Pin(2, "2", d_net),
        ],
    )

cherry_with_diode("x", "y")

ext = myelin_kicad_pcb.Component(
    footprint="Pin_Headers:Pin_Header_Straight_1x04_Pitch2.54mm",
    identifier="EXT",
    value="ext",
    pins=[
        Pin(1, "5V", ["5V"]),
        Pin(2, "X", ["x"]),
        Pin(3, "Y", ["x_y_diode"]),
        Pin(4, "GND", ["y"]),
    ],
)

myelin_kicad_pcb.R0805("10k", "x", "5V")


myelin_kicad_pcb.dump_netlist("cherry_mx.net")
        Pin("K4", "VCCA1", "3V3"),
        Pin("D10", "VCCA2", "3V3"),
        Pin("D3", "VCCA3", "3V3"),
        Pin("D4", "VCCA3", "3V3"),
        Pin("K9", "VCCA4", "3V3"),
        Pin("H7", "VCC_ONE", "3V3"),
        Pin("G8", "VCC_ONE", "3V3"),
        Pin("G6", "VCC_ONE", "3V3"),
        Pin("F7", "VCC_ONE", "3V3"),
    ],
)

# chip won't init unless this is pulled high
conf_done_pullup = myelin_kicad_pcb.R0805("10k",
                                          "fpga_CONF_DONE",
                                          "3V3",
                                          ref="R1",
                                          handsoldering=False)

# chip goes into error state if this is pulled low
nstatus_pullup = myelin_kicad_pcb.R0805("10k",
                                        "fpga_nSTATUS",
                                        "3V3",
                                        ref="R2",
                                        handsoldering=False)

# prevent spurious jtag clocks
tck_pulldown = myelin_kicad_pcb.R0805("1-10k",
                                      "fpga_TCK",
                                      "GND",
                                      ref="R3",
        Pin(24, "PA25/USBDP", ["USBDP"]),
        Pin(25, "PA27", ["PA27"]),
        Pin(26, "nRESET", ["mcu_RESET"]),
        Pin(27, "PA28", ["reset_in"]),
        Pin(28, "GND", ["GND"]),
        Pin(29, "VDDCORE", ["VDDCORE"]),  # regulated output, needs cap to GND
        Pin(30, "VDDIN", ["3V3"]),  # decouple to GND
        Pin(31, "PA30/SWCLK", ["mcu_SWCLK"]),
        Pin(32, "PA31/SWDIO", ["mcu_SWDIO"]),
    ],
)
mcu_cap1 = myelin_kicad_pcb.C0805("100n", "GND", "3V3", ref="C3")
mcu_cap2 = myelin_kicad_pcb.C0805("100n", "GND", "3V3", ref="C4")
mcu_cap3 = myelin_kicad_pcb.C0805("1u", "GND", "VDDCORE", ref="C5")
# SAM D21 has an internal pull-up, so this is optional
mcu_reset_pullup = myelin_kicad_pcb.R0805("10k", "mcu_RESET", "3V3", ref="R1")
# The SAM D21 datasheet says a 1k pullup on SWCLK is critical for reliability
mcu_swclk_pullup = myelin_kicad_pcb.R0805("1k", "mcu_SWCLK", "3V3", ref="R2")

# SWD header for programming and debug using a Tag-Connect TC2030-CTX
swd = myelin_kicad_pcb.Component(
    footprint="Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical",
    identifier="SWD",
    value="swd",
    exclude_from_bom=True,
    pins=[
        # Tag-Connect SWD layout: http://www.tag-connect.com/Materials/TC2030-CTX.pdf
        Pin(1, "VCC", "3V3"),
        Pin(2, "SWDIO/TMS", "mcu_SWDIO"),
        Pin(3, "nRESET", "mcu_RESET"),
        Pin(4, "SWCLK/TCK", "mcu_SWCLK"),
Example #7
0
diodes = [
    myelin_kicad_pcb.Component(
        footprint="Diode_SMD:D_SMA",
        identifier="D?",
        value="S1ATR",
        desc="Rectifier diode",
        pins=[
            Pin(1, "1", a),
            Pin(2, "2", k),
        ],
    )
    for a, k in [("5V", "5VD_cat"), ("BATT", "BATTD_cat")]
]

resistors = [
    myelin_kicad_pcb.R0805("47R", "5VD_cat", "NVR_POWER", ref="R1"),
    myelin_kicad_pcb.R0805("47R", "BATTD_cat", "NVR_POWER", ref="R2"),
    myelin_kicad_pcb.R0805("180R", "5VD_cat", "supercap_P", ref="R3"),
]

power_caps = [
    myelin_kicad_pcb.C0805("10u", "GND", "NVR_POWER", ref="C1"),
    myelin_kicad_pcb.C0805("100n", "GND", "NVR_POWER", ref="C2"),
]

supercap = myelin_kicad_pcb.Component(
    footprint="myelin-kicad:dgh255q5r5",
    identifier="C4",
    value="DGH255Q5R5",
    desc="Supercapacitor",
    pins=[
Example #8
0
            # JTAG
            Pin("A6", "TDI", "fpga_TDI"),
            Pin("A7", "TCK", "fpga_TCK"),
            Pin("B8", "TMS", "fpga_TMS"),
            Pin("C6", "TDO", "fpga_TDO"),
        ] + [
            # User IO
        ],
    )
]

# MachXO2 needs a pullup on INITN to complete configuration, and pullups are also recommended on PROGRAMN and DONE.
# For JTAG, TMS, TDI, TDO have internal weak pullups, and TCK needs a 4k7 pulldown.
fpga_pullups = [
    myelin_kicad_pcb.R0805("10k", "3V3", "fpga_INITN"),
    myelin_kicad_pcb.R0805("10k", "3V3", "fpga_PROGRAMN"),
    myelin_kicad_pcb.R0805("10k", "3V3", "fpga_DONE"),
    myelin_kicad_pcb.R0805("4k7", "GND", "fpga_TCK"),
]

# TODO MachXO2 JTAG header, Lattice format
# See: https://github.com/google/myelin-acorn-electron-hardware/blob/master/notes/pld_programming_and_jtag.md
cpld_jtag = myelin_kicad_pcb.Component(
    footprint="Connector_Multicomp:Multicomp_MC9A12-1034_2x05_P2.54mm_Vertical",
    identifier="JTAG",
    value="jtag",
    desc=
    "2x5 header for JTAG programming.  Use generic 0.1 inch header strip or Digikey ED1543-ND.",
    pins=[
        Pin(1, "TCK", "fpga_TCK"),  # top left
Example #9
0
Pin = myelin_kicad_pcb.Pin

caps = [
    # bulk
    myelin_kicad_pcb.C0805("10u", "GND", "5V", ref="C1"),
    # 74HCT245
    myelin_kicad_pcb.C0805("100n", "GND", "5V", ref="C2"),
    # EL1883
    myelin_kicad_pcb.C0805("100n", "GND", "5V", ref="C3"),
    myelin_kicad_pcb.C0805("100n", "CS_divided", "CS_coupled", ref="C4"),
    myelin_kicad_pcb.C0805("100n", "RSET", "GND", ref="C5"),
]

resistors = [
    # Some very light termination on the inputs
    myelin_kicad_pcb.R0805("10k NF", "R_in", "GND", ref="R1"),
    myelin_kicad_pcb.R0805("10k NF", "G_in", "GND", ref="R2"),
    myelin_kicad_pcb.R0805("10k NF", "B_in", "GND", ref="R3"),
    myelin_kicad_pcb.R0805("10k NF", "CS_in", "GND", ref="R4"),
    # Divide buffered sync down for EL1883
    myelin_kicad_pcb.R0805("4k TBD", "CS_buf", "CS_divided", ref="R5"),
    myelin_kicad_pcb.R0805(
        "1k TBD", "CS_divided", "GND",
        ref="R6"),  # TODO need 1:4 ratio, find better values
    # Output resistors for R/G/B (remote temination is 75R to GND)
    myelin_kicad_pcb.R0805("480R", "R_buf", "R_out", ref="R7"),
    myelin_kicad_pcb.R0805("480R", "G_buf", "G_out", ref="R8"),
    myelin_kicad_pcb.R0805("480R", "B_buf", "B_out", ref="R9"),
    # Output resistors for HS/VS (remote termination is 2kR to +5V)
    myelin_kicad_pcb.R0805("100R", "HS_buf", "HS_out", ref="R10"),
    myelin_kicad_pcb.R0805("100R", "VS_buf", "VS_out", ref="R11"),
        Pin( 6, "2Y",   "arc_RESET_buffered"),
        Pin( 7, "GND",  "GND"),
        Pin( 8, "3Y",   "arc_RESET"),
        Pin( 9, "3A",   "GND"),
        Pin(10, "3nOE", "ndrive_arc_RESET"),
        Pin(11, "4Y",   "arc_POR_R"),
        Pin(12, "4A",   "GND"),
        Pin(13, "4nOE", "ndrive_arc_POR"),
        Pin(14, "VCC",  "3V3"),
    ],
)
buffer_cap = myelin_kicad_pcb.C0805("100n", "GND", "3V3", ref="C13")

buffer_resistors = [
    # series resistor to avoid overloading BUF output during POR
    myelin_kicad_pcb.R0805("100R", "arc_POR_R", "arc_POR", ref="R3"),
    # optional pullups for ndrive_arc_RESET and ndrive_ARC_POR
    myelin_kicad_pcb.R0805("NF 10k", "ndrive_arc_POR", "3V3", ref="R6"),
    myelin_kicad_pcb.R0805("NF 10k", "ndrive_arc_RESET", "3V3", ref="R7"),
    # pulldown to ensure we don't get a fake rom_5V high when unplugged
    myelin_kicad_pcb.R0805("10k", "rom_5V", "GND", ref="R8")
]

reset_por_header = myelin_kicad_pcb.Component(
    footprint="Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical",
    identifier="RESET",
    value="reset/POR",
    desc="1x2 0.1 inch male header",
    pins=[
        Pin(1, "A", ["arc_RESET"]),
        Pin(2, "B", ["arc_POR"]),
        Pin(4, "PA14", ["mcu_MISO"]),  # sercom0.0/2.0
        Pin(5, "PA15", ["mcu_GPIO_D18_TDO"]),  # sercom0.1/2.1 == JTAG TDO
        Pin(6, "PA28_nRESET", ["mcu_RESET"]),
        Pin(7, "PA30", ["SWCLK"]),
        Pin(8, "PA31", ["SWDIO"]),
        Pin(9, "PA24", ["USBDM"]),
        Pin(10, "PA25", ["USBDP"]),
        Pin(11, "GND", ["GND"]),
        Pin(12, "VDD", ["3V3"]),
        Pin(13, "PA02", ["mcu_GPIO_D20_TCK"]),  # only gpio == JTAG TCK
        Pin(14, "PA04", ["mcu_GPIO_D8_nSD_SEL"]),  # sercom0.2/0.0 == /SD_SEL
    ],
)
mcu_cap = myelin_kicad_pcb.C0805("100n", "GND", "3V3", ref="C1")
# SAM D11 has an internal pull-up, so this is optional
mcu_reset_pullup = myelin_kicad_pcb.R0805("10k", "mcu_RESET", "3V3", ref="R1")
# The SAM D11 datasheet says a 1k pullup on SWCLK is critical for reliability
mcu_swclk_pullup = myelin_kicad_pcb.R0805("1k", "SWCLK", "3V3", ref="R2")

# # The ATSAMD11D chip (larger SO-20 version, which I'll probably never use because ATSAMD21 is better and smaller)
# mcu = myelin_kicad_pcb.Component(
#     footprint="Housings_SOIC:SOIC-20W_7.5x12.8mm_Pitch1.27mm",
#     identifier="MCU",
#     value="atsamd11d",
#     pins=[
#         Pin(1, "PA05", [""]),
#         Pin(2, "PA06", [""]),
#         Pin(3, "PA07", [""]),
#         Pin(4, "PA08", [""]),
#         Pin(5, "PA09", [""]),
#         Pin(6, "PA14", [""]),
    pins=[
        # DIN-5 pins are numbered weirdly -- 1, 4, 2, 5, 3 around the circle
        Pin(1, "D+", ["econet_data_line_P"]),
        Pin(4, "D-", ["econet_data_line_N"]),
        Pin(2, "GND", ["GND"]),
        Pin(5, "C+", ["econet_clock_line_P"]),
        Pin(3, "C-", ["econet_clock_line_N"]),
    ],
)

# Econet data line termination / biasing
# --------------------------------------

# 1k/220R/1k voltage divider drawing 2.25mA and giving 2.25/2.75V on D-/D+

termination_r1 = myelin_kicad_pcb.R0805("1k", "5V", "bias_P", ref="R13")
termination_r2 = myelin_kicad_pcb.R0805("220R", "bias_P", "bias_M", ref="R14")
termination_r3 = myelin_kicad_pcb.R0805("1k", "bias_M", "GND", ref="R15")
termination_r4 = myelin_kicad_pcb.R0805("56R",
                                        "bias_P",
                                        "econet_data_line_P",
                                        ref="R16")
termination_r5 = myelin_kicad_pcb.R0805("56R",
                                        "bias_M",
                                        "econet_data_line_N",
                                        ref="R17")

# Line driver
# -----------

line_driver = myelin_kicad_pcb.Component(
            Pin(40, "nRESET", ["cpu_nRESET"]),
        ],
    ) for cpuid in range(2)
]
cpu_cap = myelin_kicad_pcb.C0805("100n", "GND", "5V", ref="C1")
cpu_VPB_jumper = myelin_kicad_pcb.Component(
    footprint="Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm",
    identifier="JP1",
    desc="1x2 0.1 inch male header",
    value="VPB",
    pins=[
        Pin(1, "A", ["cpu_GND_VPB_2"]),
        Pin(2, "B", ["GND"]),
    ],
)
cpu_BE_pullup = myelin_kicad_pcb.R0805("4k7", "cpu_NC_BE", "5V", ref="R1")
cpld_16MHz_port = myelin_kicad_pcb.Component(
    footprint="Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm",
    identifier="M16",
    desc="1x2 0.1 inch male header",
    value="16MHz",
    pins=[
        Pin(1, "A", ["clk_16MHz"]),
        Pin(2, "B", ["GND"]),
    ],
)

# 3v3 regulator for buffers and whatever's on the other side of the connector
regulator = myelin_kicad_pcb.Component(
    footprint="TO_SOT_Packages_SMD:SOT-89-3",
    identifier="REG",
Example #14
0
diodes = [
    myelin_kicad_pcb.Component(
        footprint="Diode_SMD:D_SMA",
        identifier="D?",
        value="S1ATR",
        desc="Rectifier diode",
        pins=[
            Pin(1, "1", a),
            Pin(2, "2", k),
        ],
    ) for a, k in [("5V", "5VD_cat"), ("BATT", "BATTD_cat")]
]

resistors = [
    myelin_kicad_pcb.R0805("100R", "5VD_cat", "NVR_POWER", ref="R1"),
    myelin_kicad_pcb.R0805("100R", "BATTD_cat", "NVR_POWER", ref="R2"),
]

power_caps = [
    myelin_kicad_pcb.C0805("10u", "GND", "NVR_POWER", ref="C1"),
    myelin_kicad_pcb.C0805("100n", "GND", "NVR_POWER", ref="C2"),
]

pcf8583 = myelin_kicad_pcb.Component(
    footprint="Package_DIP:DIP-8_W7.62mm",
    identifier="NVRAM",
    value="PCF8583P",
    pins=[
        Pin(1, "OSCI", "OSCI"),
        Pin(2, "OSCO", "OSCO"),
        Pin(24, "PA25/USBDP", ["USBDP"]),
        Pin(25, "PA27", ["PA27"]),
        Pin(26, "nRESET", ["mcu_RESET"]),
        Pin(27, "PA28", ["PA28"]),
        Pin(28, "GND", ["GND"]),
        Pin(29, "VDDCORE", ["VDDCORE"]),  # regulated output, needs cap to GND
        Pin(30, "VDDIN", ["3V3"]),  # decouple to GND
        Pin(31, "PA30/SWCLK", ["SWCLK"]),
        Pin(32, "PA31/SWDIO", ["SWDIO"]),
    ],
)
mcu_cap1 = myelin_kicad_pcb.C0805("100n", "GND", "3V3", ref="C3")
mcu_cap2 = myelin_kicad_pcb.C0805("100n", "GND", "3V3", ref="C4")
mcu_cap3 = myelin_kicad_pcb.C0805("1u", "GND", "VDDCORE", ref="C5")
# SAM D21 has an internal pull-up, so this is optional
mcu_reset_pullup = myelin_kicad_pcb.R0805("10k", "mcu_RESET", "3V3", ref="R1")
# The SAM D21 datasheet says a 1k pullup on SWCLK is critical for reliability
mcu_swclk_pullup = myelin_kicad_pcb.R0805("1k", "SWCLK", "3V3", ref="R2")

# SWD header for programming and debug
swd = myelin_kicad_pcb.Component(
    footprint="Pin_Headers:Pin_Header_Straight_2x05_Pitch1.27mm_SMD",
    identifier="SWD",
    value="swd",
    pins=[
        # Pin numbers zig-zag:
        # 1 VCC  2 SWDIO
        # 3 GND  4 SWCLK
        # 5 GND  6 NC
        # 7 NC   8 NC
        # 9 NC  10 /RESET
Example #16
0
# TODO add soldermask chevrons in 3 corners of board to detect misregistration http://iconnect007.media/index.php/article/47987/soldermask-registration-considerations-for-fine-pitch-area-array-package-ass
# TODO make sure the BOM comes out OK
# TODO read stencil design guidelines in IPC-7525A

# (done) can I use BGA?  xc95144 comes in cs144 package, which is 0.8mm 12x12mm (c.f. 22x22mm for TQ144) and flash comes in 1mm pitch 13x11 64-ball BGA

# (done) Figure out how to correctly route the flash.  Can we use a daisy chain with stubs?  Rule of thumb from https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/an/an224.pdf is that TDstub < 1/3 of rise time.  In our case rise time is about 1.5-2ns, so worst case Tdstub should be < 0.5ns, so 7.5cm.

# (done) figure out how to correctly daisy chain all the flash address and control signals through the three BGAs. FLASH2/FLASH3 are the best bet so far: 8 data lines out top and bottom, 26 signals coming out the left side: A0-21 plus four.  need to get these out the right side too.

# (done) add 3v3 reg
# (done) use tag-connect instead of SWD, for low profile? -- http://www.tag-connect.com/Materials/TC2030-CTX.pdf
# (done) add power diodes so we can power from USB or arc

# (done) add 10k pullup for Romcs* to help when not plugged in
romcs_pullup = myelin_kicad_pcb.R0805("10k", "rom_nCS", "5V", ref="R4")
a21_pullup = myelin_kicad_pcb.R0805("10k", "rom_A19", "5V", ref="R5")
# (done) add jumpers so we can get LA18, LA19 and LA20 from flying leads on pre-A3000 machines (IC28 on A3xx)
# (done) add pin to wire to A21, so we can support 4MB ROMs
# (done) add pin to wire to reset, so we can re-reset the machine once the board is alive
# (done) make footprint for xilinx_csg144
# (done) make footprint for s29 flash
# (done) add USB MCU (atsamd51 or 21?)
# (done) add 96MHz (64MHz?) oscillator footprint, in case we want that clock

osc = myelin_kicad_pcb.Component(
    footprint=
    "Oscillator:Oscillator_SMD_Abracon_ASE-4Pin_3.2x2.5mm_HandSoldering",
    identifier="OSC",
    value="osc",
    # When ordering: double check it's the 3.2x2.5mm package
Example #17
0
        Pin(1, "TCK", ["cpld_TCK"]),  # top left
        Pin(2, "GND", ["GND"]),  # top right
        Pin(3, "TDO", ["cpld_TDO"]),
        Pin(4, "3V3", ["3V3"]),
        Pin(5, "TMS", ["cpld_TMS"]),
        Pin(6, "NC"),
        Pin(7, "NC"),
        Pin(8, "NC"),
        Pin(9, "TDI", ["cpld_TDI"]),
        Pin(10, "GND", ["GND"]),
    ],
)

# Reset level conversion using diode + pullup
reset_3v3_pullup = myelin_kicad_pcb.R0805("10k",
                                          "3V3_PI",
                                          "tube_nRST",
                                          ref="R5")
reset_3v3_diode = myelin_kicad_pcb.DSOD323("BAT54",
                                           "cpu_nRST",
                                           "tube_nRST",
                                           ref="D1")

# DONE(r1) lcsoft mini footprint.  need to flip it to look like this, so the lcsoft
# mini board can plug in to the top of the cartridge.

#   R2 R1       L2 L1
#   R4 R3       L4 L3
#    ...         ...
#  R20 R19     L20 L19

# DONE(r1) double check against real lcsoft PCB
Example #18
0
        Pin(24, "PA25/USBDP", ["USBDP"]),
        Pin(25, "PA27", ["PA27"]),
        Pin(26, "nRESET", ["mcu_RESET"]),
        Pin(27, "PA28", ["reset_in"]),
        Pin(28, "GND", ["GND"]),
        Pin(29, "VDDCORE", ["VDDCORE"]),  # regulated output, needs cap to GND
        Pin(30, "VDDIN", ["3V3"]),  # decouple to GND
        Pin(31, "PA30/SWCLK", ["mcu_SWCLK"]),
        Pin(32, "PA31/SWDIO", ["mcu_SWDIO"]),
    ],
)
mcu_cap1 = myelin_kicad_pcb.C0805("100n", "GND", "3V3", ref="C3")
mcu_cap2 = myelin_kicad_pcb.C0805("100n", "GND", "3V3", ref="C4")
mcu_cap3 = myelin_kicad_pcb.C0805("1u", "GND", "VDDCORE", ref="C5")
# SAM D21 has an internal pull-up, so this is optional
mcu_reset_pullup = myelin_kicad_pcb.R0805("10k", "mcu_RESET", "3V3", ref="R1")
# The SAM D21 datasheet says a 1k pullup on SWCLK is critical for reliability
mcu_swclk_pullup = myelin_kicad_pcb.R0805("1k", "mcu_SWCLK", "3V3", ref="R2")

# SWD header for programming and debug using a Tag-Connect TC2030-CTX
swd = myelin_kicad_pcb.Component(
    footprint="Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical",
    identifier="SWD",
    value="swd",
    exclude_from_bom=True,
    pins=[
        # Tag-Connect SWD layout: http://www.tag-connect.com/Materials/TC2030-CTX.pdf
        Pin(1, "VCC", "3V3"),
        Pin(2, "SWDIO/TMS", "mcu_SWDIO"),
        Pin(3, "nRESET", "mcu_RESET"),
        Pin(4, "SWCLK/TCK", "mcu_SWCLK"),