Compare commits

...
14 Commits
Author SHA1 Message Date
rich 7764fe94e4 docs: progress: rev 2 draft case (not printed) and the measurements and fit check it waits on 2026-11-19 23:15:24 -05:00
rich 26a8387a6e hardware: SB-LoRa rev 2 draft case: a two-part OpenSCAD shell for FDM, the in-slot part from nkorth's CC0 Springboard slot cover, a bump for the radio boards, LiPo and an FPC antenna, split at the board's top face with two M2 screws; the connector height, J1 body and radio/LiPo heights are parameters to measure 2026-11-19 23:09:41 -05:00
rich 1e32aea88c docs: progress: rev 2 J1 laid out as a straddle with estimated row position, pad size and thickness; measuring the parts is next 2026-11-19 23:01:54 -05:00
rich 1d43beeabf hardware: SB-LoRa rev 2 J1 as a straddle for the MCS-068SMA1: pins 1-34 on F.Cu, 35-68 on B.Cu directly opposite at 1.27 mm (rev 1's split); row position, pad size and board thickness are estimates until a part is measured. Rerouted: DRC 0 unconnected, verify.py checks the straddle and passes; renders regenerated 2026-11-19 22:58:16 -05:00
rich f5653d9d2c docs: SB-LoRa rev 2: show the top and bottom renders in REV2.md, noting they still have the placeholder J1 2026-11-19 22:50:06 -05:00
rich 7b4e23ad64 docs: progress: SB-LoRa rev 2 milestones (planned, laid out, J1 chosen and ordered), the cancelled rev 1 J1, the release workflow, and the J1 supply and board-thickness questions 2026-11-19 22:43:43 -05:00
rich fdacc2daa8 docs: SB-LoRa rev 2 connector: the MCS-068SMA1 straddle parts are ordered (2026-11-19) and J1 is designed around them; no stock of the single-row MCS-068SSA1 turned up 2026-11-19 22:41:33 -05:00
rich f41ddf43bd docs: SB-LoRa rev 2 connector: the MCS-068SMA1 is Robinson Nugent's MEMPAK straddle receptacle (.050" pitch, no tail offset) per the catalogue overview page; the row gap still needs a sample, and the single-row MCS-068SSA1 is noted as a single-sided alternative 2026-11-19 22:39:23 -05:00
rich ef1d245c73 docs: SB-LoRa rev 2 connector: 3M MCS-068SMA1-TR30 (female straddle receptacle, eBay surplus, rows not staggered) replaces the AliExpress part as the J1 candidate, which is dropped for $39 shipping and a 2+ week wait; the J1 pattern becomes opposed F.Cu/B.Cu rows and the board thickness follows the connector's row gap 2026-11-19 22:30:01 -05:00
rich fff912fb4d docs: SB-LoRa rev 2 connector: the J1 listing photo shows an AMP-marked part with no part number but it's sold as Jiansu BST, so the land pattern comes from the parts that arrive and they're bought in one lot 2026-11-19 22:19:53 -05:00
rich e71f979dce docs: SB-LoRa rev 2 connector: the AliExpress 68-pin female PCMCIA part is the J1 candidate (female side, both rows of tails flat on top per the listing photos); its land pattern waits on a measured sample, and the Hirose IC1K listing looks like a host-side socket 2026-11-19 22:18:32 -05:00
rich 0e37755b66 docs: SB-LoRa rev 2 connector: drop the unconfirmed Amphenol 1C1K candidate and list the parts ruled out (out of production, host-side, or a SIM tray), so J1 has no stocked candidate yet 2026-11-19 22:10:04 -05:00
rich ecd9900ec1 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 2026-11-17 20:35:15 -05:00
rich 6d4cadadbc docs: SB-LoRa temporary connector options for rev 1 now the Hirose IC1HA order is cancelled (harvested straddle, donor connector on wires, top-mounted SMT receptacle, PCMCIA card part), with the 17 pins rev 1 uses; rev 2 drops the straddle footprint 2026-11-17 19:20:57 -05:00
20 changed files with 64412 additions and 15 deletions

No files matched your search

+20 -1
View File
@@ -8,12 +8,25 @@
- [x] Order PCBs + assembly from JLCPCB (5 boards, 2-layer, 1.6 mm, leaded HASL); tagged `hw-v0.1` - [x] Order PCBs + assembly from JLCPCB (5 boards, 2-layer, 1.6 mm, leaded HASL); tagged `hw-v0.1`
- [ ] Boards received - [ ] Boards received
- [x] Order J1: Hirose IC1HA-68RD-1.27SH(51) is obsolete; 1 ordered as new-old stock from eBay ($24) - [x] Order J1: Hirose IC1HA-68RD-1.27SH(51) is obsolete; 1 ordered as new-old stock from eBay ($24)
- [ ] J1 order cancelled 2026-11-17; rev 1 gets a harvested or wired-on connector instead (README.md, "Without the Hirose part")
- [ ] Order 2x 1x7 female headers - [ ] Order 2x 1x7 female headers
- [ ] Buy 2–3 cheap used Springboard modules (spare connectors to harvest + slot-fit reference) - [ ] Buy 2–3 cheap used Springboard modules (spare connectors to harvest + slot-fit reference)
- [ ] Bare board: continuity check, dry-fit in Visor slot - [ ] Bare board: continuity check, dry-fit in Visor slot
- [ ] Fit J1, bench-power VSB at 3.3 V, check current and 14.7456 MHz on Y1 - [ ] Fit J1, bench-power VSB at 3.3 V, check current and 14.7456 MHz on Y1
- [ ] In Visor: read/write SC16IS740 scratch register (SPR, 0x07) from Palm side - [ ] In Visor: read/write SC16IS740 scratch register (SPR, 0x07) from Palm side
### Hardware: SB-LoRa rev 2
- [x] Plan (hardware/sb-lora/REV2.md): S29AL016J flash on CS0 so the app loads on insertion, SC16C650B UART on CS1 in place of the SC16IS740, XIAO and Wio side by side, LiPo pads
- [x] Netlist, footprints and LCSC numbers; 4-layer layout routed, DRC 0 unconnected, verify.py passes
- [x] Choose J1: Robinson Nugent / 3M MCS-068SMA1-TR30, female straddle receptacle; ordered from eBay 2026-11-19
- [x] J1 laid out as a straddle (pins 1-34 on F.Cu, 35-68 on B.Cu opposite, 1.27 mm); rerouted, DRC 0 unconnected, verify.py passes; row position, pad size and thickness estimated
- [ ] Measure J1 (row gap, tail positions, pad size, body), set `J1_ROW`, `J1_PAD` and `BOARD_T` in build_board.py, rebuild
- [ ] Check the XIAO and Wio footprints against the boards at 1:1; check rotations in JLC's preview
- [ ] Order; tag `hw-v0.2`
- [x] Draft case (hardware/sb-lora/rev2/case/): two-part OpenSCAD shell for FDM, in-slot part from nkorth's CC0 slot cover, bump for the radio boards, LiPo and an FPC antenna; not printed
- [ ] Print nkorth's blank and check it fits the slot
- [ ] Measure the connector's contact height in the slot, J1's body, and the radio and LiPo heights; set them in sb_lora_case.scad and print the case
### Firmware ### Firmware
- [x] Apply `firmware/meshcore-xiao-nrf52-uart-companion.patch` to MeshCore, build `Xiao_nrf52_companion_radio_uart` (`firmware/Makefile`, MeshCore a366955c, GCC 14 on Apple Silicon) - [x] Apply `firmware/meshcore-xiao-nrf52-uart-companion.patch` to MeshCore, build `Xiao_nrf52_companion_radio_uart` (`firmware/Makefile`, MeshCore a366955c, GCC 14 on Apple Silicon)
- [x] Flashed to the XIAO; answers `CMD_DEVICE_QUERY` over USB with DEVICE_INFO (v1.17.1) - [x] Flashed to the XIAO; answers `CMD_DEVICE_QUERY` over USB with DEVICE_INFO (v1.17.1)
@@ -47,7 +60,8 @@
- Which CF adapter is it, and does its ROM include an app installer? - Which CF adapter is it, and does its ROM include an app installer?
- Is the J1 footprint correct against the Hirose drawing? (Only checked against springSD.) - Is the J1 footprint correct against the Hirose drawing? (Only checked against springSD.)
- Which Handspring offset variant (−0.3 / 0 / +0.3 / +0.6 mm) is the (51)? This matters if a harvested connector replaces it. - Which Handspring offset variant (−0.3 / 0 / +0.3 / +0.6 mm) is the (51)? This matters if a harvested connector replaces it.
- Long-term J1 supply: no current-production part known. Could a PCMCIA card-side straddle receptacle work? (The keying fit is untested.) - Long-term J1 supply: no current-production card-side part found (Amphenol, Hirose, TE and Assmann parts are obsolete or host-side). Rev 2 uses eBay surplus MCS-068SMA1, so buy enough for every board. Does a PCMCIA card-side straddle receptacle seat fully in the Springboard slot? (The keying is in the case; untested.)
- What board thickness does the MCS-068SMA1's row gap take?
- Does the extension clear the Visor body? Is the slot-opening alignment right? - Does the extension clear the Visor body? Is the slot-opening alignment right?
## Log ## Log
@@ -117,3 +131,8 @@
- 2026-11-08: Verified on the Neo: Trace's result line fits ("Back in 1.2 s, N hops"); the command retry (with the bridge stopped a command goes offline after a few seconds, and after a reconnect everything works as before); the SB-LoRa Test with the slot empty says to insert the module and doesn't touch the bus (no reset); Add Contact's three-line note fits. The SB-LoRa Test's bus steps (mapping, registers, loopback, interrupt, radio) are untested until the board arrives. - 2026-11-08: Verified on the Neo: Trace's result line fits ("Back in 1.2 s, N hops"); the command retry (with the bridge stopped a command goes offline after a few seconds, and after a reconnect everything works as before); the SB-LoRa Test with the slot empty says to insert the module and doesn't touch the bus (no reset); Add Contact's three-line note fits. The SB-LoRa Test's bus steps (mapping, registers, loopback, interrupt, radio) are untested until the board arrives.
- 2026-11-08: Slot link restored at launch only while the OS reports a module. Verified on the Neo with the slot empty: Connect on Slot says "No module in the slot", and a relaunch doesn't reset the Visor and comes back on USB. Also new, untested until the board arrives: the radio's "message waiting" push wakes the Visor on the Slot link (open app: sync and sound, screen off; closed app with Check when closed on: a copy of the handler left in system-owned memory starts the closed-app check at once), checked on the host with the simulated module; and hardware/sb-lora/BRINGUP.md, the step-by-step bring-up plan. Segments: 20.1 / 23.7 / 22.4 / 25.6 / 24.1 KB. - 2026-11-08: Slot link restored at launch only while the OS reports a module. Verified on the Neo with the slot empty: Connect on Slot says "No module in the slot", and a relaunch doesn't reset the Visor and comes back on USB. Also new, untested until the board arrives: the radio's "message waiting" push wakes the Visor on the Slot link (open app: sync and sound, screen off; closed app with Check when closed on: a copy of the handler left in system-owned memory starts the closed-app check at once), checked on the host with the simulated module; and hardware/sb-lora/BRINGUP.md, the step-by-step bring-up plan. Segments: 20.1 / 23.7 / 22.4 / 25.6 / 24.1 KB.
- 2026-11-08: Verified on the Neo: the three overlaps check_ui.py's new overlap rule found are fixed (Node "Version:", Preferences' Check when closed popup, Flood Scopes' default), and Add Channel's New Key gives a private channel a random key from the entropy pool (pen and key timing, the radio's packet readings; kept between launches in an unsaved preference). Adding a channel with it is untested (it writes to the radio). Also new, host-only: the request retry rules in request.c with tests/test_request.c and check_source.py's try-once rule, and make replay over the bridge's full-frame capture. Segments: 20.8 / 23.7 / 22.4 / 26.0 / 24.8 KB. - 2026-11-08: Verified on the Neo: the three overlaps check_ui.py's new overlap rule found are fixed (Node "Version:", Preferences' Check when closed popup, Flood Scopes' default), and Add Channel's New Key gives a private channel a random key from the entropy pool (pen and key timing, the radio's packet readings; kept between launches in an unsaved preference). Adding a channel with it is untested (it writes to the radio). Also new, host-only: the request retry rules in request.c with tests/test_request.c and check_source.py's try-once rule, and make replay over the bridge's full-frame capture. Segments: 20.8 / 23.7 / 22.4 / 26.0 / 24.8 KB.
- 2026-11-09: SB-LoRa rev 2 planned in hardware/sb-lora/REV2.md: a flash on CS0 so the app loads when the module goes in (the installer copies it to RAM, since the transport's interrupt handler can't live on a removable module), a 16550-style UART on CS1 in place of the SC16IS740 SPI bridge, and the XIAO and Wio side by side to make the module flat. Netlist, footprints and LCSC numbers done.
- 2026-11-11: Release workflow: a v* tag builds and tests the app and publishes visormesh-<tag>.prc with SHA256SUMS. The toolchain install is shared with the Dockerfile (tools/install_toolchain.sh).
- 2026-11-17: The Hirose IC1HA order for rev 1's J1 was cancelled. README.md lists the stopgaps for rev 1 (harvested straddle part, donor connector on wires). Rev 2 laid out: 4 layers, routed with Freerouting 1.9.0, DRC 0 unconnected, verify.py passes; J1 left as a placeholder.
- 2026-11-19: Rev 2 J1 chosen: Robinson Nugent / 3M MCS-068SMA1-TR30, a female MEMPAK straddle receptacle at 1.27 mm with the rows directly opposite each other, ordered as eBay surplus. Ruled out as obsolete, host-side or the wrong part: Amphenol 10014744-007T, 71299-050CALF and 7111S1615A01LF (a SIM tray), Hirose IC1F, IC9 and IC1K, TE 5535657, Assmann A-PCMCIA-68 (male THT), and an AliExpress female part (photo and listing brands disagree; $39 shipping). The single-row MCS-068SSA1 would suit a single-sided board but no stock turned up. J1 laid out as a straddle the same day (rev 1's top/bottom split, rows directly opposite) and the board rerouted: DRC 0 unconnected, verify.py passes and now checks the straddle; renders regenerated. The row's distance from the edge, the pad size and the 1.6 mm thickness are estimates. Next: measure the parts and set `J1_ROW`, `J1_PAD` and `BOARD_T`.
- 2026-11-19: Rev 2 draft case in hardware/sb-lora/rev2/case/: base and lid split at the board's top face, both printed flat with no supports, two M2 x 8 screws. The in-slot shape (rails, side latches, end tabs) is nkorth's public-domain Springboard slot cover (Thingiverse 4776750); past the slot opening a bump holds the XIAO and Wio, the LiPo below them, a 42 x 10 mm FPC antenna pocket and the USB-C opening. 54 x 77 x 17.4 mm assembled. Not printed. The connector's contact height in the slot (3.35 mm), J1's body, and the radio and LiPo heights are guesses to measure; the bump also needs checking against the Visor's IR window and stylus.
+22
View File
@@ -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. **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 ## What's in here
| Path | What | | Path | What |
@@ -33,6 +35,26 @@ A Springboard module for the Handspring Visor that carries a Seeed XIAO nRF52840
- The Springboard connector core is a standard PCMCIA 68-pin connector with different housing keying (Dev Guide §5, §7.1). Handspring used four board-offset variants (−0.3, 0, +0.3, +0.6 mm); a harvested connector's offset sets how high the board sits in the slot, so compare it against a (51) or dry-fit before soldering. - The Springboard connector core is a standard PCMCIA 68-pin connector with different housing keying (Dev Guide §5, §7.1). Handspring used four board-offset variants (−0.3, 0, +0.3, +0.6 mm); a harvested connector's offset sets how high the board sits in the slot, so compare it against a (51) or dry-fit before soldering.
- An earlier note here suggested XKB X1321FV-2x34 (LCSC C2881777) as a substitute. That was never verified: the closest LCSC listing (X1321FVS-2x34, C2881881) is a vertical SMD socket, not an edge straddle, and won't fit this footprint. - An earlier note here suggested XKB X1321FV-2x34 (LCSC C2881777) as a substitute. That was never verified: the closest LCSC listing (X1321FVS-2x34, C2881881) is a vertical SMD socket, not an edge straddle, and won't fit this footprint.
- Pin 1 is marked on silk at the right-hand end of the top row. - Pin 1 is marked on silk at the right-hand end of the top row.
- **Without the Hirose part.** The order for one was cancelled (Nov 2026). Rev 1 only uses these Springboard pins, so any receptacle that fits the slot needs about 12 good joints:
| Signal | Pins |
|---|---|
| GND | 1, 34, 35, 68 |
| CD1\*, CD2\* (to GND, or the OS sees no module) | 36, 67 |
| VCC (VSB) | 17, 51 |
| CS0\*, CS1\* | 7, 42 |
| A8, A17 | 12, 46 |
| D0 | 30 |
| IRQ\* | 16 |
| RESET\* | 58 |
VDOCK (18, 52) is only needed if JP1 is bridged. Temporary options, best first:
1. **Harvest a straddle connector** from a junk Springboard module (backup modules, Eyemodule, MiniJam and so on). It fits the footprint as designed; check its board offset against the slot first.
2. **Donor connector on wires.** Cut a junk module's PCB just behind its connector, cut its traces, and wire its pads for the pins above to the matching J1 pads (or vias on the same nets). The donor strip sets the height in the slot; rev 1 sits outside, glued or taped to it.
3. **Single-sided SMT PC Card receptacle** glued to the top at the edge. Top-row tails (1-34) go to the top pads where they line up (staggered tails need short jumpers). The 8 used bottom-row pins (35, 36, 42, 46, 51, 58, 67, 68) are wired around the edge to the bottom pads. The board then sits about 1 mm off the contact centre line, so dry-fit it: the edges may need filing to run in the slot's rails.
4. **Receptacle from a junk PCMCIA card.** Same contacts, but its housing keys may block the Springboard slot, and a straddle part is sized for a thinner card PCB than 1.6 mm. Try it only if one is to hand.
Whichever you use, check continuity from each used pin to its net and do the bench-power checks in [BRINGUP.md](BRINGUP.md) before it goes in the Visor.
2. **J2/J3**: two 1x7 2.54 mm female headers (low-profile if you can find them). Your XIAO+Wio stack plugs in here. You can also solder the stack's pins straight into the holes. 2. **J2/J3**: two 1x7 2.54 mm female headers (low-profile if you can find them). Your XIAO+Wio stack plugs in here. You can also solder the stack's pins straight into the holes.
3. **JP1**: leave **open**. See VDOCK below. 3. **JP1**: leave **open**. See VDOCK below.
+22 -8
View File
@@ -1,6 +1,6 @@
# SB-LoRa rev 2 plan # SB-LoRa rev 2 plan
Draft, nothing designed yet. Rev 1 (`hw-v0.1`) is ordered and shipping, but its Hirose IC1HA straddle connector is obsolete and the order for one may not ship. 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 ## Decided
@@ -68,20 +68,34 @@ A 16550-style UART on csSlot1 replaces rev 1's SC16IS740 SPI bridge and its latc
## Open ## Open
- **Connector: waiting on the Hirose IC1HA order.** If it ships, rev 2 keeps rev 1's straddle footprint. If it's cancelled, switch to 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).** Candidate: 3M MCS-068SMA1-TR30, a 68-contact female PCMCIA receptacle for memory cards ("MEMPAK"), straddle mount, sold on eBay as surplus. It's a Robinson Nugent part (later 3M). The only document found is a catalogue overview page (Robinson Nugent PC Card Products p. 330, "MEMPAK Receptacles"), which gives "PCMCIA Spec, .050\" straddle mount, SMT solder tails, Standard mounting ears" with no offset on the tails; its drawing is on catalogue p. 333, which hasn't turned up. So each row is 34 tails at 1.27 mm, and the listing photos show the two rows directly above each other, with no stagger. The gap between the rows (the board thickness) isn't given, so it and the rest of the land pattern have to be measured from a sample. The same page lists MCS-068SSA1-TR30: one row of 68 SMT tails at .025\" (0.635 mm) on one side of the board, top or bottom mounting. That would suit a single-sided board of any thickness, but no stock turned up (only a broker listing for MCS-068SSA1-TR30TP with no quantity). The MCS-068SMA1 parts from eBay were ordered on 2026-11-19, and J1 is designed around them. Buy enough for every board in one order. Ruled out: a generic AliExpress 68-pin female part (single-sided, but $39 shipping and over 2 weeks, and its photos show an AMP-marked part while it's sold as "Jiansu BST"), TE 5535657 (the host-side header), Hirose IC1K-68RD-1.27SF(71) (LCSC lists it as "Connector and Ejector", which reads as the host-side socket), Hirose IC1F-68RD-1.27SF and IC9 (obsolete), Amphenol 10014744-007T and 71299-050CALF (out of production), and Amphenol 7111S1615A01LF (a SIM card tray). 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, the gap between the two rows (the board thickness it takes), tail pitch, tail distance from the mating face, tail width and length, and the body size and any pegs.
- **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. - **Case.** The keying is in the module case, so rev 2 needs a case whose key and latch match the slot, with the board held at the connector's height. A draft 3D-printed case is in [rev2/case/](rev2/case/README.md): nkorth's public-domain slot cover for the in-slot part, plus a bump for the radio boards, the LiPo and an internal antenna. It hasn't been printed; the connector height in the slot, J1's body and the radio and LiPo heights still need measuring.
- **Board thickness.** The straddle connector forces 1.6 mm; a top-mount one may allow 0.8-1.0 mm. - **Board thickness.** A straddle connector sets it: the board is whatever fits between the two rows. The Hirose IC1HA took 1.6 mm, but PC Card internal boards are often about 0.8 mm, so measure the 3M part's gap before assuming 1.6 mm.
- **LiPo size.** The aim is at least a few days per charge. Estimate, to be replaced by a measurement: - **LiPo size.** The aim is at least a few days per charge. Estimate, to be replaced by a measurement:
- The XIAO and SX1262 listen all the time (MeshCore companion doesn't sleep the radio): roughly 5-6 mA for the SX1262 in receive with boosted gain, plus 1-3 mA for the nRF52840 with the UART open. Transmits at 22 dBm draw about 120 mA but are short at SF10/BW500 and rare for a companion. Call it 7-10 mA on average. - The XIAO and SX1262 listen all the time (MeshCore companion doesn't sleep the radio): roughly 5-6 mA for the SX1262 in receive with boosted gain, plus 1-3 mA for the nRF52840 with the UART open. Transmits at 22 dBm draw about 120 mA but are short at SF10/BW500 and rare for a companion. Call it 7-10 mA on average.
- 3 days at 10 mA is 720 mAh; with margin for usable capacity and ageing, about 1000 mAh. 500 mAh gives about 2 days. - 3 days at 10 mA is 720 mAh; with margin for usable capacity and ageing, about 1000 mAh. 500 mAh gives about 2 days.
- 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. - 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. - 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: `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 with J1 as a straddle. **Don't order it until J1's pattern is measured** (below).
- 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 stays rev 1's straddle footprint until the connector order is settled. - **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, and J1's pins 35-68, which are on the bottom edge opposite pins 1-34. 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, J1's straddle (pins 1-34 on F.Cu, 35-68 on B.Cu, each directly opposite its partner), 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/`, below, made with `kicad-cli pcb render --side top|bottom -w 784 -h 1096 --background opaque`. J1's pads are the estimated straddle pattern.
| Top | Bottom |
|---|---|
| ![SB-LoRa rev 2, top](rev2/renders/sb-lora-rev2-top.png) | ![SB-LoRa rev 2, bottom](rev2/renders/sb-lora-rev2-bottom.png) |
Before ordering:
1. **J1.** The straddle pattern is in `build_board.py`: pins 1-34 on F.Cu and 35-68 on B.Cu directly opposite, at 1.27 mm (the same split as rev 1). The rest is estimated: 0.6 x 1.6 mm pads centred 1.3 mm from the edge. When the MCS-068SMA1 parts arrive (ordered 2026-11-19), measure one with calipers and set `J1_ROW`, `J1_PAD` and `BOARD_T` from it. Keep the 5.5 mm strip along the edge free (`J1_KEEP`) on both sides, and check whether the connector body needs the board edge moved. Then run `make.sh` and `make_fab.py` again, and regenerate the renders.
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.** Match it to the 3M part's gap between the rows. If that's thinner than 1.6 mm, change `BOARD_T` in `build_board.py` and the thickness in the JLC order to suit.
5. Tag the commit you order from as `hw-v0.2`.
## Carried over from rev 1 ## Carried over from rev 1
+297
View File
@@ -0,0 +1,297 @@
#!/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 Robinson Nugent / 3M MCS-068SMA1-TR30 straddle receptacle: pins 1-34 on F.Cu, 35-68 on
B.Cu directly opposite, 1.27 mm pitch. There's no drawing, so the row's distance from the edge,
the pad size and the board thickness are estimates in the J1_* constants below. Set them from a
measured part before ordering, and keep the J1 zone (J1_KEEP from the edge, both sides) 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 straddle land pattern: pitch from the catalogue, the rest estimated until a part is measured ----
J1_PITCH = 1.27 # contact pitch within a row (catalogue: .050")
J1_ROW = 1.3 # pad centre distance from the board edge, both rows (estimate)
J1_PAD = (0.6, 1.6) # pad width along the edge, length into the board (estimate)
J1_KEEP = 5.5 # no other parts within this distance of the edge, top or bottom
BOARD_T = 1.6 # set by the connector's gap between the rows (not yet measured)
board = pcbnew.BOARD()
board.SetCopperLayerCount(4)
board.SetLayerType(pcbnew.In1_Cu, pcbnew.LT_POWER)
ds = board.GetDesignSettings()
ds.SetBoardThickness(MM(BOARD_T))
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 both fab layers, so the connector's extent shows on the assembly drawings
for lyr in (pcbnew.F_Fab, pcbnew.B_Fab):
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(lyr); 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_STRADDLE"))
fp.SetReference("J1"); fp.SetValue("MCS-068SMA1 straddle (pattern estimated)")
for n in range(1, 69):
top = n <= 34 # same split as rev 1: pin n on F.Cu, pin n + 34 opposite it on B.Cu
k = (n - 1) if top else (n - 35)
x = 0.8 * IN - k * J1_PITCH
y = -J1_ROW
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()
for l in ((pcbnew.F_Cu, pcbnew.F_Mask, pcbnew.F_Paste) if top else (pcbnew.B_Cu, pcbnew.B_Mask, pcbnew.B_Paste)):
ls.AddLayer(l)
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 # top row's ends go sideways, bottom row 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 + J1_PAD[1] / 2 - 0.1 # just inside the 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("35", OX + 0.8 * IN, Y_EDGE - J1_KEEP - 0.8, 0.8, pcbnew.B_SilkS, True)
silk("68", OX - 0.85 * IN, Y_EDGE - J1_KEEP - 0.8, 0.8, pcbnew.B_SilkS, True)
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))
+37
View File
@@ -0,0 +1,37 @@
# SB-LoRa rev 2 case
A two-part 3D-printed Springboard module shell for the rev 2 board, for FDM printing (PLA or PETG, 0.4 mm nozzle). **Draft:** it hasn't been printed, and the values marked MEASURE in `sb_lora_case.scad` are guesses.
![Exploded view: lid above, base below](case-exploded.png)
## Parts
- `sb_lora_case.scad`: the parametric model (OpenSCAD).
- `sb-lora-case-base.stl`: holds the board, the LiPo and the slot latches.
- `sb-lora-case-lid.stl`: covers the parts and the radio boards, with a pocket for a flexible antenna.
Rebuild the STLs after changing a parameter:
```sh
openscad -D 'part="base"' -o sb-lora-case-base.stl sb_lora_case.scad
openscad -D 'part="lid"' -o sb-lora-case-lid.stl sb_lora_case.scad
```
## Shape
- **In the slot:** the outside is nkorth's public-domain Springboard slot cover ([Thingiverse 4776750](https://www.thingiverse.com/thing:4776750), CC0), so the rails, side latches and end tabs are taken from a part that is known to fit. Inside, the board sits with its contacts on `conn_z`, and J1's body is open at the connector end.
- **The bump:** past the slot opening, a rounded box holds the XIAO and the Wio above the board and the LiPo below it. Assembled, the case is 54 x 77 x 17.4 mm. The bump stands 4.7 mm proud of the Visor's back and reaches 5.3 mm past the slot floor.
- **Split:** the case splits at the board's top face. Both parts print flat on that face, with no supports. The lid bears on the board's long edges, and two M2 x 8 self-tapping screws at the far corners hold the parts together. The XIAO's USB-C is reached through the far end.
- **Antenna:** a pocket for a 42 x 10 mm 915 MHz FPC antenna on the lid's ceiling, over the radio boards, fed from the Wio's u.FL.
## Before printing the real case
1. **Print nkorth's blank first** (the files are on PalmDB and Thingiverse). If it doesn't fit the slot, this case won't either.
2. **Measure in the Visor's slot:** how deep the connector's contact centre line sits below the back surface (`conn_z`, now 3.35 mm), and where the connector face sits relative to the slot's end (the board's connector edge is 2.67 mm past the shell, from springSD's outline).
3. **Measure the J1 parts** when they arrive: the body's width, depth and thickness (`j1_w`, `j1_d`, `j1_h`), and the row gap, which sets `pcb_t`.
4. **Measure the radio boards and the LiPo:** the height of the XIAO with its USB-C and of the Wio with its u.FL plug above the carrier (`radio_h`), the pin stubs below it (`under_h`), and the cell (`lipo`).
5. **Check the Visor's top end:** the bump sits against it, so make sure it clears the IR window and the stylus.
## Print settings
0.2 mm layers, 4 perimeters (the walls are 1.6 mm), 20% infill. PETG gives the side latches more flex than PLA. Each part prints split face down.
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,160 @@
// SB-LoRa rev 2 case: a two-part 3D-printed Springboard module shell (base + lid) for FDM (PLA/PETG,
// 0.4 mm nozzle). Draft: the values marked MEASURE are guesses until checked against a Visor and the parts.
//
// Frame (the same as the slot cover this is based on): x across the slot, y along it with y = 0 at the
// connector end and the slot opening at y = slot_l, z into the Visor with z = 0 at the Visor's back surface
// and the slot floor at z = slot_h. The in-slot envelope (rails, latches, end tabs) is nkorth's public-domain
// "Handspring Visor Springboard slot cover" (Thingiverse 4776750, CC0), unchanged except for the grip.
//
// The board's top (component) side faces out (towards z = 0). The case splits at the board's top face:
// the base holds the board, the LiPo and the slot latches; the lid covers the parts and the radio boards
// and carries the antenna pocket. Both print flat on the split face.
//
// Render one part with: openscad -D 'part="base"' -o base.stl sb_lora_case.scad (part = base|lid|both)
part = "both";
$fs = 0.2; $fa = 2;
e = 0.01;
// ---- slot envelope (nkorth) ----
slot_w = 54; // width below the slot's lips
slot_l = 47.8; // depth of the slot from the connector end to the opening
slot_h = 7.5; // Visor back surface to slot floor
lip_h = 1.6; // the slot is narrower (lip_w) for its first lip_h
lip_w = 49.8;
// ---- board (from rev2/kicad/visormesh.kicad_pcb) ----
pcb_w = 50.43;
pcb_t = 1.6; // = BOARD_T in build_board.py
pcb_in = 50.47; // in-slot section
pcb_ext = 24.6; // extension past the slot opening
pcb_x = (slot_w - pcb_w) / 2;
pcb_y0 = slot_l - pcb_in; // connector edge (negative: J1 reaches past the shell into the Visor's connector)
pcb_y1 = slot_l + pcb_ext; // far end, where the XIAO's USB-C is
clr = 0.25; // fit clearance around the board
// ---- heights (MEASURE) ----
conn_z = 3.35; // MEASURE: depth of the Visor connector's contact centre line below the back surface.
// The straddle J1 centres its contacts on the board's mid-plane.
lid_t = 1.0; // lid over the in-slot parts
part_h = 1.25; // tallest in-slot part (README: all 1.25 mm or less)
radio_h = 5.0; // MEASURE: tallest of the XIAO (with USB-C) and the Wio (with u.FL plug) above the board
under_h = 1.5; // MEASURE: XIAO pads / Wio pin stubs below the board
lipo = [45, 22, 5]; // MEASURE: LiPo pouch x, y, thickness (REV2.md: 500-600 mAh is about 4 x 25 x 50)
wall = 1.6; // bump walls and floors (4 perimeters at 0.4 mm)
pcb_top = conn_z - pcb_t / 2; // split plane
pcb_bot = conn_z + pcb_t / 2;
assert(pcb_top - lid_t >= part_h + 0.2, "conn_z leaves no room for the in-slot parts under the lid");
assert(pcb_bot <= slot_h - 0.8, "conn_z leaves less than 0.8 mm of floor under the board");
// ---- J1 body (MEASURE from the MCS-068SMA1) ----
j1_w = 52; // body width with the mounting ears
j1_d = 5.5; // body depth from the board edge (J1_KEEP)
j1_h = 3.6; // body thickness, centred on the contacts
// ---- extension bump ----
bump_y1 = pcb_y1 + clr + 4.5; // room for the screw bosses past the board end
bump_top = pcb_top - radio_h - 0.6 - wall; // outermost z (negative: stands proud of the Visor)
bump_bot = pcb_bot + under_h + lipo[2] + 0.5 + wall;
// USB-C on the XIAO, in the board end wall (x from the board, z from the XIAO's height)
usb_x = 13.25;
usb_z = pcb_top - 2.8;
usb_open = [12.6, 6.8]; // plug overmould clearance
// M2 screws through the lid into the base, at the bump's far corners
screw_xy = [[3.6, bump_y1 - 3.0], [slot_w - 3.6, bump_y1 - 3.0]];
// flex 915 MHz FPC antenna, stuck to the lid's ceiling over the radio boards (MEASURE the one bought)
ant = [42, 10, 0.5];
ant_xy = [(slot_w - 42) / 2, pcb_y1 - 12];
module slot_envelope() { // nkorth's slot cover, minus its grip
tab_w = 12.4; tab_l = 1.4; tab_h = 1.5; relief_l = 12; flex_th = 0.8;
difference() {
union() {
difference() {
union() {
translate([2, 0, 0]) cube([lip_w, slot_l - 2, slot_h]);
translate([0, 0, lip_h]) cube([slot_w, slot_l, slot_h - lip_h]);
difference() {
translate([0, 0, slot_h - e]) {
cube([tab_w, tab_l, tab_h + e]);
translate([slot_w - tab_w, 0, 0]) cube([tab_w, tab_l, tab_h + e]);
}
translate([tab_w, -e, slot_h + tab_h]) rotate([-90, 0, 0]) cylinder(r = tab_h, h = tab_l + 2 * e);
translate([slot_w - tab_w, -e, slot_h + tab_h]) rotate([-90, 0, 0]) cylinder(r = tab_h, h = tab_l + 2 * e);
}
translate([0, 4.7, 4.9]) {
translate([1, 3, 0]) cylinder(r = 1.5, h = 2.6);
translate([slot_w - 1, 3, 0]) cylinder(r = 1.5, h = 2.6);
}
}
translate([2, -e, lip_h]) rotate([0, -135, 0]) cube([3, slot_l + 2 * e, 3]);
translate([slot_w - 2, -e, lip_h]) rotate([0, 45, 0]) cube([3, slot_l + 2 * e, 3]);
}
translate([2 + e, 0, 0]) linear_extrude(height = 3) polygon([[0, 0], [-1, 0], [0, 8]]);
translate([lip_w + 2 - e, 0, 0]) linear_extrude(height = 3) polygon([[0, 0], [1, 0], [0, 8]]);
}
translate([-e, 0, slot_h + tab_h]) rotate([183, 0, 0]) cube([slot_w + 2 * e, 2, slot_h + tab_h + 1]);
translate([flex_th, 1.4, slot_h - 4]) cube([1, relief_l, 4 + e]);
translate([-e, 1.4, slot_h - 4]) cube([1 + flex_th + e, relief_l, 1]);
translate([slot_w - flex_th - 1, 1.4, slot_h - 4]) cube([1, relief_l, 4 + e]);
translate([slot_w - 1 - flex_th + e, 1.4, slot_h - 4]) cube([1 + flex_th + e, relief_l, 1]);
translate([0, 6.2, slot_h - 2.6]) rotate([0, -135, 0]) cube([1, 3, 1]);
translate([slot_w, 6.2, slot_h - 2.6]) rotate([0, 45, 0]) cube([1, 3, 1]);
}
}
module bump() { // the part past the slot opening, rounded on its outer edges
r = 2;
hull() for (x = [r, slot_w - r], y = [slot_l, bump_y1 - r], z = [bump_top + r, bump_bot - r])
translate([x, y, z]) sphere(r = r);
}
module outer() {
union() {
slot_envelope();
// fill between the envelope and the bump so the two parts join
translate([0, slot_l - 2, bump_top + 2]) cube([slot_w, 2.5, bump_bot - bump_top - 4]);
bump();
}
}
module cavities() {
// board, with clearance
translate([pcb_x - clr, pcb_y0 - 5, pcb_top - e]) cube([pcb_w + 2 * clr, pcb_y1 - pcb_y0 + clr + 5, pcb_t + clr + e]);
// in-slot parts under the lid; the lid bears on the board's long edges (0.8 mm)
translate([pcb_x + 0.8, pcb_y0 - 5, lid_t]) cube([pcb_w - 1.6, slot_l - pcb_y0 + 5, pcb_top - lid_t + e]);
// radio boards (they start about 2.4 mm past the slot opening)
translate([pcb_x + 0.8, slot_l + 0.5, bump_top + wall]) cube([pcb_w - 1.6, pcb_y1 - slot_l - 0.5 + clr, pcb_top - bump_top - wall + e]);
// pins under the board, then the LiPo
translate([pcb_x + 0.8, slot_l + 0.5, pcb_bot - e]) cube([pcb_w - 1.6, pcb_y1 - slot_l - 0.5 - 0.8, under_h + e]);
translate([(slot_w - lipo[0]) / 2 - 0.3, pcb_y1 - lipo[1] - 0.8, pcb_bot + under_h - e]) cube([lipo[0] + 0.6, lipo[1] + 0.6, lipo[2] + 0.5 + e]);
// J1 body at the connector end, open to the Visor's connector
translate([(slot_w - j1_w) / 2, -5, conn_z - j1_h / 2]) cube([j1_w, pcb_y0 + j1_d + 5 + 0.3, j1_h]);
// USB-C opening in the far wall
translate([usb_x - usb_open[0] / 2, pcb_y1, usb_z - usb_open[1] / 2]) cube([usb_open[0], bump_y1 - pcb_y1 + 1, usb_open[1]]);
// antenna pocket in the lid's ceiling
translate([ant_xy[0], ant_xy[1], bump_top + wall - ant[2]]) cube([ant[0], ant[1], ant[2] + e]);
}
module screws(lid) { // M2 x 8 self-tappers: clearance in the lid, pilot in the base
for (p = screw_xy) translate([p[0], p[1], 0]) {
if (lid) {
translate([0, 0, bump_top - e]) cylinder(d = 2.3, h = pcb_top - bump_top + 2 * e);
translate([0, 0, bump_top - e]) cylinder(d = 4.0, h = 1.2 + e); // head counterbore
} else
translate([0, 0, pcb_top - e]) cylinder(d = 1.7, h = bump_bot - wall - pcb_top);
}
}
module half(lid) {
intersection() {
difference() { outer(); cavities(); screws(lid); }
if (lid) translate([-10, -20, -50]) cube([slot_w + 20, 150, 50 + pcb_top]);
else translate([-10, -20, pcb_top]) cube([slot_w + 20, 150, 50]);
}
}
if (part == "base") half(false);
else if (part == "lid") half(true);
else { half(false); translate([0, 0, -12]) half(true); } // exploded view
+94
View File
@@ -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()))
+202
View File
@@ -0,0 +1,202 @@
** Drc report for visormesh.kicad_pcb **
** Created on 2026-11-19T22:57:51 **
** Report includes: Errors, Warnings **
** Found 54 DRC violations **
[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 '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
@(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
@(101.0000 mm, 81.5000 mm): Footprint C10
[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 'TestPoint'
Local override; warning
@(100.2500 mm, 56.5682 mm): Footprint TP3
[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
@(88.0000 mm, 78.5000 mm): Footprint R3
[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 '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 'Jumper'
Local override; warning
@(116.5000 mm, 78.5000 mm): Footprint JP1
[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 'TestPoint'
Local override; warning
@(100.2500 mm, 50.9682 mm): Footprint TP1
[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_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 '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 '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
@(112.5000 mm, 59.4682 mm): Footprint X2
[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 '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 '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
@(95.0000 mm, 81.5000 mm): Footprint C8
[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 '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
@(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, 59.3682 mm): Footprint TP4
[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 '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 '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 '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
@(105.0000 mm, 78.5000 mm): Footprint R2
[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 'visormesh'
Local override; warning
@(100.2500 mm, 59.9682 mm): Footprint BT1
[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
@(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, 51.8482 mm): PTH pad 14 [XIAO_VBUS] 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, 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
@(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-)
@(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, 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, 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": []
}
}
+33
View File
@@ -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"
+58
View File
@@ -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)))
+6 -6
View File
@@ -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's land pattern is estimated until a part is measured.
Same shape as ../source/netlist.py (rev 1, hw-v0.1), so its board and schematic scripts can be adapted. 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. 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) # ref: (value, footprint_lib, footprint_name, lcsc, description, dnp)
# An empty LCSC number is still to be looked up. # An empty LCSC number is still to be looked up.
PARTS = { PARTS = {
"J1": ("Springboard 68p straddle", None, "SPRINGBOARD_68", "", "J1": ("MCS-068SMA1-TR30", None, "SPRINGBOARD_68_STRADDLE", "",
"Hirose IC1HA-68RD-1.27SH(51); pending the order (REV2.md). Hand-solder", True), "Robinson Nugent / 3M PC Card receptacle, card side, straddle mount; land pattern estimated until a part is measured (REV2.md). Hand-solder", True),
"U1": ("S29AL016J70TFI020", "Package_SO", "TSOP-I-48_18.4x12mm_P0.5mm", "C914935", "U1": ("S29AL016J70TFI020", "Package_SO", "TSOP-I-48_18.4x12mm_P0.5mm", "C914935",
"2 MB NOR flash, x16, 70 ns, csSlot0", False), "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), "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), "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), "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") c("R4", 1, "VSB"); c("R4", 2, "WE_FL_N")
# U2 SC16C650B HVQFN32 (NXP datasheet table 2; the SC16C750B matches, the SC16C550B does not). # 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", 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", 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", 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 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 # 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") 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: 71 KiB

+21
View File
@@ -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)
+80
View File
@@ -0,0 +1,80 @@
#!/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]}")
j1 = {p.GetNumber(): p for fp in b.GetFootprints() if fp.GetReference() == "J1" for p in fp.Pads()}
def side(p):
return {(True, False): "F", (False, True): "B"}.get((p.IsOnLayer(pcbnew.F_Cu), p.IsOnLayer(pcbnew.B_Cu)), "?")
sbad = [n for n in range(1, 69) if side(j1[str(n)]) != ("F" if n <= 34 else "B")]
check(not sbad, f"J1 straddle: pins 1-34 on F.Cu only, 35-68 on B.Cu only {sbad[:4]}")
obad = [n for n in range(1, 35) if j1[str(n)].GetPosition() != j1[str(n + 34)].GetPosition()]
check(not obad, f"J1 straddle: pin n + 34 directly opposite pin n {obad[: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)