hardware: SB-LoRa rev 2 fab files for PCBWay as well as JLCPCB: make_fab.py also writes a PCBWay BOM (manufacturer part numbers from netlist.MFR, read from LCSC's listings, with the hand-fit parts as do-not-place) and PCBWay-named copies of the gerbers zip and CPL; REV2.md gets a PCBWay ordering section (single assembled board, customer-supplied U1/U2 if they can't be sourced) and no edge rail on the J1 edge for either

This commit is contained in:
rich committed 2026-11-26 13:58:53 -05:00
1 parent 814aae9f61
commit 281ed340c6
3 files changed
+65 -10

No files matched your search

+20 -2
View File
@@ -101,7 +101,7 @@ Order from a tagged commit, so the fab files can be made again.
python3 make_fab.py fab
```
`fab/` gets the gerbers zip, the BOM and CPL, the hand-fit list and `check_top_copper_1to1.pdf`. It isn't in git.
`fab/` gets a gerbers zip, BOM and CPL for each of JLCPCB (`*_jlcpcb.*`) and PCBWay (`*_pcbway.*`), the hand-fit list and `check_top_copper_1to1.pdf`. It isn't in git. The two zips and the two CPLs are the same files under each assembler's name; the BOMs differ.
**2. Check the radio footprints.** Print `check_top_copper_1to1.pdf` at 100 % (actual size, not "fit to page"). Check the board outline measures 46.8 mm across, then lay the XIAO and the Wio on their footprints: every pad should sit under its castellation or pin.
@@ -126,12 +126,30 @@ If JLC's review asks about copper at the board edge, or about the two small tabs
- Upload `visormesh_bom_jlcpcb.csv` and `visormesh_cpl_jlcpcb.csv`. All 25 parts are on the top. Check that every line found its LCSC part and has stock, especially U1 (S29AL008J70TFI010, C2759923) and U2 (TL16C2550RHBR, C2653222), which are low-stock extended parts. Expect extended-part fees for the flash, the UART, the crystal and some of the logic.
- **Check the placement preview before paying.** The CPL has no rotation corrections yet, so look at each IC's pin 1 against the silkscreen triangle: U1 (pin 1 top left, beside the triangle), U2 (QFN, pin 1 dot), U3-U6 (SC-70 and VSSOP, which KiCad and JLC often disagree on), Y1 and D1 (cathode bar). Fix any that are off in the preview, and note the corrections here for next time.
- If JLC wants tooling holes or edge rails, take rails; holes in the board itself would land on parts.
- If JLC wants tooling holes or edge rails, take rails, but none on the J1 edge: breaking a rail off there would tear J1's edge pads and the tabs. Holes in the board itself would land on parts.
**5. After ordering.** Tag the commit (`git tag hw-v0.2`) and add the order to `docs/progress.md`.
**Fitted by hand** (`hand_fit_parts.csv`): J1 (pushed on with the board's tabs in its ear holes, then both rows soldered), the XIAO (flat on its castellated pads), the Wio (pins through, cut flush), the LiPo, and the test points. JP2 is bridged and JP1 open from the factory.
## Ordering (PCBWay)
PCBWay will assemble a single board, where JLC wants 2 or more. They buy the parts from distributors (Digi-Key, Mouser and the like) rather than LCSC, so the BOM carries manufacturer part numbers. The gerbers and CPL are the same as JLC's.
**1. Make the files** as in JLC's step 1, then check the radio footprints as in step 2.
**2. The board.** Upload `visormesh_gerbers_pcbway.zip` and set the same options as JLC's step 3: 4 layers, **0.8 mm** (not the default), ENIG, 1 oz outer copper, tented vias. Quantity 5 (you pay for the bare boards; only the assembled count can be 1). In the remarks, say that J1's pads run to the board edge and the two small tabs on the connector edge are intentional, and not to pull the pads back or trim the tabs.
**3. Assembly.** Choose turnkey assembly, top side only, quantity 1, and upload `visormesh_bom_pcbway.csv` and `visormesh_cpl_pcbway.csv`.
- The BOM lists the 25 placed parts by manufacturer part number, with LCSC's number as a cross-reference, and J1, the XIAO, the Wio and the LiPo as do-not-place. The passives' descriptions give the full spec, so PCBWay may substitute an equivalent; accept that for the resistors and capacitors, but not for U1, U2 or Y1.
- **U1 and U2 are the risk.** U2 (TL16C2550RHBR) is last-time-buy at TI and U1 is low-stock. If the quote can't source them, buy them from LCSC (C2759923, C2653222) and send them to PCBWay as customer-supplied parts; their order form has an option for it.
- PCBWay's engineers check every part's orientation against the silkscreen and send a confirmation before building. Look at it for the same parts as JLC's preview: U1 and U2 pin 1, U3-U6, Y1, and D1 (cathode bar toward the J1 edge).
- No edge rail on the J1 edge, as for JLC.
- Expect a setup and stencil fee, and a longer lead time than JLC because the parts are bought for the order.
**4. After ordering:** tag the commit and add the order to `docs/progress.md`, as for JLC.
## Carried over from rev 1
- VDOCK charging option (D1, JP1).
+27 -8
View File
@@ -1,10 +1,11 @@
#!/usr/bin/env python3
"""Build rev 2's JLCPCB package: gerbers+drill zip (4 layers), BOM and CPL in JLC format, and a 1:1
"""Build rev 2's fab packages: gerbers+drill zip (4 layers), and a BOM and CPL each for JLCPCB (LCSC numbers)
and PCBWay (manufacturer part numbers, hand-fit parts listed as do-not-place). Also the hand-fit list and a 1:1
top copper print for checking the XIAO and Wio footprints against the real boards.
Usage: make_fab.py <out dir> [kicad-cli]"""
import csv, os, subprocess, sys, zipfile, shutil
sys.path.insert(0, os.path.dirname(__file__))
from netlist import PARTS
from netlist import PARTS, MFR
HERE = os.path.dirname(os.path.abspath(__file__))
OUT = sys.argv[1]
@@ -23,6 +24,7 @@ zp = os.path.join(OUT, "visormesh_gerbers_jlcpcb.zip")
with zipfile.ZipFile(zp, "w", zipfile.ZIP_DEFLATED) as z:
for f in sorted(os.listdir(G)):
z.write(os.path.join(G, f), f)
shutil.copyfile(zp, os.path.join(OUT, "visormesh_gerbers_pcbway.zip"))
# Placement
pos = os.path.join(OUT, "pos_raw.csv")
@@ -30,12 +32,15 @@ subprocess.run([CLI, "pcb", "export", "pos", "--format", "csv", "--units", "mm",
"--smd-only", "-o", pos, PCB], check=True, capture_output=True)
rows = list(csv.DictReader(open(pos)))
assembled = {r for r, p in PARTS.items() if p[3] and not p[5]} # has LCSC and not DNP
with open(os.path.join(OUT, "visormesh_cpl_jlcpcb.csv"), "w", newline="") as f:
w = csv.writer(f); w.writerow(["Designator", "Mid X", "Mid Y", "Layer", "Rotation"])
for r in rows:
if r["Ref"] in assembled:
w.writerow([r["Ref"], r["PosX"] + "mm", r["PosY"] + "mm",
"Top" if r["Side"] == "top" else "Bottom", r["Rot"]])
missing = assembled - {r["Ref"] for r in rows}
assert not missing, "not in the placement export: %s" % sorted(missing)
for name in ("visormesh_cpl_jlcpcb.csv", "visormesh_cpl_pcbway.csv"): # PCBWay reads JLC's layout as is
with open(os.path.join(OUT, name), "w", newline="") as f:
w = csv.writer(f); w.writerow(["Designator", "Mid X", "Mid Y", "Layer", "Rotation"])
for r in rows:
if r["Ref"] in assembled:
w.writerow([r["Ref"], r["PosX"] + "mm", r["PosY"] + "mm",
"Top" if r["Side"] == "top" else "Bottom", r["Rot"]])
os.remove(pos)
# BOM grouped by value+footprint+LCSC
@@ -50,6 +55,20 @@ with open(os.path.join(OUT, "visormesh_bom_jlcpcb.csv"), "w", newline="") as f:
w = csv.writer(f); w.writerow(["Comment", "Designator", "Footprint", "LCSC Part #"])
for (val, name, lcsc), refs in sorted(groups.items(), key=lambda kv: refkey(sorted(kv[1], key=refkey)[0])):
w.writerow([val, ",".join(sorted(refs, key=refkey)), name, lcsc])
# PCBWay BOM: they buy from distributors, so manufacturer part numbers; LCSC kept as a cross-reference
nomfr = {lcsc for (_, _, lcsc) in groups} - set(MFR)
assert not nomfr, "no manufacturer part number in netlist.MFR for: %s" % sorted(nomfr)
with open(os.path.join(OUT, "visormesh_bom_pcbway.csv"), "w", newline="") as f:
w = csv.writer(f)
w.writerow(["Item", "Designator", "Qty", "Manufacturer", "Mfg Part #", "Description", "Package", "Type", "LCSC Part #", "Notes"])
n = 0
for (val, name, lcsc), refs in sorted(groups.items(), key=lambda kv: refkey(sorted(kv[1], key=refkey)[0])):
mfr, mpn, spec = MFR[lcsc]; n += 1
w.writerow([n, ",".join(sorted(refs, key=refkey)), len(refs), mfr, mpn, spec, name, "SMD", lcsc, ""])
for ref, (val, lib, name, lcsc, desc, dnp) in PARTS.items():
if ref not in assembled and not ref.startswith(("JP", "TP")): # jumpers and test points are bare copper
n += 1
w.writerow([n, ref, 1, "", val, desc, name, "DNP", "", "Do not place: fitted by the customer"])
# Hand-fit parts
with open(os.path.join(OUT, "hand_fit_parts.csv"), "w", newline="") as f:
w = csv.writer(f); w.writerow(["Ref", "Part", "Notes"])
+18
View File
@@ -68,6 +68,24 @@ PARTS = {
"TP4": ("GND", "TestPoint", "TestPoint_Pad_D1.0mm", "", "Probe ground", True),
}
# lcsc: (manufacturer, part number, full spec), for assemblers that buy from distributors (PCBWay).
# Read from LCSC's listing of each number, 2026-11-26. The passives' specs are what a substitute must meet.
MFR = {
"C2759923": ("Infineon (Cypress)", "S29AL008J70TFI010", "8 Mbit NOR flash, x16, 70 ns, top boot, 3.0 V, TSOP-48"),
"C2653222": ("Texas Instruments", "TL16C2550RHBR", "Dual UART, 16-byte FIFOs, VQFN-32 5x5 mm"),
"C91874": ("Texas Instruments", "SN74LVC2G32DCUR", "Dual 2-input OR, VSSOP-8"),
"C105251": ("Texas Instruments", "SN74LVC2G04DCKR", "Dual inverter, SC-70-6"),
"C15741": ("Texas Instruments", "SN74LVC2T45DCUR", "2-bit level translator, VSSOP-8"),
"C9382": ("Texas Instruments", "SN74LVC1T45DCKR", "1-bit level translator, SC-70-6"),
"C2901666": ("SCTF", "SX3B14.7456F2010F30", "Crystal 14.7456 MHz, 20 pF load, +-10 ppm, 3225 4-pad"),
"C15849": ("Samsung Electro-Mechanics", "CL10A105KB8NNNC", "1 uF 50 V X5R +-10 % 0603"),
"C14663": ("Yageo", "CC0603KRX7R9BB104", "100 nF 50 V X7R +-10 % 0603"),
"C24658": ("FH (Fenghua)", "0805CG220J500NT", "22 pF 50 V C0G +-5 % 0805"),
"C25803": ("Uni-Royal", "0603WAF1003T5E", "100 k +-1 % 0.1 W 0603"),
"C25804": ("Uni-Royal", "0603WAF1002T5E", "10 k +-1 % 0.1 W 0603"),
"C8598": ("JSCJ (Changjiang)", "B5819W", "Schottky 40 V 1 A, SOD-123"),
}
SB_NAMES = { # Table 5-1 of the Springboard Development Guide
1: "GND", 2: "D3", 3: "D4", 4: "D5", 5: "D6", 6: "D7", 7: "CS0*", 8: "A10", 9: "OE*", 10: "A11", 11: "A9",
12: "A8", 13: "A13", 14: "A14", 15: "WE*", 16: "IRQ*", 17: "VCC", 18: "VDOCK", 19: "A16", 20: "A15",