hardware: SB-LoRa rev 2 layout: 4 layers (In1 GND plane), flash, UART and logic in the slot, XIAO and Wio side by side, LiPo pads underneath; routed with Freerouting 1.9.0, DRC 0 unconnected, verify.py passes. J1 is a parametric placeholder until a single-sided card-side receptacle is chosen, so it isn't ready to order; the UART footprint becomes NXP's SOT617-1 (EP 3.1 mm), and REV2.md drops TE 5535657, which is the host-side header
This commit is contained in:
1 parent
6d4cadadbc
commit
ecd9900ec1
14 files changed
+19875
-12
No files matched your search
@@ -4,6 +4,8 @@ A Springboard module for the Handspring Visor that carries a Seeed XIAO nRF52840
|
||||
|
||||
**Status: prototype design, not yet built.** DRC is clean (0 unconnected pads) and the netlist was cross-checked against the Springboard Development Guide pin table, the SC16IS740 datasheet pinout, and Dmitry Grinberg's springSD v1.1 connector footprint. Order 5 boards and build one before trusting it.
|
||||
|
||||
This README covers rev 1 (`hw-v0.1`). Rev 2 (flash, bus UART, XIAO and Wio side by side, 4 layers) is laid out in `rev2/`; see [REV2.md](REV2.md) for its status and what has to happen before it can be ordered.
|
||||
|
||||
## What's in here
|
||||
|
||||
| Path | What |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# SB-LoRa rev 2 plan
|
||||
|
||||
Draft, not laid out yet. Rev 1 (`hw-v0.1`) is ordered and shipping, but its Hirose IC1HA straddle connector is obsolete and the order for one was cancelled (2026-11-17). Until rev 2 arrives, rev 1 is built with a harvested or wired-on connector (see "Without the Hirose part" in [README.md](README.md)). Rev 2 changes the connector, adds a flash chip so the app loads itself, and makes the module as flat as possible.
|
||||
Laid out, not ordered: J1's land pattern is a placeholder until a connector is chosen. Rev 1 (`hw-v0.1`) is ordered and shipping, but its Hirose IC1HA straddle connector is obsolete and the order for one was cancelled (2026-11-17). Until rev 2 arrives, rev 1 is built with a harvested or wired-on connector (see "Without the Hirose part" in [README.md](README.md)). Rev 2 changes the connector, adds a flash chip so the app loads itself, and makes the module as flat as possible.
|
||||
|
||||
## Decided
|
||||
|
||||
@@ -68,7 +68,7 @@ A 16550-style UART on csSlot1 replaces rev 1's SC16IS740 SPI bridge and its latc
|
||||
|
||||
## Open
|
||||
|
||||
- **Connector: the Hirose IC1HA order was cancelled (2026-11-17)**, so rev 2 drops the straddle footprint for a single-sided SMT PC Card receptacle (both rows of tails on the top side), harvested or stocked (TE 5535657-2 and Amphenol 1C1K are candidates; check they're the card-side receptacle). The Springboard uses the same 68-pin PCMCIA contacts (Dev Guide §5, §7.1), and the keying is in the module's plastic case, not the connector. Needed from a sample: markings, tail pitch, row spacing, tail distance from the mating face, and board surface height relative to the contact centre line.
|
||||
- **Connector: the Hirose IC1HA order was cancelled (2026-11-17)**, so rev 2 drops the straddle footprint for a single-sided SMT PC Card receptacle (both rows of tails on the top side), harvested or stocked (Amphenol 1C1K is a candidate. TE 5535657 is the host-side header, so it isn't; the stocked SMT card-side parts found so far, Hirose IC1F-68RD-1.27SF and IC9, are obsolete). The Springboard uses the same 68-pin PCMCIA contacts (Dev Guide §5, §7.1), and the keying is in the module's plastic case, not the connector. Needed from a sample: markings, tail pitch, row spacing, tail distance from the mating face, and board surface height relative to the contact centre line.
|
||||
- **Case.** The keying is in the module case, so rev 2 needs a case (printed, or a harvested Springboard shell) whose key and latch match the slot, with the board held at the connector's height. Dry-fit a bare harvested connector in the slot to check the contacts seat fully.
|
||||
- **Board thickness.** The straddle connector forces 1.6 mm; a top-mount one may allow 0.8-1.0 mm.
|
||||
- **LiPo size.** The aim is at least a few days per charge. Estimate, to be replaced by a measurement:
|
||||
@@ -77,11 +77,21 @@ A 16550-style UART on csSlot1 replaces rev 1's SC16IS740 SPI bridge and its latc
|
||||
- Flat pouches of that size: about 5 x 30 x 50 mm for 1000 mAh, 4 x 25 x 50 mm for 500-600 mAh. The extension is 50.4 x 24.6 mm, so a 50 mm cell fits across it, under or beside the boards.
|
||||
- To measure: current into BAT+ with a meter in series, USB unplugged, over a few minutes of idle listening and one message sent.
|
||||
|
||||
## Netlist
|
||||
## Netlist and layout
|
||||
|
||||
`rev2/netlist.py`, same shape as rev 1's `source/netlist.py` (rev 1 stays as built under `hw-v0.1`). Not laid out yet. Before layout:
|
||||
- Footprints: `rev2/make_footprints.py` writes `rev2/visormesh.pretty` (XIAO_SMD, WIO_PTH, BAT_PADS) from Seeed's own KiCad files. Open them in KiCad and check against a real XIAO and Wio with calipers before ordering.
|
||||
- J1 is still rev 1's straddle footprint in the netlist. It's replaced once a single-sided receptacle sample is measured (see Open).
|
||||
`rev2/netlist.py` has the parts and connections, in the same shape as rev 1's `source/netlist.py` (rev 1 stays as built under `hw-v0.1`). The board is laid out and routed. **Don't order it until J1 is settled** (below).
|
||||
|
||||
- **Board:** 50.43 x 75.05 mm, the same outline as rev 1. 4 layers, 1.6 mm: In1.Cu is a solid GND plane, F.Cu, In2.Cu and B.Cu carry signals, with GND pours on In2 and B. Every part is on the top except the LiPo pads (BT1), which are on the bottom under the radio boards. Tracks are 0.15 mm with 0.15 mm gaps, and vias are 0.5/0.25 mm, all within JLCPCB's standard 4-layer rules.
|
||||
- **Build:** `rev2/make.sh` runs the whole pipeline: `set_project.py`, then `build_board.py` (placement and GND vias), then Freerouting 1.9.0, then `finish_board.py` (pours), DRC and `verify.py`. It needs KiCad 10 (the Homebrew cask), Java 21 (`openjdk@21`) and `FREEROUTING=/path/to/freerouting-1.9.0.jar`; Freerouting 2.x ignores the pass limit and never finishes. `rev2/make_fab.py fab` writes the JLCPCB gerbers zip, BOM, CPL and the hand-fit list.
|
||||
- **Checks:** DRC reports 0 unconnected pads and no clearance errors. What's left is the XIAO footprint's outline silk being clipped at its pads, and warnings about the missing footprint-library table. `verify.py` checks every pad's net against the netlist, J1 against Table 5-1, the flash's word mode, the UART strobes and register select, the inverters, and that only U5 and U6 cross the two power domains.
|
||||
- **Renders:** `rev2/renders/`.
|
||||
|
||||
Before ordering:
|
||||
1. **J1.** Choose a card-side single-sided receptacle, then replace the `J1_*` constants at the top of `build_board.py` from its drawing: pitch, row stagger, each row's distance from the edge, and pad size. Keep the 5.5 mm strip along the edge free (`J1_KEEP`), and check whether the connector body needs the board edge moved. Then run `make.sh` and `make_fab.py` again. The current pattern is a placeholder: two staggered rows of 0.5 x 1.6 mm pads, 1.3 and 3.5 mm in from the edge. TE 5535657 is not a candidate: it's the host-side header.
|
||||
2. **XIAO and Wio footprints.** Check them against the real boards with calipers (print the top copper at 1:1).
|
||||
3. **Assembly.** In JLC's placement preview, check the rotation of U1 (pin 1 at the top left, beside the triangle), U2, U3, U5 and Y1.
|
||||
4. **Board thickness.** It stays 1.6 mm unless the chosen connector wants a thinner board.
|
||||
5. Tag the commit you order from as `hw-v0.2`.
|
||||
|
||||
## Carried over from rev 1
|
||||
|
||||
|
||||
@@ -0,0 +1,291 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Generate the unrouted rev 2 board with KiCad's pcbnew API (KiCad 10). Run with KiCad's own Python.
|
||||
|
||||
Same frame as rev 1 (../source/build_board.py): springSD's in-slot outline, connector edge at the
|
||||
bottom, the extension for the radio boards at the top. 4 layers: F.Cu, In2.Cu and B.Cu carry
|
||||
signals; In1.Cu is a solid GND plane.
|
||||
|
||||
J1 is a placeholder. No single-sided card-side receptacle has been chosen, so its land pattern
|
||||
comes from the J1_* constants below. Replace them from the part's drawing before ordering, and
|
||||
keep the J1 zone (J1_KEEP from the edge) free of other parts so the real pattern fits.
|
||||
"""
|
||||
import sys, os
|
||||
import pcbnew
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, HERE)
|
||||
from netlist import PARTS, CONN, NETS, SB_NAMES, XIAO_NAMES
|
||||
|
||||
MM = pcbnew.FromMM
|
||||
IN = 25.4
|
||||
OX, OY = 100.0, 100.0 # springSD origin (inches, y-up) mapped to KiCad (mm, y-down)
|
||||
def sb(x_in, y_in):
|
||||
return OX + x_in * IN, OY - y_in * IN
|
||||
def V(x, y):
|
||||
return pcbnew.VECTOR2I(MM(x), MM(y))
|
||||
|
||||
FPLIB = os.environ.get("KICAD_FOOTPRINTS",
|
||||
"/opt/homebrew/Caskroom/kicad/10.0.8/KiCad/KiCad.app/Contents/SharedSupport/footprints")
|
||||
LOCAL = os.path.join(HERE, "visormesh.pretty")
|
||||
OUT = sys.argv[1] if len(sys.argv) > 1 else os.path.join(HERE, "visormesh.kicad_pcb")
|
||||
REV = "v0.2"
|
||||
|
||||
# ---- J1 placeholder land pattern (replace from the chosen part's drawing) ----
|
||||
J1_PITCH = 1.27 # contact pitch within a row (PC Card standard)
|
||||
J1_STAGGER = 0.635 # row B tails offset from row A along the edge
|
||||
J1_ROW_A = 1.3 # pins 1-34: pad centre distance from the board edge
|
||||
J1_ROW_B = 3.5 # pins 35-68
|
||||
J1_PAD = (0.5, 1.6) # pad width along the edge, length into the board
|
||||
J1_KEEP = 5.5 # no other parts within this distance of the edge
|
||||
|
||||
board = pcbnew.BOARD()
|
||||
board.SetCopperLayerCount(4)
|
||||
board.SetLayerType(pcbnew.In1_Cu, pcbnew.LT_POWER)
|
||||
ds = board.GetDesignSettings()
|
||||
ds.SetBoardThickness(MM(1.6))
|
||||
ds.m_TrackMinWidth = MM(0.15)
|
||||
ds.m_MinClearance = MM(0.15)
|
||||
ds.m_ViasMinSize = MM(0.45)
|
||||
ds.m_MinThroughDrill = MM(0.25)
|
||||
ds.m_CopperEdgeClearance = MM(0.3)
|
||||
nc = ds.m_NetSettings.GetDefaultNetclass()
|
||||
nc.SetClearance(MM(0.15)); nc.SetTrackWidth(MM(0.15)); nc.SetViaDiameter(MM(0.5)); nc.SetViaDrill(MM(0.25))
|
||||
POWER_NETS = ("GND", "VSB", "3V3X", "VDOCK", "VDOCK_D", "XIAO_VBUS", "VBAT")
|
||||
|
||||
# ---------------- outline ----------------
|
||||
X0, X1 = sb(-0.991, 0)[0], sb(0.994315, 0)[0]
|
||||
Y_EDGE = sb(0, -0.926)[1] # connector edge (bottom)
|
||||
Y_SLOT = sb(0, 1.060307)[1] # top of springSD outline = slot opening
|
||||
EXT = 24.6 # extension beyond the slot for the XIAO and Wio
|
||||
Y_TOP = Y_SLOT - EXT
|
||||
pts = [(X0, Y_TOP), (X1, Y_TOP), (X1, Y_EDGE), (X0, Y_EDGE)]
|
||||
for i in range(4):
|
||||
s = pcbnew.PCB_SHAPE(board); s.SetShape(pcbnew.SHAPE_T_SEGMENT)
|
||||
s.SetStart(V(*pts[i])); s.SetEnd(V(*pts[(i + 1) % 4])); s.SetLayer(pcbnew.Edge_Cuts); s.SetWidth(MM(0.1))
|
||||
board.Add(s)
|
||||
for lyr in (pcbnew.F_Fab, pcbnew.B_Fab, pcbnew.F_SilkS):
|
||||
s = pcbnew.PCB_SHAPE(board); s.SetShape(pcbnew.SHAPE_T_SEGMENT)
|
||||
s.SetStart(V(X0 + 1, Y_SLOT)); s.SetEnd(V(X1 - 1, Y_SLOT)); s.SetLayer(lyr); s.SetWidth(MM(0.12))
|
||||
board.Add(s)
|
||||
# J1 zone on the fab layer, so the placeholder's extent shows on the assembly drawing
|
||||
s = pcbnew.PCB_SHAPE(board); s.SetShape(pcbnew.SHAPE_T_RECT)
|
||||
s.SetStart(V(X0 + 0.5, Y_EDGE - J1_KEEP)); s.SetEnd(V(X1 - 0.5, Y_EDGE - 0.2))
|
||||
s.SetLayer(pcbnew.F_Fab); s.SetWidth(MM(0.1)); board.Add(s)
|
||||
|
||||
# ---------------- nets ----------------
|
||||
netinfo = {}
|
||||
for n in NETS:
|
||||
ni = pcbnew.NETINFO_ITEM(board, n); board.Add(ni); netinfo[n] = ni
|
||||
|
||||
def springboard_fp():
|
||||
fp = pcbnew.FOOTPRINT(board)
|
||||
fp.SetFPID(pcbnew.LIB_ID("visormesh", "SPRINGBOARD_68_SMT"))
|
||||
fp.SetReference("J1"); fp.SetValue("Springboard 68p SMT (placeholder)")
|
||||
for n in range(1, 69):
|
||||
a = n <= 34
|
||||
k = (n - 1) if a else (n - 35)
|
||||
x = 0.8 * IN - k * J1_PITCH - (0 if a else J1_STAGGER)
|
||||
y = -(J1_ROW_A if a else J1_ROW_B)
|
||||
p = pcbnew.PAD(fp)
|
||||
p.SetNumber(str(n)); p.SetShape(pcbnew.PAD_SHAPE_RECT); p.SetAttribute(pcbnew.PAD_ATTRIB_SMD)
|
||||
p.SetSize(V(*J1_PAD))
|
||||
ls = pcbnew.LSET(); ls.AddLayer(pcbnew.F_Cu); ls.AddLayer(pcbnew.F_Mask); ls.AddLayer(pcbnew.F_Paste)
|
||||
p.SetLayerSet(ls)
|
||||
fp.Add(p)
|
||||
p.SetPosition(V(OX + x, Y_EDGE + y))
|
||||
return fp
|
||||
|
||||
placed = {}
|
||||
def load(ref):
|
||||
val, lib, name, lcsc, desc, dnp = PARTS[ref]
|
||||
if ref == "J1":
|
||||
fp = springboard_fp()
|
||||
else:
|
||||
path = LOCAL if lib == "visormesh" else os.path.join(FPLIB, lib + ".pretty")
|
||||
fp = pcbnew.FootprintLoad(path, name)
|
||||
assert fp, (ref, lib, name)
|
||||
fp.SetFPID(pcbnew.LIB_ID(lib, name))
|
||||
fp.SetReference(ref); fp.SetValue(val)
|
||||
if lcsc:
|
||||
fp.SetField("LCSC", lcsc)
|
||||
fp.GetField("LCSC").SetVisible(False)
|
||||
board.Add(fp)
|
||||
placed[ref] = fp
|
||||
return fp
|
||||
|
||||
def place(ref, x, y, rot=0.0, back=False):
|
||||
fp = load(ref)
|
||||
if ref != "J1":
|
||||
fp.SetPosition(V(x, y))
|
||||
fp.SetOrientationDegrees(rot)
|
||||
if back:
|
||||
fp.Flip(fp.GetPosition(), pcbnew.FLIP_DIRECTION_LEFT_RIGHT)
|
||||
return fp
|
||||
|
||||
# ---- placement (KiCad mm). Slot zone: Y_SLOT..Y_EDGE. Extension: Y_TOP..Y_SLOT ----
|
||||
# Slot pin k of row A sits at x = 120.32 - 1.27(k-1): D3-D7 at 119-114, OE* 110.2, WE* 102.5,
|
||||
# IRQ* 101.3, VCC 100, A1-A3 88.6-86, D0-D2 83.5-81.
|
||||
place("J1", 0, 0)
|
||||
place("U1", 101.0, 104.5, 0) # flash: address pins left, data right
|
||||
place("C2", 113.5, 104.5, 90) # U1 VCC (pin 37, right side)
|
||||
place("JP2", 101.0, 95.5, 0) # WE* -> flash WE#
|
||||
place("R4", 105.5, 95.5, 90)
|
||||
place("U2", 83.0, 89.0, 0) # UART near D0-D2 and A1-A3
|
||||
place("C3", 83.0, 84.0, 0)
|
||||
place("Y1", 83.0, 98.0, 0)
|
||||
place("C6", 79.0, 98.0, 90)
|
||||
place("C7", 87.0, 98.0, 90)
|
||||
place("U3", 114.5, 92.5, 0) # OR strobes near OE*/CS1*/WE*
|
||||
place("C4", 114.5, 89.0, 0)
|
||||
place("U4", 93.0, 92.5, 0) # INT/RESET inverters
|
||||
place("C5", 93.0, 89.0, 0)
|
||||
place("C1", 92.0, 114.0, 0) # VSB bulk at VCC pins 17/51
|
||||
# Ioff translators near the slot opening, where the XIAO-side nets cross
|
||||
place("U5", 95.0, 78.5, 0)
|
||||
place("C8", 95.0, 81.5, 0); place("C9", 95.0, 75.5, 0)
|
||||
place("U6", 101.0, 78.5, 0)
|
||||
place("C10", 101.0, 81.5, 0); place("C11", 101.0, 75.5, 0)
|
||||
place("R1", 90.5, 78.5, 90) # XIAO RX pull-up (3V3X)
|
||||
place("R2", 105.0, 78.5, 90) # UART RX pull-up (VSB)
|
||||
place("R3", 88.0, 78.5, 90) # Visor-present pull-down
|
||||
# VDOCK path
|
||||
place("D1", 112.0, 78.5, 90)
|
||||
place("JP1", 116.5, 78.5, 90)
|
||||
# Radio boards side by side, USB-C and pin 1 toward the outer edge
|
||||
YX = Y_TOP + 11.0
|
||||
place("X1", 87.0, YX, 0)
|
||||
place("X2", 112.5, YX, 0)
|
||||
place("C12", 100.25, YX + 7.5, 90) # 3V3X bulk between the boards
|
||||
place("TP1", 100.25, Y_TOP + 2.5); place("TP2", 100.25, Y_TOP + 5.3)
|
||||
place("TP3", 100.25, Y_TOP + 8.1); place("TP4", 100.25, Y_TOP + 10.9)
|
||||
place("BT1", 100.25, YX + 0.5, 90, back=True) # LiPo under the boards
|
||||
|
||||
# ---------------- reference text ----------------
|
||||
for ref, fp in placed.items():
|
||||
fp.Value().SetVisible(False)
|
||||
r = fp.Reference()
|
||||
if ref in ("JP1", "JP2", "TP1", "TP2", "TP3", "TP4"):
|
||||
r.SetTextSize(V(0.8, 0.8)); r.SetTextThickness(MM(0.12))
|
||||
else:
|
||||
r.SetLayer(pcbnew.B_Fab if fp.IsFlipped() else pcbnew.F_Fab)
|
||||
r.SetMirrored(fp.IsFlipped())
|
||||
r.SetTextSize(V(0.5, 0.5)); r.SetTextThickness(MM(0.08))
|
||||
for t in fp.GraphicalItems(): # the XIAO footprint's pad labels are under 0.8 mm
|
||||
if t.GetClass() == "PCB_TEXT" and t.GetLayer() in (pcbnew.F_SilkS, pcbnew.B_SilkS) \
|
||||
and pcbnew.ToMM(t.GetTextHeight()) < 0.8:
|
||||
t.SetTextSize(V(0.8, 0.8)); t.SetTextThickness(MM(0.12))
|
||||
if t.GetClass() == "PCB_TEXT" and t.GetLayer() == pcbnew.B_SilkS:
|
||||
t.SetMirrored(True)
|
||||
placed["JP1"].Reference().SetPosition(V(118.8, 78.5))
|
||||
placed["JP2"].Reference().SetPosition(V(101.0, 93.8))
|
||||
for i, ref in enumerate(("TP1", "TP2", "TP3", "TP4")):
|
||||
placed[ref].Reference().SetPosition(V(97.6, Y_TOP + 2.5 + 2.8 * i))
|
||||
placed[ref].Reference().SetVisible(False)
|
||||
|
||||
# ---------------- assign nets ----------------
|
||||
for (ref, pad), net in CONN.items():
|
||||
hit = [p for p in placed[ref].Pads() if p.GetNumber() == pad]
|
||||
assert hit, (ref, pad)
|
||||
for p in hit:
|
||||
p.SetNet(netinfo[net])
|
||||
|
||||
# ---------------- GND fanout ----------------
|
||||
# The router doesn't drop vias from pads to a plane, so each SMD GND pad gets a via to In1 here,
|
||||
# just outside the pad, away from the part's centre. Locked, so finish_board.py keeps them.
|
||||
VIA_D, VIA_DRILL, GAP = 0.5, 0.25, 0.2
|
||||
def fanout(pad, dx, dy, dist=None):
|
||||
px, py = pcbnew.ToMM(pad.GetPosition().x), pcbnew.ToMM(pad.GetPosition().y)
|
||||
sx, sy = pcbnew.ToMM(pad.GetBoundingBox().GetWidth()), pcbnew.ToMM(pad.GetBoundingBox().GetHeight())
|
||||
if dist is None:
|
||||
dist = (sx if dx else sy) / 2 + VIA_D / 2 + GAP
|
||||
vx, vy = px + dx * dist, py + dy * dist
|
||||
lyr = pcbnew.B_Cu if pad.IsOnLayer(pcbnew.B_Cu) and not pad.IsOnLayer(pcbnew.F_Cu) else pcbnew.F_Cu
|
||||
t = pcbnew.PCB_TRACK(board); t.SetLayer(lyr); t.SetWidth(MM(0.3)); t.SetNet(netinfo["GND"])
|
||||
t.SetStart(V(px, py)); t.SetEnd(V(vx, vy)); t.SetLocked(True); board.Add(t)
|
||||
v = pcbnew.PCB_VIA(board); v.SetNet(netinfo["GND"]); v.SetPosition(V(vx, vy))
|
||||
v.SetWidth(MM(VIA_D)); v.SetDrill(MM(VIA_DRILL)); v.SetLayerPair(pcbnew.F_Cu, pcbnew.B_Cu)
|
||||
v.SetLocked(True); board.Add(v)
|
||||
|
||||
for ref, fp in placed.items():
|
||||
c = fp.GetPosition()
|
||||
for p in fp.Pads():
|
||||
if p.GetNetname() != "GND" or p.GetAttribute() != pcbnew.PAD_ATTRIB_SMD:
|
||||
continue
|
||||
n = p.GetNumber()
|
||||
if ref == "J1":
|
||||
row_a = int(n) <= 34
|
||||
dx = (1 if int(n) == 1 else -1) if row_a else 0 # row A ends go sideways, row B inward
|
||||
fanout(p, dx, 0 if row_a else -1)
|
||||
continue
|
||||
if ref in ("U2", "BT1"):
|
||||
continue # U2: through its exposed pad, below. BT1 is on B.Cu, in the B.Cu GND pour
|
||||
ox, oy = p.GetPosition().x - c.x, p.GetPosition().y - c.y
|
||||
if ox == 0 and oy == 0:
|
||||
fanout(p, 1, 0) # single-pad test point
|
||||
continue
|
||||
if abs(ox) >= abs(oy):
|
||||
fanout(p, 1 if ox > 0 else -1, 0)
|
||||
else:
|
||||
fanout(p, 0, 1 if oy > 0 else -1)
|
||||
# U2: GND pins 7, 13, 25, 26 join the exposed pad on F.Cu; the pad gets four vias to the plane
|
||||
u2 = placed["U2"]; ep = [p for p in u2.Pads() if p.GetNumber() == "33"][0]
|
||||
ec = ep.GetPosition()
|
||||
for p in u2.Pads():
|
||||
if p.GetNumber() in ("7", "13", "25", "26"):
|
||||
pp = p.GetPosition() # straight in from the pin, so it stays in its own lane
|
||||
lim = MM(1.3) # stay on the 3.1 mm exposed pad
|
||||
clamp = lambda v, c: max(c - lim, min(c + lim, v))
|
||||
end = (pcbnew.VECTOR2I(ec.x, clamp(pp.y, ec.y)) if abs(pp.x - ec.x) > abs(pp.y - ec.y)
|
||||
else pcbnew.VECTOR2I(clamp(pp.x, ec.x), ec.y))
|
||||
t = pcbnew.PCB_TRACK(board); t.SetLayer(pcbnew.F_Cu); t.SetWidth(MM(0.2)); t.SetNet(netinfo["GND"])
|
||||
t.SetStart(pp); t.SetEnd(end); t.SetLocked(True); board.Add(t)
|
||||
for dx, dy in ((-0.75, -0.75), (0.75, -0.75), (-0.75, 0.75), (0.75, 0.75)):
|
||||
v = pcbnew.PCB_VIA(board); v.SetNet(netinfo["GND"])
|
||||
v.SetPosition(pcbnew.VECTOR2I(ec.x + MM(dx), ec.y + MM(dy)))
|
||||
v.SetWidth(MM(VIA_D)); v.SetDrill(MM(VIA_DRILL)); v.SetLayerPair(pcbnew.F_Cu, pcbnew.B_Cu)
|
||||
v.SetLocked(True); board.Add(v)
|
||||
|
||||
# ---------------- GND plane on In1 (the router treats it as a plane) ----------------
|
||||
z = pcbnew.ZONE(board); z.SetLayer(pcbnew.In1_Cu); z.SetIslandRemovalMode(pcbnew.ISLAND_REMOVAL_MODE_ALWAYS); z.SetNet(netinfo["GND"])
|
||||
ol = z.Outline(); ol.NewOutline()
|
||||
for x, y in ((X0, Y_TOP), (X1, Y_TOP), (X1, Y_EDGE), (X0, Y_EDGE)):
|
||||
ol.Append(MM(x), MM(y))
|
||||
z.SetLocalClearance(MM(0.25)); z.SetMinThickness(MM(0.2))
|
||||
z.SetPadConnection(pcbnew.ZONE_CONNECTION_THT_THERMAL)
|
||||
z.SetThermalReliefGap(MM(0.3)); z.SetThermalReliefSpokeWidth(MM(0.3))
|
||||
board.Add(z)
|
||||
|
||||
# Keep-out strip along the connector edge, so the router doesn't pass between J1's pads and the edge
|
||||
ka = pcbnew.ZONE(board); ka.SetIsRuleArea(True)
|
||||
ls = pcbnew.LSET(); [ls.AddLayer(l) for l in (pcbnew.F_Cu, pcbnew.In1_Cu, pcbnew.In2_Cu, pcbnew.B_Cu)]
|
||||
ka.SetLayerSet(ls)
|
||||
ka.SetDoNotAllowTracks(True); ka.SetDoNotAllowVias(True); ka.SetDoNotAllowPads(False)
|
||||
ka.SetDoNotAllowFootprints(False); ka.SetDoNotAllowZoneFills(False)
|
||||
ol = ka.Outline(); ol.NewOutline()
|
||||
ky = Y_EDGE - J1_ROW_A + J1_PAD[1] / 2 - 0.1 # just inside row A's pad tips
|
||||
for x, y in ((X0, ky), (X1, ky), (X1, Y_EDGE), (X0, Y_EDGE)):
|
||||
ol.Append(MM(x), MM(y))
|
||||
board.Add(ka)
|
||||
|
||||
# ---------------- silkscreen ----------------
|
||||
def silk(s, x, y, size=0.8, layer=pcbnew.F_SilkS, mirror=False):
|
||||
t = pcbnew.PCB_TEXT(board)
|
||||
t.SetText(s); t.SetPosition(V(x, y)); t.SetLayer(layer)
|
||||
t.SetTextSize(V(size, size)); t.SetTextThickness(MM(size * 0.15))
|
||||
if mirror: t.SetMirrored(True)
|
||||
board.Add(t)
|
||||
return t
|
||||
|
||||
silk("VisorMesh SB-LoRa " + REV, 100.0, 112.0, 1.0)
|
||||
silk("^ SLOT OPENING ^", 84.0, Y_SLOT + 1.3, 0.8)
|
||||
silk("USB-C this edge", 87.0, Y_TOP + 1.0, 0.8, pcbnew.B_SilkS, True)
|
||||
silk("1", OX + 0.8 * IN, Y_EDGE - J1_KEEP - 0.8, 0.8)
|
||||
silk("34", OX - 0.85 * IN, Y_EDGE - J1_KEEP - 0.8, 0.8)
|
||||
silk("LiPo", 100.25, YX + 4.3, 0.8, pcbnew.B_SilkS, True)
|
||||
for i, lab in enumerate(("IO", "CK", "RS", "G")): # SWDIO, SWCLK, NRST, GND
|
||||
silk(lab, 102.5, Y_TOP + 2.5 + 2.8 * i, 0.8)
|
||||
silk("VDOCK", 116.5, 75.3, 0.8)
|
||||
silk("WE", 101.0, 97.3, 0.8)
|
||||
|
||||
board.Save(OUT)
|
||||
print("saved", OUT, "slot", round(Y_SLOT, 3), "top", round(Y_TOP, 3), "edge", round(Y_EDGE, 3),
|
||||
"x", round(X0, 3), round(X1, 3))
|
||||
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/python3
|
||||
"""Import the Freerouting session, add GND pours on the signal layers, drop router stubs, fill, save.
|
||||
Rev 2: 4 layers; the In1.Cu GND plane comes from build_board.py."""
|
||||
import sys, pcbnew
|
||||
MM = pcbnew.FromMM
|
||||
pcb = sys.argv[1]; ses = sys.argv[2]
|
||||
b = pcbnew.LoadBoard(pcb)
|
||||
import re
|
||||
def sexp(txt):
|
||||
toks = re.findall(r'\(|\)|"[^"]*"|[^\s()]+', txt)
|
||||
st = [[]]
|
||||
for t in toks:
|
||||
if t == "(": st.append([])
|
||||
elif t == ")": e = st.pop(); st[-1].append(e)
|
||||
else: st[-1].append(t.strip('"'))
|
||||
return st[0][0]
|
||||
S = sexp(open(ses).read())
|
||||
def find(node, key):
|
||||
return [c for c in node if isinstance(c, list) and c and c[0] == key]
|
||||
routes = find(S, "routes")[0]
|
||||
res = float(find(routes, "resolution")[0][2]) # units per um
|
||||
k = 1.0 / (res * 1000.0) # -> mm
|
||||
NM = lambda v: int(round(float(v) * 1000.0 / res)) # session units -> KiCad nm, exact
|
||||
for remove in [t for t in b.GetTracks() if not t.IsLocked()]: # keep build_board.py's GND fanout
|
||||
b.Remove(remove)
|
||||
fixed_vias = {(v.GetPosition().x, v.GetPosition().y) for v in b.GetTracks() if v.Type() == pcbnew.PCB_VIA_T}
|
||||
ntr = nvia = 0
|
||||
for net in find(find(routes, "network_out")[0], "net"):
|
||||
ni = b.FindNet(net[1])
|
||||
for w in find(net, "wire"):
|
||||
path = find(w, "path")[0]
|
||||
layer = b.GetLayerID(path[1]); width = float(path[2]) * k
|
||||
xy = path[3:]
|
||||
pts = [(NM(xy[i]), -NM(xy[i + 1])) for i in range(0, len(xy), 2)]
|
||||
for (ax, ay), (bx, by) in zip(pts, pts[1:]):
|
||||
t = pcbnew.PCB_TRACK(b); t.SetLayer(layer); t.SetWidth(MM(width)); t.SetNet(ni)
|
||||
t.SetStart(pcbnew.VECTOR2I(ax, ay)); t.SetEnd(pcbnew.VECTOR2I(bx, by))
|
||||
b.Add(t); ntr += 1
|
||||
for v in find(net, "via"):
|
||||
if (NM(v[2]), -NM(v[3])) in fixed_vias:
|
||||
continue
|
||||
m = re.search(r'_(\d+):(\d+)_um', v[1]); dia, drl = int(m.group(1)) / 1000, int(m.group(2)) / 1000
|
||||
via = pcbnew.PCB_VIA(b); via.SetNet(ni)
|
||||
via.SetPosition(pcbnew.VECTOR2I(NM(v[2]), -NM(v[3])))
|
||||
via.SetWidth(MM(dia)); via.SetDrill(MM(drl)); via.SetLayerPair(pcbnew.F_Cu, pcbnew.B_Cu)
|
||||
b.Add(via); nvia += 1
|
||||
print("imported", ntr, "segments", nvia, "vias")
|
||||
gnd = b.FindNet("GND")
|
||||
bb = b.GetBoardEdgesBoundingBox()
|
||||
x0, y0, x1, y1 = bb.GetX(), bb.GetY(), bb.GetRight(), bb.GetBottom()
|
||||
for layer in (pcbnew.In2_Cu, pcbnew.B_Cu): # F.Cu has no pour: In1 is the plane
|
||||
z = pcbnew.ZONE(b); z.SetLayer(layer); z.SetNet(gnd)
|
||||
ol = z.Outline(); ol.NewOutline()
|
||||
for x, y in ((x0, y0), (x1, y0), (x1, y1), (x0, y1)):
|
||||
ol.Append(x, y)
|
||||
z.SetLocalClearance(MM(0.25)); z.SetMinThickness(MM(0.2))
|
||||
z.SetPadConnection(pcbnew.ZONE_CONNECTION_FULL if layer == pcbnew.In2_Cu else pcbnew.ZONE_CONNECTION_THT_THERMAL)
|
||||
z.SetThermalReliefGap(MM(0.3)); z.SetThermalReliefSpokeWidth(MM(0.3))
|
||||
z.SetIslandRemovalMode(pcbnew.ISLAND_REMOVAL_MODE_ALWAYS)
|
||||
z.SetIsFilled(False)
|
||||
b.Add(z)
|
||||
# drop dangling stubs / orphan vias left by the router
|
||||
def ends(t): return (t.GetStart(), t.GetEnd())
|
||||
def key(t):
|
||||
a, c = t.GetStart(), t.GetEnd()
|
||||
a, c = sorted([(a.x, a.y), (c.x, c.y)])
|
||||
return (t.GetLayer(), t.GetNetname(), a, c)
|
||||
seen = set()
|
||||
for t in [t for t in b.GetTracks() if t.Type() == pcbnew.PCB_TRACE_T]:
|
||||
if key(t) in seen or t.GetStart() == t.GetEnd():
|
||||
b.Remove(t)
|
||||
else:
|
||||
seen.add(key(t))
|
||||
for _ in range(10):
|
||||
tracks = [t for t in b.GetTracks() if t.Type() == pcbnew.PCB_TRACE_T]
|
||||
vias = [t for t in b.GetTracks() if t.Type() == pcbnew.PCB_VIA_T]
|
||||
removed = 0
|
||||
for t in list(tracks):
|
||||
if t.GetNetname() == "GND":
|
||||
continue
|
||||
for pt in ends(t):
|
||||
touch = any(o is not t and o.GetLayer() == t.GetLayer() and pt in ends(o) for o in tracks)
|
||||
touch = touch or any(v.GetPosition() == pt for v in vias)
|
||||
touch = touch or any(p.HitTest(pt) and p.IsOnLayer(t.GetLayer()) for p in b.GetPads())
|
||||
if not touch:
|
||||
b.Remove(t); removed += 1; break
|
||||
for v in list(vias):
|
||||
n = sum(1 for t in b.GetTracks() if t.Type() == pcbnew.PCB_TRACE_T and v.GetPosition() in ends(t))
|
||||
if n == 0:
|
||||
b.Remove(v); removed += 1
|
||||
if not removed: break
|
||||
pcbnew.ZONE_FILLER(b).Fill(b.Zones())
|
||||
b.Save(pcb)
|
||||
print("tracks", len(b.GetTracks()), "zones", len(b.Zones()))
|
||||
@@ -0,0 +1,202 @@
|
||||
** Drc report for visormesh.kicad_pcb **
|
||||
** Created on 2026-11-17T20:34:25 **
|
||||
** Report includes: Errors, Warnings **
|
||||
|
||||
** Found 54 DRC violations **
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(114.5000 mm, 89.0000 mm): Footprint C4
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(113.5000 mm, 104.5000 mm): Footprint C2
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'visormesh'
|
||||
Local override; warning
|
||||
@(112.5000 mm, 59.4682 mm): Footprint X2
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(95.0000 mm, 81.5000 mm): Footprint C8
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Jumper'
|
||||
Local override; warning
|
||||
@(116.5000 mm, 78.5000 mm): Footprint JP1
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Diode_SMD'
|
||||
Local override; warning
|
||||
@(112.0000 mm, 78.5000 mm): Footprint D1
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(87.0000 mm, 98.0000 mm): Footprint C7
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Package_SO'
|
||||
Local override; warning
|
||||
@(114.5000 mm, 92.5000 mm): Footprint U3
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Crystal'
|
||||
Local override; warning
|
||||
@(83.0000 mm, 98.0000 mm): Footprint Y1
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(83.0000 mm, 84.0000 mm): Footprint C3
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Jumper'
|
||||
Local override; warning
|
||||
@(101.0000 mm, 95.5000 mm): Footprint JP2
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Package_SO'
|
||||
Local override; warning
|
||||
@(95.0000 mm, 78.5000 mm): Footprint U5
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(79.0000 mm, 98.0000 mm): Footprint C6
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'visormesh'
|
||||
Local override; warning
|
||||
@(87.0000 mm, 59.4682 mm): Footprint X1
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Resistor_SMD'
|
||||
Local override; warning
|
||||
@(105.5000 mm, 95.5000 mm): Footprint R4
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(101.0000 mm, 75.5000 mm): Footprint C11
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(93.0000 mm, 89.0000 mm): Footprint C5
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Resistor_SMD'
|
||||
Local override; warning
|
||||
@(105.0000 mm, 78.5000 mm): Footprint R2
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(92.0000 mm, 114.0000 mm): Footprint C1
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Package_TO_SOT_SMD'
|
||||
Local override; warning
|
||||
@(93.0000 mm, 92.5000 mm): Footprint U4
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'TestPoint'
|
||||
Local override; warning
|
||||
@(100.2500 mm, 50.9682 mm): Footprint TP1
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(101.0000 mm, 81.5000 mm): Footprint C10
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'TestPoint'
|
||||
Local override; warning
|
||||
@(100.2500 mm, 56.5682 mm): Footprint TP3
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Package_DFN_QFN'
|
||||
Local override; warning
|
||||
@(83.0000 mm, 89.0000 mm): Footprint U2
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Package_SO'
|
||||
Local override; warning
|
||||
@(101.0000 mm, 104.5000 mm): Footprint U1
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Resistor_SMD'
|
||||
Local override; warning
|
||||
@(88.0000 mm, 78.5000 mm): Footprint R3
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(95.0000 mm, 75.5000 mm): Footprint C9
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'visormesh'
|
||||
Local override; warning
|
||||
@(0.0000 mm, 0.0000 mm): Footprint J1
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Resistor_SMD'
|
||||
Local override; warning
|
||||
@(90.5000 mm, 78.5000 mm): Footprint R1
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'TestPoint'
|
||||
Local override; warning
|
||||
@(100.2500 mm, 59.3682 mm): Footprint TP4
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Package_TO_SOT_SMD'
|
||||
Local override; warning
|
||||
@(101.0000 mm, 78.5000 mm): Footprint U6
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'Capacitor_SMD'
|
||||
Local override; warning
|
||||
@(100.2500 mm, 66.9682 mm): Footprint C12
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'TestPoint'
|
||||
Local override; warning
|
||||
@(100.2500 mm, 53.7682 mm): Footprint TP2
|
||||
[lib_footprint_issues]: The current configuration does not include the footprint library 'visormesh'
|
||||
Local override; warning
|
||||
@(100.2500 mm, 59.9682 mm): Footprint BT1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.6000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(78.9200 mm, 51.8482 mm): PTH pad 1 [VISOR_PRESENT] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.6000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(78.9200 mm, 54.3882 mm): PTH pad 2 [LORA_DIO1] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.6000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(78.9200 mm, 56.9282 mm): PTH pad 3 [LORA_RESET] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.6000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(78.9200 mm, 59.4682 mm): PTH pad 4 [LORA_BUSY] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.6000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(78.9200 mm, 62.0082 mm): PTH pad 5 [LORA_NSS] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.6000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(78.9200 mm, 64.5482 mm): PTH pad 6 [LORA_RXEN] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.6000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(78.9200 mm, 67.0882 mm): PTH pad 7 [XIAO_TX] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(93.4000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(95.0800 mm, 67.0882 mm): PTH pad 8 [XIAO_RX] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(93.4000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(95.0800 mm, 64.5482 mm): PTH pad 9 [LORA_SCK] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(93.4000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(95.0800 mm, 62.0082 mm): PTH pad 10 [LORA_MISO] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(93.4000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(95.0800 mm, 59.4682 mm): PTH pad 11 [LORA_MOSI] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(93.4000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(95.0800 mm, 56.9282 mm): PTH pad 12 [3V3X] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(93.4000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(95.0800 mm, 54.3882 mm): PTH pad 13 [GND] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(93.4000 mm, 48.9182 mm): Segment of X1 on F.Silkscreen
|
||||
@(95.0800 mm, 51.8482 mm): PTH pad 14 [XIAO_VBUS] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(87.0000 mm, 50.1182 mm): Footprint text of X1 (USB)
|
||||
@(85.7300 mm, 50.8992 mm): PTH pad SWDIO [SWDIO] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(87.0000 mm, 50.1182 mm): Footprint text of X1 (USB)
|
||||
@(88.2700 mm, 50.8992 mm): PTH pad SWCLK [SWCLK] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.1550 mm, 57.2492 mm): Footprint text of X1 (BAT-)
|
||||
@(82.5550 mm, 57.2492 mm): PTH pad BAT- [GND] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.1550 mm, 57.2492 mm): Footprint text of X1 (BAT-)
|
||||
@(78.9200 mm, 56.9282 mm): PTH pad 3 [LORA_RESET] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.1550 mm, 59.1542 mm): Footprint text of X1 (BAT+)
|
||||
@(82.5550 mm, 59.1542 mm): PTH pad BAT+ [VBAT] of X1
|
||||
[silk_over_copper]: Silkscreen clipped by solder mask
|
||||
Local override; warning
|
||||
@(80.1550 mm, 59.1542 mm): Footprint text of X1 (BAT+)
|
||||
@(78.9200 mm, 59.4682 mm): PTH pad 4 [LORA_BUSY] of X1
|
||||
|
||||
** Found 0 unconnected pads **
|
||||
|
||||
** Found 0 Footprint errors **
|
||||
|
||||
** Ignored checks **
|
||||
- Footprint has no courtyard defined
|
||||
- Track endpoint not centered on via
|
||||
- Tuning profile track geometries
|
||||
- Footprint doesn't match symbol's footprint filters
|
||||
- PTH inside courtyard
|
||||
- NPTH inside courtyard
|
||||
- Footprint component type doesn't match footprint pads
|
||||
|
||||
** End of Report **
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,383 @@
|
||||
{
|
||||
"board": {
|
||||
"3dviewports": [],
|
||||
"design_settings": {
|
||||
"defaults": {
|
||||
"apply_defaults_to_fp_barcodes": false,
|
||||
"apply_defaults_to_fp_dimensions": false,
|
||||
"apply_defaults_to_fp_fields": false,
|
||||
"apply_defaults_to_fp_shapes": false,
|
||||
"apply_defaults_to_fp_text": false,
|
||||
"board_outline_line_width": 0.05,
|
||||
"copper_line_width": 0.2,
|
||||
"copper_text_italic": false,
|
||||
"copper_text_size_h": 1.5,
|
||||
"copper_text_size_v": 1.5,
|
||||
"copper_text_thickness": 0.3,
|
||||
"copper_text_upright": false,
|
||||
"courtyard_line_width": 0.05,
|
||||
"dimension_precision": 4,
|
||||
"dimension_units": 3,
|
||||
"dimensions": {
|
||||
"arrow_length": 1270000,
|
||||
"extension_offset": 500000,
|
||||
"keep_text_aligned": true,
|
||||
"suppress_zeroes": false,
|
||||
"text_position": 0,
|
||||
"units_format": 1
|
||||
},
|
||||
"fab_line_width": 0.1,
|
||||
"fab_text_italic": false,
|
||||
"fab_text_size_h": 1.0,
|
||||
"fab_text_size_v": 1.0,
|
||||
"fab_text_thickness": 0.15,
|
||||
"fab_text_upright": false,
|
||||
"other_line_width": 0.1,
|
||||
"other_text_italic": false,
|
||||
"other_text_size_h": 1.0,
|
||||
"other_text_size_v": 1.0,
|
||||
"other_text_thickness": 0.15,
|
||||
"other_text_upright": false,
|
||||
"pads": {
|
||||
"drill": 0.762,
|
||||
"height": 1.524,
|
||||
"width": 1.524
|
||||
},
|
||||
"silk_line_width": 0.1,
|
||||
"silk_text_italic": false,
|
||||
"silk_text_size_h": 1.0,
|
||||
"silk_text_size_v": 1.0,
|
||||
"silk_text_thickness": 0.1,
|
||||
"silk_text_upright": false,
|
||||
"zones": {
|
||||
"border_display_style": 2,
|
||||
"border_hatch_pitch": 0.5,
|
||||
"corner_radius": 0.0,
|
||||
"corner_smoothing": 0,
|
||||
"fill_mode": 0,
|
||||
"hatch_gap": 1.5,
|
||||
"hatch_orientation": 0.0,
|
||||
"hatch_smoothing_level": 0,
|
||||
"hatch_smoothing_value": 0.1,
|
||||
"hatch_thickness": 1.0,
|
||||
"min_clearance": 0.5,
|
||||
"min_island_area": 10.0,
|
||||
"min_thickness": 0.25,
|
||||
"pad_connection": 1,
|
||||
"remove_islands": 0,
|
||||
"thermal_relief_gap": 0.5,
|
||||
"thermal_relief_spoke_width": 0.5
|
||||
}
|
||||
},
|
||||
"diff_pair_dimensions": [],
|
||||
"drc_exclusions": [],
|
||||
"meta": {
|
||||
"version": 2
|
||||
},
|
||||
"rule_severities": {
|
||||
"annular_width": "error",
|
||||
"clearance": "error",
|
||||
"connection_width": "warning",
|
||||
"copper_edge_clearance": "error",
|
||||
"copper_sliver": "warning",
|
||||
"courtyards_overlap": "error",
|
||||
"creepage": "error",
|
||||
"diff_pair_gap_out_of_range": "error",
|
||||
"diff_pair_uncoupled_length_too_long": "error",
|
||||
"drill_out_of_range": "error",
|
||||
"duplicate_footprints": "warning",
|
||||
"extra_footprint": "warning",
|
||||
"footprint": "error",
|
||||
"footprint_filters_mismatch": "ignore",
|
||||
"footprint_symbol_field_mismatch": "warning",
|
||||
"footprint_symbol_mismatch": "warning",
|
||||
"footprint_type_mismatch": "ignore",
|
||||
"hole_clearance": "error",
|
||||
"hole_near_hole": "error",
|
||||
"hole_to_hole": "error",
|
||||
"holes_co_located": "warning",
|
||||
"invalid_outline": "error",
|
||||
"isolated_copper": "warning",
|
||||
"item_on_disabled_layer": "error",
|
||||
"items_not_allowed": "error",
|
||||
"length_out_of_range": "error",
|
||||
"lib_footprint_issues": "warning",
|
||||
"lib_footprint_mismatch": "warning",
|
||||
"malformed_courtyard": "error",
|
||||
"microvia_drill_out_of_range": "error",
|
||||
"mirrored_text_on_front_layer": "warning",
|
||||
"missing_courtyard": "ignore",
|
||||
"missing_footprint": "warning",
|
||||
"missing_tuning_profile": "warning",
|
||||
"net_conflict": "warning",
|
||||
"nonmirrored_text_on_back_layer": "warning",
|
||||
"npth_inside_courtyard": "ignore",
|
||||
"padstack": "warning",
|
||||
"pth_inside_courtyard": "ignore",
|
||||
"shorting_items": "error",
|
||||
"silk_edge_clearance": "warning",
|
||||
"silk_over_copper": "warning",
|
||||
"silk_overlap": "warning",
|
||||
"skew_out_of_range": "error",
|
||||
"solder_mask_bridge": "error",
|
||||
"starved_thermal": "error",
|
||||
"text_height": "warning",
|
||||
"text_on_edge_cuts": "error",
|
||||
"text_thickness": "warning",
|
||||
"through_hole_pad_without_hole": "error",
|
||||
"too_many_vias": "error",
|
||||
"track_angle": "error",
|
||||
"track_dangling": "warning",
|
||||
"track_not_centered_on_via": "ignore",
|
||||
"track_on_post_machined_layer": "error",
|
||||
"track_segment_length": "error",
|
||||
"track_width": "error",
|
||||
"tracks_crossing": "error",
|
||||
"tuning_profile_track_geometries": "ignore",
|
||||
"unconnected_items": "error",
|
||||
"unresolved_variable": "error",
|
||||
"via_dangling": "warning",
|
||||
"zones_intersect": "error"
|
||||
},
|
||||
"rules": {
|
||||
"max_error": 0.005,
|
||||
"min_clearance": 0.15,
|
||||
"min_connection": 0.0,
|
||||
"min_copper_edge_clearance": 0.3,
|
||||
"min_groove_width": 0.0,
|
||||
"min_hole_clearance": 0.25,
|
||||
"min_hole_to_hole": 0.25,
|
||||
"min_microvia_diameter": 0.2,
|
||||
"min_microvia_drill": 0.1,
|
||||
"min_resolved_spokes": 2,
|
||||
"min_silk_clearance": 0.0,
|
||||
"min_text_height": 0.8,
|
||||
"min_text_thickness": 0.08,
|
||||
"min_through_hole_diameter": 0.25,
|
||||
"min_track_width": 0.15,
|
||||
"min_via_annular_width": 0.1,
|
||||
"min_via_diameter": 0.45,
|
||||
"solder_mask_to_copper_clearance": 0.0,
|
||||
"use_height_for_length_calcs": true
|
||||
},
|
||||
"teardrop_options": [
|
||||
{
|
||||
"td_onpthpad": true,
|
||||
"td_onroundshapesonly": false,
|
||||
"td_onsmdpad": true,
|
||||
"td_ontrackend": false,
|
||||
"td_onvia": true
|
||||
}
|
||||
],
|
||||
"teardrop_parameters": [
|
||||
{
|
||||
"td_allow_use_two_tracks": true,
|
||||
"td_curve_segcount": 1,
|
||||
"td_enabled": false,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_on_pad_in_zone": false,
|
||||
"td_target_name": "td_round_shape",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
},
|
||||
{
|
||||
"td_allow_use_two_tracks": true,
|
||||
"td_curve_segcount": 1,
|
||||
"td_enabled": false,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_on_pad_in_zone": false,
|
||||
"td_target_name": "td_rect_shape",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
},
|
||||
{
|
||||
"td_allow_use_two_tracks": true,
|
||||
"td_curve_segcount": 1,
|
||||
"td_enabled": false,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_on_pad_in_zone": false,
|
||||
"td_target_name": "td_track_end",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
}
|
||||
],
|
||||
"track_widths": [],
|
||||
"tuning_pattern_settings": {
|
||||
"diff_pair_defaults": {
|
||||
"corner_radius_percentage": 80,
|
||||
"corner_style": 1,
|
||||
"max_amplitude": 1.0,
|
||||
"min_amplitude": 0.2,
|
||||
"single_sided": false,
|
||||
"spacing": 1.0
|
||||
},
|
||||
"diff_pair_skew_defaults": {
|
||||
"corner_radius_percentage": 80,
|
||||
"corner_style": 1,
|
||||
"max_amplitude": 1.0,
|
||||
"min_amplitude": 0.2,
|
||||
"single_sided": false,
|
||||
"spacing": 0.6
|
||||
},
|
||||
"single_track_defaults": {
|
||||
"corner_radius_percentage": 80,
|
||||
"corner_style": 1,
|
||||
"max_amplitude": 1.0,
|
||||
"min_amplitude": 0.2,
|
||||
"single_sided": false,
|
||||
"spacing": 0.6
|
||||
}
|
||||
},
|
||||
"via_dimensions": [],
|
||||
"zones_allow_external_fillets": false
|
||||
},
|
||||
"ipc2581": {
|
||||
"bom_rev": "",
|
||||
"dist": "",
|
||||
"distpn": "",
|
||||
"internal_id": "",
|
||||
"mfg": "",
|
||||
"mpn": "",
|
||||
"sch_revision": ""
|
||||
},
|
||||
"layer_pairs": [],
|
||||
"layer_presets": [],
|
||||
"viewports": []
|
||||
},
|
||||
"boards": [],
|
||||
"component_class_settings": {
|
||||
"assignments": [],
|
||||
"meta": {
|
||||
"version": 0
|
||||
},
|
||||
"sheet_component_classes": {
|
||||
"enabled": false
|
||||
}
|
||||
},
|
||||
"cvpcb": {
|
||||
"equivalence_files": []
|
||||
},
|
||||
"libraries": {
|
||||
"pinned_footprint_libs": [],
|
||||
"pinned_symbol_libs": []
|
||||
},
|
||||
"meta": {
|
||||
"filename": "visormesh.kicad_pro",
|
||||
"version": 3
|
||||
},
|
||||
"net_settings": {
|
||||
"classes": [
|
||||
{
|
||||
"bus_width": 12,
|
||||
"clearance": 0.15,
|
||||
"diff_pair_gap": 0.25,
|
||||
"diff_pair_via_gap": 0.25,
|
||||
"diff_pair_width": 0.2,
|
||||
"line_style": 0,
|
||||
"microvia_diameter": 0.3,
|
||||
"microvia_drill": 0.1,
|
||||
"name": "Default",
|
||||
"pcb_color": "rgba(0, 0, 0, 0.000)",
|
||||
"priority": 2147483647,
|
||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||
"track_width": 0.15,
|
||||
"tuning_profile": "",
|
||||
"via_diameter": 0.5,
|
||||
"via_drill": 0.25,
|
||||
"wire_width": 6
|
||||
},
|
||||
{
|
||||
"bus_width": 12,
|
||||
"clearance": 0.15,
|
||||
"diff_pair_gap": 0.25,
|
||||
"diff_pair_via_gap": 0.25,
|
||||
"diff_pair_width": 0.2,
|
||||
"line_style": 0,
|
||||
"microvia_diameter": 0.3,
|
||||
"microvia_drill": 0.1,
|
||||
"name": "Power",
|
||||
"pcb_color": "rgba(0, 0, 0, 0.000)",
|
||||
"priority": 0,
|
||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||
"track_width": 0.3,
|
||||
"tuning_profile": "",
|
||||
"via_diameter": 0.6,
|
||||
"via_drill": 0.3,
|
||||
"wire_width": 6
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"version": 5
|
||||
},
|
||||
"net_colors": {},
|
||||
"netclass_assignments": {},
|
||||
"netclass_patterns": [
|
||||
{
|
||||
"netclass": "Power",
|
||||
"pattern": "GND"
|
||||
},
|
||||
{
|
||||
"netclass": "Power",
|
||||
"pattern": "VSB"
|
||||
},
|
||||
{
|
||||
"netclass": "Power",
|
||||
"pattern": "3V3X"
|
||||
},
|
||||
{
|
||||
"netclass": "Power",
|
||||
"pattern": "VDOCK"
|
||||
},
|
||||
{
|
||||
"netclass": "Power",
|
||||
"pattern": "VDOCK_D"
|
||||
},
|
||||
{
|
||||
"netclass": "Power",
|
||||
"pattern": "XIAO_VBUS"
|
||||
},
|
||||
{
|
||||
"netclass": "Power",
|
||||
"pattern": "VBAT"
|
||||
}
|
||||
]
|
||||
},
|
||||
"pcbnew": {
|
||||
"last_paths": {
|
||||
"gencad": "",
|
||||
"idf": "",
|
||||
"netlist": "",
|
||||
"plot": "",
|
||||
"specctra_dsn": "",
|
||||
"step": "",
|
||||
"vrml": ""
|
||||
},
|
||||
"page_layout_descr_file": ""
|
||||
},
|
||||
"schematic": {
|
||||
"bus_aliases": {},
|
||||
"legacy_lib_dir": "",
|
||||
"legacy_lib_list": [],
|
||||
"top_level_sheets": [
|
||||
{
|
||||
"filename": "visormesh.kicad_sch",
|
||||
"name": "visormesh",
|
||||
"uuid": "00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sheets": [],
|
||||
"text_variables": {},
|
||||
"tuning_profiles": {
|
||||
"meta": {
|
||||
"version": 0
|
||||
},
|
||||
"tuning_profiles_impedance_geometric": []
|
||||
}
|
||||
}
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
# Rev 2 pipeline: place -> project -> autoroute -> import -> pour -> DRC -> verify.
|
||||
# Needs KiCad 10 (its Python and kicad-cli), Java 21+ and freerouting.jar.
|
||||
# KICAD_APP default: the Homebrew cask's KiCad.app
|
||||
# FREEROUTING path to freerouting.jar (v1.9.0; 2.x ignores the pass limit)
|
||||
# JAVA default: Homebrew openjdk@21
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
KICAD_APP=${KICAD_APP:-/opt/homebrew/Caskroom/kicad/10.0.8/KiCad/KiCad.app}
|
||||
PY=$(ls -d "$KICAD_APP"/Contents/Frameworks/Python.framework/Versions/3*/bin/python3 | head -1)
|
||||
CLI="$KICAD_APP/Contents/MacOS/kicad-cli"
|
||||
JAVA=${JAVA:-/opt/homebrew/opt/openjdk@21/bin/java}
|
||||
: "${FREEROUTING:?set FREEROUTING to freerouting.jar}"
|
||||
OUT=${OUT:-kicad}
|
||||
mkdir -p "$OUT"
|
||||
PCB="$OUT/visormesh.kicad_pcb"
|
||||
"$PY" set_project.py "$OUT/visormesh.kicad_pro"
|
||||
"$PY" build_board.py "$PCB"
|
||||
cp "$PCB" "$OUT/visormesh_unrouted.kicad_pcb"
|
||||
"$PY" -c "import pcbnew,sys; b=pcbnew.LoadBoard('$PCB'); pcbnew.ExportSpecctraDSN(b,'$OUT/visormesh.dsn')"
|
||||
# -oit 1: stop optimising below 1 % improvement (the optimiser can otherwise run for ever).
|
||||
# Watchdog: give up after 5 minutes rather than hang.
|
||||
rm -f "$OUT/visormesh.ses"
|
||||
"$JAVA" -jar "$FREEROUTING" -de "$OUT/visormesh.dsn" -do "$OUT/visormesh.ses" -mp ${PASSES:-100} -oit 1 \
|
||||
>"$OUT/freerouting.log" 2>&1 &
|
||||
FR=$!
|
||||
for _ in $(seq 300); do kill -0 $FR 2>/dev/null || break; sleep 1; done
|
||||
if kill -0 $FR 2>/dev/null; then kill $FR; echo "freerouting timed out" >&2; exit 1; fi
|
||||
[ -s "$OUT/visormesh.ses" ] || { echo "freerouting wrote no session" >&2; exit 1; }
|
||||
"$PY" finish_board.py "$PCB" "$OUT/visormesh.ses"
|
||||
"$CLI" pcb drc --format report -o "$OUT/drc.rpt" "$PCB" | tail -1
|
||||
grep -E "^\[" "$OUT/drc.rpt" | sort | uniq -c | sort -rn
|
||||
"$PY" verify.py "$PCB"
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build rev 2's JLCPCB package: gerbers+drill zip (4 layers), BOM and CPL in JLC format.
|
||||
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
|
||||
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
OUT = sys.argv[1]
|
||||
PCB = os.path.join(HERE, "kicad", "visormesh.kicad_pcb")
|
||||
CLI = sys.argv[2] if len(sys.argv) > 2 else "/opt/homebrew/Caskroom/kicad/10.0.8/KiCad/KiCad.app/Contents/MacOS/kicad-cli"
|
||||
G = os.path.join(OUT, "gerbers")
|
||||
shutil.rmtree(G, ignore_errors=True); os.makedirs(G)
|
||||
|
||||
layers = "F.Cu,In1.Cu,In2.Cu,B.Cu,F.Paste,B.Paste,F.SilkS,B.SilkS,F.Mask,B.Mask,Edge.Cuts"
|
||||
subprocess.run([CLI, "pcb", "export", "gerbers", "-l", layers, "--subtract-soldermask",
|
||||
"--no-x2", "-o", G + "/", PCB], check=True, capture_output=True)
|
||||
subprocess.run([CLI, "pcb", "export", "drill", "--format", "excellon", "--excellon-units", "mm",
|
||||
"--excellon-zeros-format", "decimal", "--generate-map", "--map-format", "gerberx2",
|
||||
"-o", G + "/", PCB], check=True, capture_output=True)
|
||||
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)
|
||||
|
||||
# Placement
|
||||
pos = os.path.join(OUT, "pos_raw.csv")
|
||||
subprocess.run([CLI, "pcb", "export", "pos", "--format", "csv", "--units", "mm", "--side", "both",
|
||||
"--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"]])
|
||||
os.remove(pos)
|
||||
|
||||
# BOM grouped by value+footprint+LCSC
|
||||
groups = {}
|
||||
for ref, (val, lib, name, lcsc, desc, dnp) in PARTS.items():
|
||||
if ref in assembled:
|
||||
groups.setdefault((val, name, lcsc), []).append(ref)
|
||||
def refkey(r):
|
||||
import re
|
||||
m = re.match(r"([A-Z]+)(\d+)", r); return (m.group(1), int(m.group(2)))
|
||||
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])
|
||||
# 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"])
|
||||
for ref, (val, lib, name, lcsc, desc, dnp) in PARTS.items():
|
||||
if ref not in assembled:
|
||||
w.writerow([ref, val, desc])
|
||||
print("ok", sorted(os.listdir(G)))
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
VisorMesh Springboard module, rev 2: parts and connectivity. Draft: not laid out or built.
|
||||
VisorMesh Springboard module, rev 2: parts and connectivity. Laid out (build_board.py), not built; J1 is a placeholder.
|
||||
Same shape as ../source/netlist.py (rev 1, hw-v0.1), so its board and schematic scripts can be adapted.
|
||||
See ../REV2.md for the reasons behind each choice.
|
||||
|
||||
@@ -24,11 +24,11 @@ Pin tables that still need checking against a datasheet are marked VERIFY.
|
||||
# ref: (value, footprint_lib, footprint_name, lcsc, description, dnp)
|
||||
# An empty LCSC number is still to be looked up.
|
||||
PARTS = {
|
||||
"J1": ("Springboard 68p straddle", None, "SPRINGBOARD_68", "",
|
||||
"Hirose IC1HA-68RD-1.27SH(51); pending the order (REV2.md). Hand-solder", True),
|
||||
"J1": ("Springboard 68p SMT", None, "SPRINGBOARD_68_SMT", "",
|
||||
"Single-sided SMT PC Card receptacle, card side; part not chosen, land pattern is a placeholder (REV2.md). Hand-solder", True),
|
||||
"U1": ("S29AL016J70TFI020", "Package_SO", "TSOP-I-48_18.4x12mm_P0.5mm", "C914935",
|
||||
"2 MB NOR flash, x16, 70 ns, csSlot0", False),
|
||||
"U2": ("SC16C650BIBS", "Package_DFN_QFN", "HVQFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm", "C729132",
|
||||
"U2": ("SC16C650BIBS", "Package_DFN_QFN", "HVQFN-32-1EP_5x5mm_P0.5mm_EP3.1x3.1mm", "C729132",
|
||||
"UART, 32-byte FIFOs, csSlot1 (SC16C750BIBS fits the same footprint)", False),
|
||||
"U3": ("SN74LVC2G32DCUR", "Package_SO", "VSSOP-8_2.3x2mm_P0.5mm", "C91874", "OR: UART read/write strobes", False),
|
||||
"U4": ("SN74LVC2G04DCKR", "Package_TO_SOT_SMD", "SOT-363_SC-70-6", "C105251", "Inverters: INT -> IRQ*, RESET* -> RESET", False),
|
||||
@@ -119,11 +119,11 @@ c("JP2", 1, "WE_N"); c("JP2", 2, "WE_FL_N")
|
||||
c("R4", 1, "VSB"); c("R4", 2, "WE_FL_N")
|
||||
|
||||
# U2 SC16C650B HVQFN32 (NXP datasheet table 2; the SC16C750B matches, the SC16C550B does not).
|
||||
# CS, IOR, IOW are the active-low inputs in this package. The exposed pad is ground.
|
||||
# CS, IOR, IOW are the active-low inputs in this package. The exposed pad (33 in KiCad's SOT617-1 footprint) is ground.
|
||||
for pad, net in {1: "D5", 2: "D6", 3: "D7", 4: "UART_BAUD", 5: "UART_RX", 6: "UART_TX", 7: "GND",
|
||||
8: "UART_BAUD", 9: "XTAL1", 10: "XTAL2", 11: "UART_IOW_N", 13: "GND", 14: "UART_IOR_N",
|
||||
16: "A3", 17: "A2", 18: "A1", 20: "UART_INT", 24: "UART_RESET", 25: "GND", 26: "GND",
|
||||
27: "VSB", 28: "D0", 29: "D1", 30: "D2", 31: "D3", 32: "D4", "EP": "GND"}.items():
|
||||
27: "VSB", 28: "D0", 29: "D1", 30: "D2", 31: "D3", 32: "D4", 33: "GND"}.items():
|
||||
c("U2", pad, net) # 4 RCLK = 8 BAUDOUT; 25 CTS / 26 DSR held asserted; 12 n.c.; 15, 19, 21-23 outputs unused
|
||||
# Y1 3225 4-pad: 1/3 crystal, 2/4 case
|
||||
c("Y1", 1, "XTAL1"); c("Y1", 3, "XTAL2"); c("Y1", 2, "GND"); c("Y1", 4, "GND")
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 75 KiB |
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Write rev 2's KiCad project file: net classes and design rules (KiCad keeps them in .kicad_pro).
|
||||
Based on rev 1's project file. Rules are within JLCPCB's 4-layer standard capabilities."""
|
||||
import json, os, sys
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
out = sys.argv[1]
|
||||
p = json.load(open(os.path.join(HERE, "..", "kicad", "visormesh.kicad_pro")))
|
||||
p["meta"]["filename"] = os.path.basename(out)
|
||||
ns = p["net_settings"]
|
||||
ns["netclass_patterns"] = [{"netclass": "Power", "pattern": n}
|
||||
for n in ("GND", "VSB", "3V3X", "VDOCK", "VDOCK_D", "XIAO_VBUS", "VBAT")]
|
||||
for c in ns["classes"]:
|
||||
if c["name"] == "Default":
|
||||
c.update({"track_width": 0.15, "clearance": 0.15, "via_diameter": 0.5, "via_drill": 0.25})
|
||||
if c["name"] == "Power":
|
||||
c.update({"track_width": 0.3, "clearance": 0.15, "via_diameter": 0.6, "via_drill": 0.3})
|
||||
r = p["board"]["design_settings"]["rules"]
|
||||
r.update({"min_clearance": 0.15, "min_track_width": 0.15, "min_via_diameter": 0.45,
|
||||
"min_through_hole_diameter": 0.25, "min_hole_clearance": 0.25, "min_copper_edge_clearance": 0.3,
|
||||
"min_text_height": 0.8})
|
||||
json.dump(p, open(out, "w"), indent=2)
|
||||
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Independent cross-checks of the routed rev 2 board against the netlist and the source documents."""
|
||||
import sys, os, collections
|
||||
import pcbnew
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, HERE)
|
||||
from netlist import CONN, SB_NAMES
|
||||
|
||||
fail = []
|
||||
def check(cond, msg):
|
||||
print(("PASS " if cond else "FAIL ") + msg)
|
||||
if not cond: fail.append(msg)
|
||||
|
||||
b = pcbnew.LoadBoard(sys.argv[1] if len(sys.argv) > 1 else os.path.join(HERE, "kicad", "visormesh.kicad_pcb"))
|
||||
pad_net = {}
|
||||
for fp in b.GetFootprints():
|
||||
for p in fp.Pads():
|
||||
if p.GetNumber():
|
||||
pad_net[(fp.GetReference(), p.GetNumber())] = p.GetNetname()
|
||||
|
||||
# 1. every pad's net equals the netlist (unlisted pads unconnected)
|
||||
bad = [(k, pad_net[k], CONN.get(k, "")) for k in pad_net if pad_net[k] != CONN.get(k, "")]
|
||||
check(not bad, f"board pad nets match netlist.py ({len(pad_net)} pads) {bad[:5]}")
|
||||
|
||||
# 2. Springboard pins vs Development Guide Table 5-1 names
|
||||
def want(name):
|
||||
if name in ("GND", "CD1*", "CD2*"): return "GND"
|
||||
if name == "VCC": return "VSB"
|
||||
if name == "VDOCK": return "VDOCK"
|
||||
if name in ("CS0*", "CS1*", "OE*", "WE*", "IRQ*", "RESET*"): return name[:-1] + "_N"
|
||||
if name[0] == "D" and name[1:].isdigit(): return name
|
||||
if name[0] == "A" and name[1:].isdigit() and 1 <= int(name[1:]) <= 20: return name
|
||||
return ""
|
||||
jbad = [(p, SB_NAMES[p], pad_net[("J1", str(p))]) for p in range(1, 69) if pad_net[("J1", str(p))] != want(SB_NAMES[p])]
|
||||
check(not jbad, f"J1 pins 1-68 agree with Table 5-1 {jbad[:4]}")
|
||||
|
||||
# 3. flash in word mode on the slot bus: flash A0 = slot A1, all 16 data lines, CS0*
|
||||
check(pad_net[("U1", "25")] == "A1" and pad_net[("U1", "9")] == "A20" and pad_net[("U1", "26")] == "CS0_N"
|
||||
and pad_net[("U1", "47")] == "VSB" and pad_net[("U1", "28")] == "OE_N",
|
||||
"U1: A0=slot A1, A19=slot A20, CE#=CS0*, OE#=OE*, BYTE#=VCC (word mode)")
|
||||
check(sorted(n for (r, p), n in pad_net.items() if r == "U1" and n.startswith("D")) == sorted("D%d" % i for i in range(16)),
|
||||
"U1: DQ0-DQ15 on slot D0-D15")
|
||||
# 4. UART on CS1* through the OR strobes, register select from A1-A3
|
||||
check(pad_net[("U3", "2")] == "CS1_N" and pad_net[("U3", "6")] == "CS1_N" and pad_net[("U3", "1")] == "OE_N"
|
||||
and pad_net[("U3", "5")] == "WE_N" and pad_net[("U2", "14")] == "UART_IOR_N" and pad_net[("U2", "11")] == "UART_IOW_N",
|
||||
"U2 IOR = OE* OR CS1*, IOW = WE* OR CS1*")
|
||||
check([pad_net[("U2", p)] for p in ("18", "17", "16")] == ["A1", "A2", "A3"], "U2 A0-A2 = slot A1-A3")
|
||||
check(pad_net[("U4", "1")] == "UART_INT" and pad_net[("U4", "6")] == "IRQ_N" and pad_net[("U4", "3")] == "RESET_N"
|
||||
and pad_net[("U4", "4")] == "UART_RESET", "U4 inverts INT -> IRQ* and RESET* -> RESET")
|
||||
|
||||
# 5. power domains meet only in the Ioff translators (and the radio boards on the 3V3X side)
|
||||
vsb_side = {"VSB", "UART_TX", "UART_RX"}
|
||||
x_side = {"3V3X", "XIAO_RX", "XIAO_TX", "VISOR_PRESENT"}
|
||||
cross = collections.defaultdict(set)
|
||||
for (r, p), n in pad_net.items():
|
||||
if n in vsb_side: cross[r].add("VSB")
|
||||
if n in x_side: cross[r].add("3V3X")
|
||||
both = sorted(r for r, s in cross.items() if len(s) == 2)
|
||||
check(both == ["U5", "U6"], f"only the translators straddle both power domains: {both}")
|
||||
check(pad_net[("X1", "7")] == "XIAO_TX" and pad_net[("X1", "8")] == "XIAO_RX" and pad_net[("X1", "1")] == "VISOR_PRESENT",
|
||||
"XIAO D6=TX, D7=RX, D0=present (companion firmware patch)")
|
||||
check(not any(pad_net.get(("X2", k)) for k in ("1", "7", "8", "14")), "Wio D0, D6, D7, 5V unconnected")
|
||||
|
||||
# 6. routing complete and outline
|
||||
tr = [t for t in b.GetTracks() if t.Type() == pcbnew.PCB_TRACE_T]
|
||||
check(len(tr) > 0, f"board is routed ({len(tr)} segments)")
|
||||
bb = b.GetBoardEdgesBoundingBox()
|
||||
w, h = pcbnew.ToMM(bb.GetWidth()) - 0.1, pcbnew.ToMM(bb.GetHeight()) - 0.1
|
||||
check(abs(w - 50.43) < 0.05, f"board width {w:.2f} mm = springSD width 50.43 mm")
|
||||
print(f"INFO board {w:.2f} x {h:.2f} mm, {b.GetCopperLayerCount()} layers, "
|
||||
f"thickness {pcbnew.ToMM(b.GetDesignSettings().GetBoardThickness())} mm")
|
||||
print("RESULT", "ALL PASS" if not fail else f"{len(fail)} FAIL")
|
||||
sys.exit(1 if fail else 0)
|
||||
Reference in new issue
Block a user