def cherry_with_diode(a_net, b_net, ref="K?"): # SOD-323 = 1.7 x 1.25 x 0.95 mm body # c.f. 0805 resistor = 2.032 x 1.27 mm d_net = "%s_%s_diode" % (a_net, b_net) diode = myelin_kicad_pcb.Component( footprint="Diodes_SMD:D_SOD-323_HandSoldering", identifier="%sD" % ref, value="diode", pins=[ Pin(2, "2", d_net), Pin(1, "1", b_net), ], ) 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), ], )
mcu = myelin_kicad_pcb.Component( footprint="Housings_QFP:TQFP-32_7x7mm_Pitch0.8mm", identifier="MCU", value="ATSAMD21E18A-AU", # 256k flash, 32k sram, 32 pins desc= "IC ARM MCU; https://www.digikey.com/products/en?keywords=ATSAMD21E18A-AU-ND", pins=[ # We use a 32.768kHz crystal and the 96MHz FDPLL with some massive # multiplier. This seems a bit weird, but all the ATSAMD21 designs I # can find are clocked this way. The FDPLL has an input divider, so it # should be possible to use an 8MHz input, but nobody seems to do that. Pin(1, "PA00/XIN32", ["XTAL_IN"]), Pin(2, "PA01/XOUT32", ["XTAL_OUT"]), Pin(3, "PA02/AIN0", ["PA02"]), Pin(4, "PA03/ADC_VREFA/AIN1", ["PA03"]), Pin(5, "PA04/SERCOM0.0/AIN4", ["fpga_TDO"]), Pin(6, "PA05/SERCOM0.1/AIN5", ["fpga_TCK"]), Pin(7, "PA06/SERCOM0.2/AIN6", ["fpga_TMS"]), Pin(8, "PA07/SERCOM0.3/AIN7", ["fpga_TDI"]), Pin(9, "VDDANA", ["3V3"]), # decouple to GND Pin(10, "GND", ["GND"]), Pin(11, "PA08/NMI/SERCOM2.0/AIN16", ["fpga_spi_mosi"]), Pin(12, "PA09/SERCOM2.1/AIN17", ["fpga_spi_sck"]), Pin(13, "PA10/SERCOM2.2/AIN18", ["fpga_clock_48mhz"]), # GCLK_IO[4] - clock output for FPGA Pin(14, "PA11/SERCOM2.3/AIN19", ["target_power_out" ]), # also GCLK_IO[5] if we want a second clock output Pin(15, "PA14/XIN/SERCOM4.2", ["fpga_spi_cs"]), Pin(16, "PA15/XOUT/SERCOM4.3", ["fpga_spi_miso"]), Pin(17, "PA16/SERCOM1.0", ["PA16"]), Pin(18, "PA17/SERCOM1.1", ["PA17"]), Pin(19, "PA18/SERCOM1.2", ["PA18"]), Pin(20, "PA19/SERCOM1.3", ["PA19"]), Pin(21, "PA22/SERCOM3.0", ["mcu_TXD"]), Pin(22, "PA23/SERCOM3.1/USBSOF", ["mcu_RXD"]), Pin(23, "PA24/USBDM", ["USBDM"]), 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 = myelin_kicad_pcb.Component( footprint="Housings_QFP:TQFP-32_7x7mm_Pitch0.8mm", identifier="MCU", value="ATSAMD21E18A", # 256k flash, 32k sram, 32 pins pins=[ # We use a 32.768kHz crystal and the 96MHz FDPLL with some massive # multiplier. This seems a bit weird, but all the ATSAMD21 designs I # can find are clocked this way. The FDPLL has an input divider, so it # should be possible to use an 8MHz input, but nobody seems to do that. Pin(1, "PA00/XIN32", ["XTAL_IN"]), Pin(2, "PA01/XOUT32", ["XTAL_OUT"]), Pin(3, "PA02/AIN0", ["PA02"]), Pin(4, "PA03/ADC_VREFA/AIN1", ["PA03"]), Pin(5, "PA04/SERCOM0.0/AIN4", ["PA04"]), Pin(6, "PA05/SERCOM0.1/AIN5", ["PA05"]), Pin(7, "PA06/SERCOM0.2/AIN6", ["PA06"]), Pin(8, "PA07/SERCOM0.3/AIN7", ["PA07"]), Pin(9, "VDDANA", ["3V3"]), # decouple to GND Pin(10, "GND", ["GND"]), Pin(11, "PA08/NMI/SERCOM2.0/AIN16", ["PA08"]), Pin(12, "PA09/SERCOM2.1/AIN17", ["PA09"]), Pin(13, "PA10/SERCOM2.2/AIN18", ["PA10"]), Pin(14, "PA11/SERCOM2.3/AIN19", ["PA11"]), Pin(15, "PA14/XIN/SERCOM4.2", ["PA14"]), Pin(16, "PA15/XOUT/SERCOM4.3", ["PA15"]), Pin(17, "PA16/SERCOM1.0", ["PA16"]), Pin(18, "PA17/SERCOM1.1", ["PA17"]), Pin(19, "PA18/SERCOM1.2", ["PA18"]), Pin(20, "PA19/SERCOM1.3", ["PA19"]), Pin(21, "PA22/SERCOM3.0", ["mcu_TXD"]), Pin(22, "PA23/SERCOM3.1/USBSOF", ["mcu_RXD"]), Pin(23, "PA24/USBDM", ["USBDM"]), 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"]), ], )
# motherboard. PROJECT_NAME = "bbc_power" import sys, os here = os.path.dirname(sys.argv[0]) sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin # Barrel jack barrel = myelin_kicad_pcb.Component( footprint="myelin-kicad:dc10a_barrel_jack", identifier="VIN", value="5V input", pins={ "TIP": "5V", "RING": "GND", }, ) # 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"]),
import sys, os here = os.path.dirname(sys.argv[0]) sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin # Power # ----- # 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"]), ], ) ext_power = myelin_kicad_pcb.Component( footprint="Pin_Headers:Pin_Header_Straight_2x03_Pitch2.54mm", identifier="EXTPWR", value="ext pwr", desc="1x3 0.1 inch male header", pins=[ Pin(1, "", ["GND"]), Pin(2, "", ["5V"]), Pin(3, "", ["GND"]), Pin(4, "", ["5V"]),
signal_buf = [ myelin_kicad_pcb.Component( footprint="Package_SO:SSOP-20_4.4x6.5mm_P0.65mm", identifier=ident, value="74HCT245PW", desc= "https://www.digikey.com/product-detail/en/nexperia-usa-inc/74HCT245PW118/1727-6353-1-ND", pins=[ Pin(1, "A->B", DIR), Pin(2, "A0", conn[0][0]), Pin(3, "A1", conn[1][0]), Pin(4, "A2", conn[2][0]), Pin(5, "A3", conn[3][0]), Pin(6, "A4", conn[4][0]), Pin(7, "A5", conn[5][0]), Pin(8, "A6", conn[6][0]), Pin(9, "A7", conn[7][0]), Pin(10, "GND", "GND"), Pin(11, "B7", conn[7][1]), Pin(12, "B6", conn[6][1]), Pin(13, "B5", conn[5][1]), Pin(14, "B4", conn[4][1]), Pin(15, "B3", conn[3][1]), Pin(16, "B2", conn[2][1]), Pin(17, "B1", conn[1][1]), Pin(18, "B0", conn[0][1]), Pin(19, "nCE", nOE), Pin(20, "VCC", power), ], ) for power, ident, DIR, nOE, conn in [( "5V",
PROJECT_NAME = "pcf8583_daughterboard" import sys, os here = os.path.dirname(sys.argv[0]) sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin 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"),
a3000_ram_header = myelin_kicad_pcb.Component( footprint="myelin-kicad:a3000_ram_header", identifier="RAM", value="Extension socket to connect to RAM header on A3000 motherboard, and mezzanine RAM board", pins=[ # 32 data lines, 8 control lines (bank, oe, wr, ras, 4xcas), four 5V, six GND, 10 address = 60 pins Pin( 1, "5V", "5V"), Pin( 2, "Rd1", "ram_D1"), Pin( 3, "Rd0", "ram_D0"), Pin( 4, "Bank", "ram_BANK"), Pin( 5, "Oe2", "ram_nOE2"), Pin( 6, "GND", "GND"), Pin( 7, "Wr2", "ram_nWR2"), Pin( 8, "Ras*", "ram_nRAS"), Pin( 9, "Ra0", "ram_RA0"), Pin(10, "Cas0*", "ram_nCAS0"), Pin(11, "Ra1", "ram_RA1"), Pin(12, "5V", "5V"), Pin(13, "Ra8", "ram_RA8"), Pin(14, "Ra3", "ram_RA3"), Pin(15, "Rd27", "ram_D27"), Pin(16, "Cas1*", "ram_nCAS1"), Pin(17, "Rd3", "ram_D3"), Pin(18, "GND", "GND"), Pin(19, "Rd2", "ram_D2"), Pin(20, "Rd4", "ram_D4"), Pin(21, "Rd5", "ram_D5"), Pin(22, "Rd7", "ram_D7"), Pin(23, "Rd6", "ram_D6"), Pin(24, "GND", "GND"), Pin(25, "Rd8", "ram_D8"), Pin(26, "Rd9", "ram_D9"), Pin(27, "Rd11", "ram_D11"), Pin(28, "Rd10", "ram_D10"), Pin(29, "Rd12", "ram_D12"), Pin(30, "Rd13", "ram_D13"), Pin(31, "Rd15", "ram_D15"), Pin(32, "Rd14", "ram_D14"), Pin(33, "Cas2*", "ram_nCAS2"), Pin(34, "Ra4", "ram_RA4"), Pin(35, "Rd16", "ram_D16"), Pin(36, "GND", "GND"), Pin(37, "Rd17", "ram_D17"), Pin(38, "Rd19", "ram_D19"), Pin(39, "Rd18", "ram_D18"), Pin(40, "Ra5", "ram_RA5"), Pin(41, "Rd20", "ram_D20"), Pin(42, "GND", "GND"), Pin(43, "Rd21", "ram_D21"), Pin(44, "Ra9", "ram_RA9"), Pin(45, "Rd23", "ram_D23"), Pin(46, "Ra7", "ram_RA7"), Pin(47, "Ra6", "ram_RA6"), Pin(48, "5V", "5V"), Pin(49, "Ra2", "ram_RA2"), Pin(50, "Cas3*", "ram_nCAS3"), Pin(51, "Rd25", "ram_D25"), Pin(52, "Rd24", "ram_D24"), Pin(53, "Rd26", "ram_D26"), Pin(54, "GND", "GND"), Pin(55, "Rd22", "ram_D22"), Pin(56, "Rd29", "ram_D29"), Pin(57, "Rd30", "ram_D30"), Pin(58, "Rd28", "ram_D28"), Pin(59, "Rd31", "ram_D31"), Pin(60, "5V", "5V"), ], )
cpld = myelin_kicad_pcb.Component( footprint="myelin-kicad:xilinx_vqg64", identifier="CPLD", value="XC9572XL-64VQG", desc="Xilinx XC9572XL in 64-pin 0.5mm TQFP package. Any speed or temperature grade is OK.", buses=["bbc_A", "flash_A", "D", "cpld_JP"], pins=[ # 52 user pins # 17 used by bbc_A # 19 used by flash_A # 8 used by D # flash_nCE, flash_nWE, flash_nOE # bbc_nCE # 4 used by cpld_SCK, cpld_MISO, cpld_MOSI, cpld_SS # it would be nice if we had two more to allow external selection of flash bank. # we could wire flash_nCE low and ignore bbc_nCE. Pin(1, "P2.10", ["D6"]), Pin(2, "GTS2", ["D7"]), Pin(4, "P2.12", ["bbc_A0"]), Pin(5, "GTS1", ["bbc_A1"]), Pin(6, "P2.15", ["bbc_A2"]), Pin(7, "P2.17", ["bbc_A3"]), Pin(8, "P1.2", ["bbc_A10"]), Pin(9, "P1.5", ["bbc_A4"]), Pin(10, "P1.6", ["bbc_A16"]), Pin(11, "P1.8", ["bbc_A5"]), Pin(12, "P1.3", ["bbc_A11"]), Pin(13, "P1.4", ["bbc_A6"]), Pin(15, "P1.GCK1", ["bbc_A9"]), # Should have put SCK on one of these! Pin(16, "P1.GCK2", ["bbc_A7"]), # Try drilling out one of the tracks and Pin(17, "P1.GCK3", ["bbc_A8"]), # using it as a spare GCK pin. Pin(18, "P1.10", ["bbc_A12"]), Pin(19, "P1.15", ["cpld_JP1"]), # TODO(r2) shuffle pins around so Pin(20, "P1.17", ["bbc_A15"]), # cpld_SCK ends up on a GCK. Pin(22, "P3.2", ["cpld_JP0"]), Pin(23, "P1.12", ["bbc_A13"]), Pin(24, "P3.5", ["bbc_A14"]), Pin(25, "P3.8", ["cpld_MISO"]), Pin(27, "P3.9", ["cpld_MOSI"]), Pin(31, "P3.3", ["cpld_SCK"]), Pin(32, "P3.4", ["cpld_SS"]), Pin(33, "P3.11", ["flash_A0"]), Pin(34, "P3.6", ["flash_A1"]), Pin(35, "P3.14", ["flash_A2"]), Pin(36, "P3.15", ["flash_A3"]), Pin(38, "P3.17", ["flash_A4"]), Pin(39, "P3.10", ["flash_A5"]), Pin(40, "P3.12", ["flash_A6"]), Pin(42, "P3.16", ["flash_A7"]), Pin(43, "P4.2", ["flash_A12"]), Pin(44, "P4.5", ["flash_A15"]), Pin(45, "P4.8", ["flash_A16"]), Pin(46, "P4.3", ["flash_A18"]), Pin(47, "P4.4", ["flash_nWE"]), Pin(48, "P4.11", ["flash_A17"]), Pin(49, "P4.6", ["flash_A14"]), Pin(50, "P4.14", ["flash_A13"]), Pin(51, "P4.10", ["flash_A8"]), Pin(52, "P4.12", ["flash_A9"]), Pin(56, "P4.15", ["flash_A11"]), Pin(57, "P4.17", ["flash_nOE"]), Pin(58, "P2.3", ["flash_A10"]), Pin(59, "P2.4", ["D0"]), Pin(60, "P2.2", ["D2"]), Pin(61, "P2.5", ["D3"]), Pin(62, "P2.6", ["D4"]), Pin(63, "P2.8", ["D1"]), Pin(64, "P2.GSR", ["D5"]), # 8 power pins Pin(3, "VCCINT_3V3", ["3V3"]), Pin(14, "GND", ["GND"]), Pin(21, "GND", ["GND"]), Pin(26, "VCCIO_2V5_3V3", ["3V3"]), Pin(37, "VCCINT_3V3", ["3V3"]), Pin(41, "GND", ["GND"]), Pin(54, "GND", ["GND"]), Pin(55, "VCCIO_2V5_3V3", ["3V3"]), # 4 JTAG programming interface pins Pin(28, "TDI", ["cpld_TDI"]), Pin(29, "TMS", ["cpld_TMS"]), Pin(30, "TCK", ["cpld_TCK"]), Pin(53, "TDO", ["cpld_TDO"]), ], )
import sys, os here = os.path.dirname(sys.argv[0]) sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin # Power # ----- # Micro USB micro_usb = myelin_kicad_pcb.Component( footprint="myelin-kicad:micro_usb_b_smd_molex", identifier="USB", value="usb", pins=[ Pin(1, "V", ["5V"]), Pin(5, "G", ["GND"]), ], ) ext_power = myelin_kicad_pcb.Component( footprint="Pin_Headers:Pin_Header_Straight_2x03_Pitch2.54mm", identifier="EXTPWR", value="ext pwr", pins=[ Pin(1, "", ["GND"]), Pin(2, "", ["5V"]), Pin(3, "", ["GND"]), Pin(4, "", ["5V"]), Pin(5, "", ["GND"]),
PROJECT_NAME = "arc_keyboard_to_a3000" import sys, os here = os.path.dirname(sys.argv[0]) sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin arc_keyboard_din = myelin_kicad_pcb.Component( footprint="myelin-kicad:minidin_6_ps2_pcb_mount", identifier="KB", value="CUI-MD60S", pins=[ Pin(1, "RESET", "RESET"), Pin(2, "NC", "pin2"), Pin(3, "GND", "GND"), Pin(4, "5V", "5V"), Pin(5, "arc KIN / kb TXD", "KIN"), Pin(6, "arc KOUT / kb RXD", "KOUT"), # Ground the shield too, just in case Pin("S1", "", "GND"), ], ) header = myelin_kicad_pcb.Component( footprint="Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical", identifier="HDR", value="A3000 KB", desc="1x6 0.1 inch male header", pins=[ Pin(1, "RESET", "RESET"), # Arc RESET, ps2 DATA
sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin quad_nand = myelin_kicad_pcb.Component( footprint="Housings_SOIC:SOIC-14_3.9x8.7mm_Pitch1.27mm", identifier="U1", value="74HCT00", pins=[ Pin(1, "1A", ["bbc_n2MHzE"]), Pin(2, "1B", ["bbc_n2MHzE"]), Pin(3, "1Y", ["bbc_nn2MHzE"]), Pin(4, "2A", ["bbc_nn2MHzE"]), Pin(5, "2B", ["bbc_RnW"]), Pin(6, "2Y", ["flash_nOE"]), Pin(7, "GND", ["GND"]), Pin(8, "3Y", ["flash_nWE"]), Pin(9, "3A", ["bbc_nn2MHzE"]), Pin(10, "3B", ["bbc_nRnW"]), Pin(11, "4Y", ["flash_CS"]), Pin(12, "4A", ["bbc_nCS0"]), Pin(13, "4B", ["bbc_nCS1"]), Pin(14, "VCC", ["5V"]), ], ) nand_cap = myelin_kicad_pcb.C0805("100n", "5V", "GND", ref="C1") # 128kB SRAM chip # --------------- # 17 address lines, 8 data lines, 3 control lines, 1 unused, 1 NC, 2 power
# extra protection against short circuits. PROJECT_NAME = "pcf8583_daughterboard" import sys, os here = os.path.dirname(sys.argv[0]) sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin 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"), ]
import sys, os here = os.path.dirname(sys.argv[0]) sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin rom_headers = [ myelin_kicad_pcb.Component( footprint="myelin-kicad:dip32_rom" if machine == 'A3K' else "myelin-kicad:dip32_rom_bottom", identifier="%sROM%d" % (machine, rom_id + 1), value="ROM header", desc="Adapter to emulate a 600mil 32-pin DIP, e.g. Digikey ???", pins=[ Pin("16", "GND", "GND"), Pin("32", "VCC", "rom_5V"), ] + [ Pin(str(pin_id), str(pin_id), "rom%d_pin%d" % (rom_id + 1, pin_id)) for pin_id in range(1, 33) if pin_id not in (16, 32) ], ) for machine in ("A5K", "A3K") for rom_id in range(4) ] # Pin to connect up A21 from an A5000 to a v1 a3000_rom_emulator board a21_pin = myelin_kicad_pcb.Component( footprint="Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical", identifier="A21", value="",
cart = myelin_kicad_pcb.Component( footprint="myelin-kicad:acorn_electron_cartridge_edge_connector", identifier="CART1", value="edge connector", pins=[ # front of cartridge / bottom layer of PCB Pin("B1", "5V", ["elk_5V"]), Pin("B2", "A10"), Pin("B3", "D3", ["elk_D3"]), Pin("B4", "A11"), Pin("B5", "A9"), Pin("B6", "D7", ["elk_D7"]), Pin("B7", "D6", ["elk_D6"]), Pin("B8", "D5", ["elk_D5"]), Pin("B9", "D4", ["elk_D4"]), Pin("B10", "nOE2"), Pin("B11", "BA7", ["elk_A7"]), Pin("B12", "BA6", ["elk_A6"]), Pin("B13", "BA5", ["elk_A5"]), Pin("B14", "BA4", ["elk_A4"]), Pin("B15", "BA3"), Pin("B16", "BA2", ["elk_A2"]), Pin("B17", "BA1", ["elk_A1"]), Pin("B18", "BA0", ["elk_A0"]), Pin("B19", "D0", ["elk_D0"]), Pin("B20", "D2", ["elk_D2"]), Pin("B21", "D1", ["elk_D1"]), Pin("B22", "GND", ["GND"]), # rear of cartridge / top layer of PCB Pin("A1", "5V", ["elk_5V"]), Pin("A2", "nOE"), Pin("A3", "nRST", ["elk_nRST"]), Pin("A4", "RnW", ["elk_RnW"]), Pin("A5", "A8"), Pin("A6", "A13"), Pin("A7", "A12"), Pin("A8", "PHI0", ["elk_PHI0"]), Pin("A9", "-5V"), Pin("A10", "NC"), Pin("A11", "nRDY"), Pin("A12", "nNMI"), Pin("A13", "nIRQ"), Pin("A14", "nINFC", ["elk_nINFC"]), Pin("A15", "nINFD"), Pin("A16", "ROMQA"), Pin("A17", "16MHZ"), Pin("A18", "nROMSTB"), Pin("A19", "ADOUT"), Pin("A20", "ADGND"), Pin("A21", "ADIN"), Pin("A22", "GND", ["GND"]), ], )
cpld = myelin_kicad_pcb.Component( footprint="myelin-kicad:xilinx_csg144", identifier="CPLD", value="XC95144XL-10CSG144", partno="XC95144XL-10CSG144", desc="IC CPLD Xilinx 144MC", link="https://www.avnet.com/shop/us/search/xc95144xl-10csg", buses=["rom_A", "rom_D", "flash_A", "flash0_DQ", "flash1_DQ"], pins=[ # cpld has 28 signals out N, 29 out E, 32-4=28 S, 31 W = 116 -- approx correct :) # (done) rom_A0-19, rom_nROMCS, arc_D0-31, arc_nRESET (54) # 17 pins from directly above cpld, 13 from top right, 24 from right # (done) flash_* - A*22, ctl*3, D*32 (57) # (done) SPI to MCU x 4 (4) # (done) clock -- one from oscillator, one from MCU (separate from SCK) # == 117 # MCU can drive flash_nRESET and read flash_READY Pin("A1", "VCCIO", "3V3"), Pin("A2", "", "rom_A13"), Pin("A3", "", "rom_A7"), Pin("A4", "", "rom_A19"), Pin("A5", "", "rom_A11"), Pin("A6", "", "rom_A10"), Pin("A7", "", "rom_nOE"), Pin("A8", "", "rom_A5"), Pin("A9", "", "rom_A16"), Pin("A10", "", "rom_D6"), Pin("A11", "", "rom_A3"), Pin("A12", "", "rom_D5"), Pin("A13", "VCCIO", "3V3"), Pin("B1", "", "flash1_DQ3"), Pin("B2", "GND", "GND"), Pin("B3", "VCCINT", "3V3"), Pin("B4", "", "rom_A8"), Pin("B5", "", "rom_A9"), Pin("B6", "", "rom_A6"), Pin("B7", "", "rom_A18"), Pin("B8", "GND", "GND"), Pin("B9", "", "rom_A17"), Pin("B10", "", "rom_D7"), Pin("B11", "", "rom_A4"), Pin("B12", "GND", "GND"), Pin("B13", "", "rom_A0"), Pin("C1", "", "flash1_DQ1"), Pin("C2", "", "flash1_DQ5"), Pin("C3", "", "flash1_DQ11"), Pin("C4", "", "rom_A15"), Pin("C5", "", "rom_A14"), Pin("C6", "", "rom_nCS"), Pin("C7", "VCCIO", "3V3"), Pin("C8", "TDO", "cpld_TDO"), Pin("C9", "", "rom_D19"), Pin("C10", "GND", "GND"), Pin("C11", "", "rom_A2"), Pin("C12", "", "rom_A1"), Pin("C13", "", "rom_D1"), Pin("D1", "VCCINT", "3V3"), Pin("D2", "", "flash1_DQ9"), Pin("D3", "", "flash0_DQ3"), Pin("D4", "", "flash0_DQ11"), Pin("D5", "", "flash0_DQ5"), Pin("D6", "", "rom_A12"), Pin("D7", "", "rom_D4"), Pin("D8", "", "rom_D3"), Pin("D9", "", "rom_D10"), Pin("D10", "", "rom_D25"), Pin("D11", "", "rom_D0"), Pin("D12", "", "rom_D2"), Pin("D13", "", "rom_D15"), Pin("E1", "", "flash1_DQ2"), Pin("E2", "", "flash1_DQ8"), Pin("E3", "", "flash_nOE"), Pin("E4", "", "flash_A4"), Pin("E10", "", "rom_D18"), Pin("E11", "GND", "GND"), Pin("E12", "", "rom_D14"), Pin("E13", "", "rom_D13"), Pin("F1", "", "flash0_DQ1"), Pin("F2", "", "flash1_DQ0"), Pin("F3", "", "flash_A3"), Pin("F4", "", "flash_A6"), Pin("F10", "", "rom_D20"), Pin("F11", "", "rom_D17"), Pin("F12", "", "rom_D12"), Pin("F13", "", "rom_D11"), Pin("G1", "GND", "GND"), Pin("G2", "", "flash0_DQ9"), Pin("G3", "", "flash_A7"), Pin("G4", "", "flash_A0"), Pin("G10", "", "rom_D9"), Pin("G11", "", "rom_D26"), Pin("G12", "GND", "GND"), Pin("G13", "GND", "GND"), Pin("H1", "", "flash0_DQ2"), Pin("H2", "", "flash0_DQ8"), Pin("H3", "", "flash_A18"), Pin("H4", "", "flash_A21"), Pin("H10", "", "rom_D16"), Pin("H11", "", "rom_D28"), Pin("H12", "", "rom_D8"), Pin("H13", "", "rom_D24"), Pin("J1", "", "flash_nCE"), Pin("J2", "", "flash0_DQ0"), Pin("J3", "", "flash_A20"), Pin("J4", "", "flash_A19"), Pin("J10", "", "flash1_DQ10"), Pin("J11", "", "flash1_DQ4"), Pin("J12", "", "rom_D27"), Pin("J13", "VCCINT", "3V3"), Pin("K1", "GND", "GND"), Pin("K2", "GCK1", "rom_5V"), Pin("K3", "", "cpld_SS"), Pin("K4", "", "flash_A11"), Pin("K5", "", "flash_A9"), Pin("K6", "", "flash_A14"), Pin("K7", "", "flash0_DQ14"), Pin("K8", "", "flash1_DQ7"), Pin("K9", "", "flash1_DQ14"), Pin("K10", "", "flash1_DQ6"), Pin("K11", "", "rom_D30"), Pin("K12", "", "rom_D29"), Pin("K13", "", "rom_D21"), Pin("L1", "GCK2", "cpld_SCK"), Pin("L2", "", "cpld_MISO"), Pin("L3", "", "flash_A17"), Pin("L4", "VCCINT", "3V3"), Pin("L5", "", "flash_A13"), Pin("L6", "", "flash0_DQ7"), Pin("L7", "VCCIO", "3V3"), Pin("L8", "", "flash0_DQ15"), Pin("L9", "TDI", "cpld_TDI"), Pin("L10", "TCK", "cpld_TCK"), Pin("L11", "", "flash1_DQ12"), Pin("L12", "", "rom_D23"), Pin("L13", "", "rom_D22"), Pin("M1", "", "cpld_MOSI"), Pin("M2", "GND", "GND"), Pin("M3", "", "flash_A1"), Pin("M4", "", "flash_A2"), Pin("M5", "GND", "GND"), Pin("M6", "", "flash_A12"), Pin("M7", "", "flash_A16"), Pin("M8", "", "flash0_DQ12"), Pin("M9", "GND", "GND"), Pin("M10", "", "flash0_DQ10"), Pin("M11", "", "flash1_DQ15"), Pin("M12", "GND", "GND"), Pin("M13", "", "rom_D31"), Pin("N1", "VCCIO", "3V3"), Pin("N2", "GCK3", "cpld_clock_from_mcu"), Pin("N3", "", "flash_A5"), Pin("N4", "", "flash_nWE"), Pin("N5", "", "flash_A10"), Pin("N6", "", "flash_A8"), Pin("N7", "", "flash_A15"), Pin("N8", "", "flash0_DQ13"), Pin("N9", "", "flash0_DQ6"), Pin("N10", "TMS", "cpld_TMS"), Pin("N11", "", "flash0_DQ4"), Pin("N12", "", "flash1_DQ13"), Pin("N13", "VCCIO", "3V3"), ], )
connector = myelin_kicad_pcb.Component( footprint="Pin_Headers:Pin_Header_Straight_2x20_Pitch2.54mm", identifier="CON", value="2x20 connector for daughterboard", pins=[ Pin( "1", "", ["ext_GP0"]), Pin( "2", "", ["ext_GP1"]), Pin( "3", "", ["ext_GP2"]), Pin( "4", "", ["ext_GP3"]), Pin( "5", "", ["ext_GP4"]), Pin( "6", "", ["ext_GP5"]), Pin( "7", "", ["ext_GP6"]), Pin( "8", "", ["ext_GP7"]), Pin( "9", "", ["ext_GP8"]), Pin("10", "", ["ext_GP9"]), Pin("11", "", ["ext_GP10"]), Pin("12", "", ["ext_GP11"]), Pin("13", "", ["ext_GP12"]), Pin("14", "", ["GND"]), Pin("15", "", ["ext_3V3"]), Pin("16", "", ["ext_5V"]), Pin("17", "", ["ext_D0"]), Pin("18", "", ["ext_D1"]), Pin("19", "", ["ext_D2"]), Pin("20", "", ["ext_D3"]), Pin("21", "", ["ext_D4"]), Pin("22", "", ["ext_D5"]), Pin("23", "", ["ext_D6"]), Pin("24", "", ["ext_D7"]), Pin("25", "", ["ext_A0"]), Pin("26", "", ["ext_A1"]), Pin("27", "", ["ext_A2"]), Pin("28", "", ["ext_A3"]), Pin("29", "", ["ext_A4"]), Pin("30", "", ["ext_A5"]), Pin("31", "", ["ext_A6"]), Pin("32", "", ["ext_A7"]), Pin("33", "", ["ext_A8"]), Pin("34", "", ["ext_A9"]), Pin("35", "", ["ext_A10"]), Pin("36", "", ["ext_A11"]), Pin("37", "", ["ext_A12"]), Pin("38", "", ["ext_A13"]), Pin("39", "", ["ext_A14"]), Pin("40", "", ["ext_A15"]), ], )
myelin_kicad_pcb.Component( footprint="Housings_DIP:DIP-40_W15.24mm", identifier="CPU%d" % (cpuid + 1), value="6502", desc= ("adapter to emulate a 600mil 40-pin DIP, e.g. Digikey 1175-1527-5-ND" if cpuid == 0 else "600mil 40-pin DIP socket, e.g. Digikey 609-4716-ND"), pins=[ # Need to disconnect pin 1 on W65C02S; add a jumper between these two nets Pin(1, "VSS", ["cpu_GND_VPB_2" if cpuid else "GND"]), Pin(2, "RDY", ["cpu_RDY"]), Pin(3, "PHI1_OUT", ["cpu_PHI1_OUT"]), Pin(4, "nIRQ", ["cpu_nIRQ"]), # pulled up on the motherboard # Pin 5 is NC on R6502, /ML on W65C02S; only used in multiprocessor systems Pin(5, "NC_nML"), # Isolate this Pin(6, "nNMI", ["cpu_nNMI"]), # pulled up on the motherboard Pin(7, "SYNC", ["cpu_SYNC"]), Pin(8, "VCC", ["5V"]), Pin(9, "A0", ["cpu_A0"]), Pin(10, "A1", ["cpu_A1"]), Pin(11, "A2", ["cpu_A2"]), Pin(12, "A3", ["cpu_A3"]), Pin(13, "A4", ["cpu_A4"]), Pin(14, "A5", ["cpu_A5"]), Pin(15, "A6", ["cpu_A6"]), Pin(16, "A7", ["cpu_A7"]), Pin(17, "A8", ["cpu_A8"]), Pin(18, "A9", ["cpu_A9"]), Pin(19, "A10", ["cpu_A10"]), Pin(20, "A11", ["cpu_A11"]), Pin(21, "VSS", ["GND"]), Pin(22, "A12", ["cpu_A12"]), Pin(23, "A13", ["cpu_A13_%d" % (cpuid + 1)]), Pin(24, "A14", ["cpu_A14_%d" % (cpuid + 1)]), Pin(25, "A15", ["cpu_A15_%d" % (cpuid + 1)]), Pin(26, "D7", ["cpu_D7"]), Pin(27, "D6", ["cpu_D6"]), Pin(28, "D5", ["cpu_D5"]), Pin(29, "D4", ["cpu_D4"]), Pin(30, "D3", ["cpu_D3"]), Pin(31, "D2", ["cpu_D2"]), Pin(32, "D1", ["cpu_D1"]), Pin(33, "D0", ["cpu_D0"]), Pin(34, "RnW", ["cpu_RnW"]), Pin(35, "NC_XTLO", ["cpu_NC_XTLO"]), Pin(36, "NC_BE", ["cpu_NC_BE" ]), # NC on R6502, BE on W65C02S; WDC says to tie to VDD Pin(37, "PHI0_IN", ["cpu_PHI0_IN"]), # PHI2_IN on W65C02S Pin(38, "nSO", ["cpu_nSO"]), Pin(39, "PHI2_OUT", ["cpu_PHI2_OUT"]), Pin(40, "nRESET", ["cpu_nRESET"]), ], ) for cpuid in range(2)
# (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 # http://ww1.microchip.com/downloads/en/DeviceDoc/20005529B.pdf # DSC100X-C-X-X-096.000-X pins=[ Pin(1, "STANDBY#", "3V3"), Pin(2, "GND", "GND"), Pin(3, "OUT", "cpld_clock_osc"), Pin(4, "VDD", "3V3"), ], ) # Notes on BGA soldering (I'm using NSMD everywhere): # - https://forum.kicad.info/t/how-to-build-a-nsmd-footprint-in-kicad/4889/2 # - https://medium.com/supplyframe-hardware/confessions-of-a-pcb-designer-on-solder-mask-e592b45e5483 # (done) figure out what flash to use # CHOSEN: BGA-64 version of S29GL064S (cheapest and best). # previously picked S29GL064N90TFI040: $3.34, 64mbit, 48tsop,
PATH_TO_CPLD = "../cpld" import sys, os here = os.path.dirname(sys.argv[0]) sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin # Power # ----- ext_power = myelin_kicad_pcb.Component( footprint="Pin_Headers:Pin_Header_Straight_1x03_Pitch2.54mm", identifier="EXTPWR", value="ext pwr", pins=[ Pin(1, "", ["GND"]), Pin(2, "", ["3V3"]), Pin(3, "", ["5V"]), ], ) power_cap = myelin_kicad_pcb.C0805("10u", "5V", "GND", ref="C9") # Econet socket # ------------- econet_socket = myelin_kicad_pcb.Component( footprint="myelin-kicad:din_5_econet_pcb_mount", identifier="U?", value="Econet", pins=[ # DIN-5 pins are numbered weirdly -- 1, 4, 2, 5, 3 around the circle
], ) 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")
import sys, os here = os.path.dirname(sys.argv[0]) sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin arc_keyboard_din = myelin_kicad_pcb.Component( footprint="myelin-kicad:minidin_9_pcb_mount", identifier="MOUSE", value="CUI-MD90S", pins=[ # Labels are <Acorn label>_<SmallyMouse2 label> Pin(1, "Xr_X2", "X2"), Pin(2, "SW1_LB", "LB"), Pin(3, "SW2_MB", "MB"), Pin(4, "GND_NC", "GND"), Pin(5, "Xd_X1", "X1"), Pin(6, "5V", "5V"), Pin(7, "Yr_Y2", "Y2"), Pin(8, "SW3_RB", "RB"), Pin(9, "Yd_Y1", "Y1"), # https://www.waitingforfriday.com/?p=827 says pin 4 is NC and shield # is GND, so ground the shield too. Pin("S1", "GND", "GND"), ], ) # Header that should plug straight into a SmallyMouse2 board header = myelin_kicad_pcb.Component( footprint="Connector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_Vertical", identifier="HDR", value="Mouse",
fpga = myelin_kicad_pcb.Component( footprint="myelin-kicad:lattice_ubga169_smallpads", identifier="FPGA", value="10M08SCU169", pins=[ # IOs # Outer ring -- 45 IOs (4 x 13 - 1 for TMS on G1) Pin("A2", "", "C1_11"), Pin("A3", "", "C1_9"), Pin("A4", "", "C1_14"), Pin("A5", "", "C1_19"), # failed on first board? nc Pin("A6", "", "C1_17"), Pin("A7", "", "C1_23"), Pin("A8", "", "C1_16"), Pin("A9", "", "C1_20"), Pin("A10", "", "C1_26"), Pin("A11", "", "C1_25"), Pin("A12", "", "C1_30"), # Pin("N2", "", "IO11"), # Pin("N3", "", "IO12"), Pin("N4", "", "C4_17"), # failed on first board? nc Pin("N5", "", "C4_19"), Pin("N6", "", "C4_24"), Pin("N7", "", "C4_25"), Pin("N8", "", "C4_22"), Pin("N9", "", "C4_28"), # failed on first board? low drive / poor connection? Pin("N10", "", "C4_26"), Pin("N11", "", "C4_31"), Pin("N12", "", "C4_36"), Pin("B1", "", "C1_2"), # failed on first board? nc Pin("C1", "", "C1_1"), Pin("D1", "", "C2_1"), Pin("E1", "", "C2_5"), Pin("F1", "", "C2_8"), Pin("H1", "", "C1_3"), Pin("J1", "", "C4_4"), Pin("K1", "", "C2_12"), Pin("M1", "", "C4_12"), Pin("B13", "", "C1_36"), Pin("C13", "", "C1_33"), Pin("D13", "", "C1_37"), Pin("G13", "", "C3_4"), Pin("H13", "", "C4_34"), Pin("J13", "", "C3_10"), Pin("K13", "", "C4_35"), Pin("L13", "", "C4_37"), Pin("M13", "", "C4_39"), # failed on first board? nc # Next ring in - Pin("B2", "", "C1_6"), Pin("B3", "", "C1_5"), Pin("B4", "", "C1_10"), Pin("B5", "", "C1_13"), Pin("B6", "", "C1_18"), Pin("B7", "", "C1_12"), Pin("B10", "", "C1_24"), Pin("B11", "", "C1_31"), Pin("M2", "", "C4_11"), Pin("M3", "", "C4_13"), Pin("M4", "", "C4_14"), Pin("M5", "", "C4_20"), Pin("M7", "", "C4_21"), Pin("M8", "", "C4_23"), # failed on first board? nc Pin("M9", "", "C4_33"), Pin("M10", "", "C4_27"), Pin("M11", "", "C4_30"), Pin("M12", "", "C4_38"), Pin("C2", "", "C2_4"), Pin("H2", "", "C1_7"), Pin("J2", "", "C4_7"), Pin("K2", "", "C4_8"), Pin("L2", "", "C4_6"), Pin("L3", "", "C4_10"), Pin("C9", "", "C1_22"), Pin("C10", "", "C1_27"), Pin("B12", "", "C1_29"), Pin("C12", "", "C1_34"), Pin("D11", "", "C1_38"), Pin("D12", "", "C3_3"), Pin("E12", "", "C3_1"), Pin("F12", "", "C3_6"), Pin("G12", "", "C3_8"), Pin("J12", "", "C3_7"), Pin("K11", "", "C3_12"), Pin("K12", "", "C3_9"), Pin("L11", "", "C3_11"), Pin("L12", "", "C4_40"), Pin("L10", "", "C4_32"), Pin("C11", "", "C1_28"), Pin("E3", "", "C2_3"), Pin("L5", "", "C4_18"), # Special pins Pin("G5", "CLK0n", "CLK0n"), Pin("H6", "CLK0p", "CLK0p"), Pin("H5", "CLK1n", "CLK1n"), Pin("H4", "CLK1p", "CLK1p"), # Pin("G10", "CLK2n", "CLK2n"), # Pin("G9", "CLK2p", "CLK2p"), Pin("E13", "CLK3n", "C3_2_CLK3n"), Pin("F13", "CLK3p", "C3_5_CLK3p"), Pin("N2", "DPCLK0", "C4_16_DPCLK0"), Pin("N3", "DPCLK1", "C4_15_DPCLK1"), Pin("F10", "DPCLK2", "DPCLK2"), Pin("F9", "DPCLK3", "DPCLK3"), Pin("L1", "VREFB2N0", "C4_3_VREFB2N0"), # JTAG and other config pins Pin("E5", "JTAGEN", "fpga_JTAGEN"), Pin("G1", "TMS", "fpga_TMS"), Pin("G2", "TCK", "fpga_TCK"), Pin("F5", "TDI", "fpga_TDI"), Pin("F6", "TDO", "fpga_TDO"), Pin("B9", "DEV_CLRn", "fpga_DEV_CLRn"), # measures high on first soldered board Pin("D8", "DEV_OE", "fpga_DEV_OE"), Pin("D7", "CONFIG_SEL", "GND"), # unused, so connected to GND Pin("E7", "nCONFIG", "3V3"), # can be connected straight to VCCIO Pin("D6", "CRC_ERROR", "GND"), # WARNING: disable Error Detection CRC option Pin("C4", "nSTATUS", "fpga_nSTATUS"), # measures high on first soldered board Pin("C5", "CONF_DONE", "fpga_CONF_DONE"), # measures high on first soldered board # Signals used as power/ground to enable vias Pin("E4", "", "GND"), Pin("J5", "", "GND"), Pin("J6", "", "GND"), Pin("K10", "", "GND"), Pin("E10", "", "GND"), Pin("J10", "", "GND"), Pin("E8", "", "3V3"), Pin("H8", "", "3V3"), Pin("D9", "", "3V3"), Pin("K7", "", "3V3"), Pin("K8", "", "3V3"), Pin("E6", "", "3V3"), Pin("F8", "", "3V3"), Pin("G4", "", "3V3"), Pin("L4", "", "3V3"), Pin("G9", "", "3V3"), Pin("G10", "", "3V3"), # Power and ground Pin("D2", "GND", "GND"), Pin("E2", "GND", "GND"), Pin("N13", "GND", "GND"), Pin("N1", "GND", "GND"), Pin("M6", "GND", "GND"), Pin("L9", "GND", "GND"), Pin("J4", "GND", "GND"), Pin("H12", "GND", "GND"), Pin("G7", "GND", "GND"), Pin("F3", "GND", "GND"), Pin("E11", "GND", "GND"), Pin("D5", "GND", "GND"), Pin("C3", "GND", "GND"), Pin("B8", "GND", "GND"), Pin("A13", "GND", "GND"), Pin("A1", "GND", "GND"), Pin("F2", "VCCIO1A", "3V3"), Pin("G3", "VCCIO1B", "3V3"), Pin("K3", "VCCIO2", "3V3"), Pin("J3", "VCCIO2", "3V3"), Pin("L8", "VCCIO3", "3V3"), Pin("L7", "VCCIO3", "3V3"), Pin("L6", "VCCIO3", "3V3"), Pin("J11", "VCCIO5", "3V3"), Pin("H11", "VCCIO5", "3V3"), Pin("G11", "VCCIO6", "3V3"), Pin("F11", "VCCIO6", "3V3"), Pin("C8", "VCCIO8", "3V3"), Pin("C7", "VCCIO8", "3V3"), Pin("C6", "VCCIO8", "3V3"), 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"), ], )
# the Sparkfun Pro Micro, so I can plug it in to my existing designs without # having to reroute anything. import sys, os here = os.path.dirname(sys.argv[0]) sys.path.insert(0, os.path.join(here, "../../third_party/myelin-kicad.pretty")) import myelin_kicad_pcb Pin = myelin_kicad_pcb.Pin # Micro USB socket micro_usb = myelin_kicad_pcb.Component( footprint="myelin-kicad:micro_usb_b_smd_molex", identifier="USB", value="usb", pins=[ Pin(1, "V", ["5V"]), Pin(2, "-", ["USBDM"]), Pin(3, "+", ["USBDP"]), Pin(4, "ID", ["USB_ID"]), Pin(5, "G", ["GND"]), ], ) # 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
rom = myelin_kicad_pcb.Component( footprint="Housings_DIP:DIP-28_W15.24mm", identifier="ROM", value="BBC ROM", pins=[ Pin(1, "VPP"), Pin(2, "", "A12"), Pin(3, "", "A7"), Pin(4, "", "A6"), Pin(5, "", "A5"), Pin(6, "", "A4"), Pin(7, "", "A3"), Pin(8, "", "A2"), Pin(9, "", "A1"), Pin(10, "", "A0"), Pin(11, "", "D0"), Pin(12, "", "D1"), Pin(13, "", "D2"), Pin(14, "GND", "GND"), Pin(15, "", "D3"), Pin(16, "", "D4"), Pin(17, "", "D5"), Pin(18, "", "D6"), Pin(19, "", "D7"), Pin(20, "", "nCS"), Pin(21, "", "A10"), Pin(22, "", "nOE"), Pin(23, "", "A11"), Pin(24, "", "A9"), Pin(25, "", "A8"), Pin(26, "", "A13"), Pin(27, "A14"), Pin(28, "VCC", "5V"), ], )
myelin_kicad_pcb.Component( footprint="myelin-kicad:lattice_ftg256_fbga", identifier="FPGA", value="LCMXO2-2000HC-4FTG256C", buses=[""], pins=[ # generated by make_machxo2_power_gnd_ball_map.py Pin("B2", "GND", "GND"), Pin("B15", "GND", "GND"), Pin("C3", "GND", "GND"), Pin("C14", "GND", "GND"), Pin("D4", "GND", "GND"), Pin("D13", "GND", "GND"), Pin("E5", "GND", "GND"), Pin("E12", "GND", "GND"), Pin("F6", "GND", "GND"), Pin("F11", "GND", "GND"), Pin("H8", "GND", "GND"), Pin("H9", "GND", "GND"), Pin("J8", "GND", "GND"), Pin("J9", "GND", "GND"), Pin("L6", "GND", "GND"), Pin("L11", "GND", "GND"), Pin("M5", "GND", "GND"), Pin("M12", "GND", "GND"), Pin("N4", "GND", "GND"), Pin("N13", "GND", "GND"), Pin("P3", "GND", "GND"), Pin("P14", "GND", "GND"), Pin("R2", "GND", "GND"), Pin("R15", "GND", "GND"), Pin("A1", "VCC", "3V3"), Pin("A16", "VCC", "3V3"), Pin("G7", "VCC", "3V3"), Pin("G10", "VCC", "3V3"), Pin("K7", "VCC", "3V3"), Pin("K10", "VCC", "3V3"), Pin("T1", "VCC", "3V3"), Pin("T16", "VCC", "3V3"), Pin("D5", "VCCIO0", "3V3"), Pin("D12", "VCCIO0", "3V3"), Pin("G8", "VCCIO0", "3V3"), Pin("G9", "VCCIO0", "3V3"), Pin("E13", "VCCIO1", "3V3"), Pin("H10", "VCCIO1", "3V3"), Pin("J10", "VCCIO1", "3V3"), Pin("M13", "VCCIO1", "3V3"), Pin("K8", "VCCIO2", "3V3"), Pin("K9", "VCCIO2", "3V3"), Pin("N5", "VCCIO2", "3V3"), Pin("N12", "VCCIO2", "3V3"), Pin("M4", "VCCIO3", "3V3"), Pin("H7", "VCCIO4", "3V3"), Pin("J7", "VCCIO4", "3V3"), Pin("E4", "VCCIO5", "3V3"), Pin("A2", "NC", "NC"), ] + [ # Reserved during startup -- better leave NC or bring out to FX3 Pin("A13", "INITN", "fpga_INITN"), Pin("B10", "PROGRAMN", "fpga_PROGRAMN"), Pin("C13", "DONE", "fpga_DONE"), # JTAG Pin("A6", "TDI", "fpga_TDI"), Pin("A7", "TCK", "fpga_TCK"), Pin("B8", "TMS", "fpga_TMS"), Pin("C6", "TDO", "fpga_TDO"), ] + [ # User IO ], )
bus = myelin_kicad_pcb.Component( footprint="myelin-kicad:bbc_1mhz_bus_board", identifier="BUS1", value="2x17 connector for 1mhz bus", pins=[ # Pin 1 is on the far left, at the bottom, looking into # the connector pins with the bbc micro flipped upside down. # Given how the body of the BBC slopes upwards, I'm pretty # sure it'll be easier to mount the connector on the underside # of the board. This should give us some clearance for tall # components (Pro Micro or SD socket) there too. # Kjell Sundby's PiTubeDirect under-BBC signal converter # manages to work with the connector on the top of the board # (even with the BBC mounting screw in the way!), so that's # an option if mounting it on the bottom isn't. # If mounted on the bottom, I imagine the pin layout will # look like this from the top: # --- board edge --- # [ 2 4 6 8 ... 34 ] # [ 1 3 5 7 ... 33 ] # In total here we have 23 signals: 8 data + 8 address + 7 control # We need four pins for the SD card's SPI signals # Plus six pins for the BBC comms # = 32, leaving one free. # Send this through to the AVR just in case, and bring *everything* # out as GPIO so we can just not fit the AVR and micro SD card if we # want a pure GPIO board. Pin("1", "GND", ["GND"]), Pin("2", "RnW", ["bbc_RnW"]), Pin("3", "GND", ["GND"]), Pin("4", "1MHZE", ["bbc_1MHZE"]), Pin("5", "GND", ["GND"]), Pin("6", "nNMI", ["bbc_nNMI"]), Pin("7", "GND", ["GND"]), Pin("8", "nIRQ", ["bbc_nIRQ"]), Pin("9", "GND", ["GND"]), Pin("10", "nPGFC", ["bbc_nPGFC"]), Pin("11", "GND", ["GND"]), Pin("12", "nPGFD", ["bbc_nPGFD"]), Pin("13", "GND", ["GND"]), Pin("14", "nRESET", ["bbc_nRESET"]), Pin("15", "GND", ["GND"]), Pin("16", "AUDIO_IN_OUT"), Pin("17", "GND", ["GND"]), Pin("18", "D0", ["bbc_D0"]), Pin("19", "D1", ["bbc_D1"]), Pin("20", "D2", ["bbc_D2"]), Pin("21", "D3", ["bbc_D3"]), Pin("22", "D4", ["bbc_D4"]), Pin("23", "D5", ["bbc_D5"]), Pin("24", "D6", ["bbc_D6"]), Pin("25", "D7", ["bbc_D7"]), Pin("26", "GND", ["GND"]), Pin("27", "A0", ["bbc_A0"]), Pin("28", "A1", ["bbc_A1"]), Pin("29", "A2", ["bbc_A2"]), Pin("30", "A3", ["bbc_A3"]), Pin("31", "A4", ["bbc_A4"]), Pin("32", "A5", ["bbc_A5"]), Pin("33", "A6", ["bbc_A6"]), Pin("34", "A7", ["bbc_A7"]), ], )
myelin_kicad_pcb.Component( footprint=("myelin-kicad:dip32_rom" if rom_id == 0 else "myelin-kicad:dip32_rom_data_only"), identifier="A3KROM%d" % (rom_id + 1), value="ROM header", desc="Adapter to emulate a 600mil 32-pin DIP, e.g. Digikey ???", pins=[ Pin("13", "D0", "D%d" % (rom_id * 8 + 0)), Pin("14", "D1", "D%d" % (rom_id * 8 + 1)), Pin("15", "D2", "D%d" % (rom_id * 8 + 2)), Pin("16", "GND", "GND"), Pin("17", "D3", "D%d" % (rom_id * 8 + 3)), Pin("18", "D4", "D%d" % (rom_id * 8 + 4)), Pin("19", "D5", "D%d" % (rom_id * 8 + 5)), Pin("20", "D6", "D%d" % (rom_id * 8 + 6)), Pin("21", "D7", "D%d" % (rom_id * 8 + 7)), ] + ([ Pin("1", "A19", "A19"), Pin("2", "A16", "A16"), Pin("3", "A15", "A15"), Pin("4", "A12", "A12"), Pin("5", "A7", "A7"), Pin("6", "A6", "A6"), Pin("7", "A5", "A5"), Pin("8", "A4", "A4"), Pin("9", "A3", "A3"), Pin("10", "A2", "A2"), Pin("11", "A1", "A1"), Pin("12", "A0", "A0"), Pin("22", "nROMCS", "nCS"), Pin("23", "A10", "A10"), Pin("24", "nOE", "nOE"), # grounded on A3000 depending on jumpers Pin("25", "A11", "A11"), Pin("26", "A9", "A9"), Pin("27", "A8", "A8"), Pin("28", "A13", "A13"), Pin("29", "A14", "A14"), Pin("30", "A17", "A17"), Pin("31", "A18", "A18"), Pin("32", "VCC", "5V"), ] if rom_id == 0 else []), ) for rom_id in range(4)
cart_front = myelin_kicad_pcb.Component( footprint="myelin-kicad:acorn_electron_cartridge_edge_connector", identifier="CART", value="edge connector", pins=[ # front of cartridge / bottom layer of PCB Pin("B1", "5V", "5V"), Pin("B2", "A10"), Pin("B3", "D3", "cpu_D3"), Pin("B4", "A11"), Pin("B5", "A9"), Pin("B6", "D7", "cpu_D7"), Pin("B7", "D6", "cpu_D6"), Pin("B8", "D5", "cpu_D5"), Pin("B9", "D4", "cpu_D4"), Pin("B10", "nOE2"), Pin("B11", "BA7", "cpu_A7"), Pin("B12", "BA6", "cpu_A6"), Pin("B13", "BA5", "cpu_A5"), Pin("B14", "BA4", "cpu_A4"), Pin("B15", "BA3", "cpu_A3"), Pin("B16", "BA2", "cpu_A2"), Pin("B17", "BA1", "cpu_A1"), Pin("B18", "BA0", "cpu_A0"), Pin("B19", "D0", "cpu_D0"), Pin("B20", "D2", "cpu_D2"), Pin("B21", "D1", "cpu_D1"), Pin("B22", "GND", "GND"), # rear of cartridge / top layer of PCB Pin("A1", "5V", "5V"), Pin("A2", "nOE"), Pin("A3", "nRST", "cpu_nRST"), # A4 is RnW on the Elk, and on the master for &FCxx, so it's safe to use # this for the Tube, but not for the logic analyzer. Pin("A4", "RnW", "cpu_RnW"), Pin("A5", "A8"), Pin("A6", "A13"), Pin("A7", "A12"), Pin("A8", "PHI0", "cpu_CLK"), Pin("A9", "-5V"), Pin("A10", "NC"), Pin("A11", "READY", "elk_READY_master_RnW"), Pin("A12", "nNMI", "cpu_nNMI"), Pin("A13", "nIRQ", "cpu_nIRQ"), Pin("A14", "nINFC", "elk_nINFC"), Pin("A15", "nINFD"), Pin("A16", "ROMQA"), Pin("A17", "16MHZ", "elk_16MHz"), Pin("A18", "nROMSTB"), Pin("A19", "ADOUT"), Pin("A20", "ADGND"), Pin("A21", "ADIN"), Pin("A22", "GND", "GND"), ], )
cart_front = myelin_kicad_pcb.Component( footprint="myelin-kicad:acorn_electron_cartridge_edge_connector", identifier="CART", value="edge connector", pins=[ # front of cartridge / bottom layer of PCB Pin("B1", "5V", ["5V"]), Pin("B2", "A10", ["elk_A10"]), Pin("B3", "D3", ["elk_D3"]), Pin("B4", "A11", ["elk_A11"]), Pin("B5", "A9", ["elk_A9"]), Pin("B6", "D7", ["elk_D7"]), Pin("B7", "D6", ["elk_D6"]), Pin("B8", "D5", ["elk_D5"]), Pin("B9", "D4", ["elk_D4"]), Pin("B10", "nOE2"), Pin("B11", "BA7", ["elk_A7"]), Pin("B12", "BA6", ["elk_A6"]), Pin("B13", "BA5", ["elk_A5"]), Pin("B14", "BA4", ["elk_A4"]), Pin("B15", "BA3", ["elk_A3"]), Pin("B16", "BA2", ["elk_A2"]), Pin("B17", "BA1", ["elk_A1"]), Pin("B18", "BA0", ["elk_A0"]), Pin("B19", "D0", ["elk_D0"]), Pin("B20", "D2", ["elk_D2"]), Pin("B21", "D1", ["elk_D1"]), Pin("B22", "GND", ["GND"]), # rear of cartridge / top layer of PCB Pin("A1", "5V", ["5V"]), Pin("A2", "nOE", ["elk_nOE"]), Pin("A3", "nRST"), Pin("A4", "RnW", ["elk_RnW"]), Pin("A5", "A8", ["elk_A8"]), Pin("A6", "A13", ["elk_A13"]), Pin("A7", "A12", ["elk_A12"]), Pin("A8", "PHI0", ["elk_PHI0"]), Pin("A9", "-5V"), Pin("A10", "NC"), Pin("A11", "nRDY"), Pin("A12", "nNMI"), Pin("A13", "nIRQ"), Pin("A14", "nINFC"), Pin("A15", "nINFD"), Pin("A16", "ROMQA", ["elk_ROMQA"]), Pin("A17", "16MHZ"), Pin("A18", "nROMSTB"), Pin("A19", "ADOUT"), Pin("A20", "ADGND"), Pin("A21", "ADIN"), Pin("A22", "GND", ["GND"]), ], )