Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# schematics. This checks it with the Cargo-locked Stackup CLI (ci/stackup,
# pinned with the parts library in manifest.kdl), then fails if syncing the
# committed PCB from the design would change it, so the KDL and
# PCB/DroidCANAdapter.kicad_pcb can't drift apart. The sync check applies
# PCB/DroidCANBridge.kicad_pcb can't drift apart. The sync check applies
# the Stackup KiCad plugin to the board in memory with KiCad 10's Python and
# never saves.
stackup:
Expand Down Expand Up @@ -67,8 +67,8 @@ jobs:

- name: Check PCB sync
run: |
/usr/bin/python3 ci/check_pcb_sync.py PCB/DroidCANAdapter.kicad_pcb \
--stackup ci/stackup/target/debug/droidcanadapter-stackup-check \
/usr/bin/python3 ci/check_pcb_sync.py PCB/DroidCANBridge.kicad_pcb \
--stackup ci/stackup/target/debug/droidcanbridge-stackup-check \
--plugin-dir stackup-tool/kicad-plugin

# ── Single required check ─────────────────────────────────────────────────
Expand Down
10 changes: 5 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Droid CANBus Adapter — Claude Notes
# DroidCANBridge — Claude Notes

## Design principles

This device makes CANBus much easier for droid builders: a very small, cheap adapter board that gives a
device without CAN support its own CANBus endpoint, bridging CAN to a plain UART and back.
This device makes CANBus much easier for droid builders: a very small, cheap CAN-to-UART bridge that gives a
device without CAN support its own CANBus endpoint, translating CAN to a plain UART and back.

Requirements and the decisions behind them are recorded in [PCB/README.md](PCB/README.md). Read it
before changing the hardware, and add to it rather than re-deciding something already settled there.
Expand All @@ -12,7 +12,7 @@ before changing the hardware, and add to it rather than re-deciding something al

- `PCB/` — hardware. `PCB/stackup/` holds the Stackup design, `PCB/datasheets/` the manufacturer
datasheets (fetched with the `pcb-design` skill's `datasheet.py`), and the KiCad project
(`DroidCANAdapter.*`) lives beside them.
(`DroidCANBridge.*`) lives beside them.
- `ci/` — the Cargo-locked Stackup CLI (`ci/stackup/`) and the PCB sync check (`check_pcb_sync.py`).
- `src/`, `include/`, `test/` — firmware (PlatformIO, STM32C092). Not started yet.

Expand All @@ -32,7 +32,7 @@ KiCad schematics (there are none). Hardware work follows the `pcb-design` skill.
- Check the design with `stackup check PCB/stackup/board.kdl --locked` (CLI 0.2.0; the Cargo-locked
copy in `ci/stackup/` is the reference version). The parts library is pinned by commit in
`manifest.kdl`.
- After any change to the KDL, sync `PCB/DroidCANAdapter.kicad_pcb` from it with the Stackup KiCad
- After any change to the KDL, sync `PCB/DroidCANBridge.kicad_pcb` from it with the Stackup KiCad
plugin (never edit footprint nets by hand) and commit the PCB with the KDL. Footprints record their
`board.kdl` line, so even reordering lines needs a resync.
- Mounting holes and logos are KiCad `board_only` footprints; the sync leaves them alone.
Expand Down
46 changes: 23 additions & 23 deletions PCB/DroidCANAdapter.kicad_pcb → PCB/DroidCANBridge.kicad_pcb
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:180"
(property "Stackup Source" "PCB/stackup/board.kdl:183"
(at 0 2 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -1443,7 +1443,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:154"
(property "Stackup Source" "PCB/stackup/board.kdl:157"
(at 0 2 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -1884,7 +1884,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:107"
(property "Stackup Source" "PCB/stackup/board.kdl:110"
(at 0 2 180)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -2558,7 +2558,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:83"
(property "Stackup Source" "PCB/stackup/board.kdl:86"
(at 0 2 90)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -3114,7 +3114,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:111"
(property "Stackup Source" "PCB/stackup/board.kdl:114"
(at 0 2 180)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -3531,7 +3531,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:129"
(property "Stackup Source" "PCB/stackup/board.kdl:132"
(at 0 2 90)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -3973,7 +3973,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:173"
(property "Stackup Source" "PCB/stackup/board.kdl:176"
(at 0 2 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -4414,7 +4414,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:171"
(property "Stackup Source" "PCB/stackup/board.kdl:174"
(at 0 2 90)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -4635,7 +4635,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:123"
(property "Stackup Source" "PCB/stackup/board.kdl:126"
(at 2 0 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -4983,7 +4983,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:131"
(property "Stackup Source" "PCB/stackup/board.kdl:134"
(at 0 2 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -5273,7 +5273,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:139"
(property "Stackup Source" "PCB/stackup/board.kdl:142"
(at 0 2 90)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -5572,7 +5572,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:163"
(property "Stackup Source" "PCB/stackup/board.kdl:166"
(at 0 2 90)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -5898,7 +5898,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:124"
(property "Stackup Source" "PCB/stackup/board.kdl:127"
(at 2 0 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -6238,7 +6238,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:90"
(property "Stackup Source" "PCB/stackup/board.kdl:93"
(at 0 2 180)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -6776,7 +6776,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:89"
(property "Stackup Source" "PCB/stackup/board.kdl:92"
(at 0 2 180)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -7077,7 +7077,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:187"
(property "Stackup Source" "PCB/stackup/board.kdl:190"
(at 0 2 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -7246,7 +7246,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:147"
(property "Stackup Source" "PCB/stackup/board.kdl:150"
(at 0 2 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -7455,7 +7455,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:136"
(property "Stackup Source" "PCB/stackup/board.kdl:139"
(at 2 0 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -7815,7 +7815,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:103"
(property "Stackup Source" "PCB/stackup/board.kdl:106"
(at 0 2 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -8456,7 +8456,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:188"
(property "Stackup Source" "PCB/stackup/board.kdl:191"
(at 0 2 0)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -8625,7 +8625,7 @@
)
)
)
(property "Stackup Source" "PCB/stackup/board.kdl:82"
(property "Stackup Source" "PCB/stackup/board.kdl:85"
(at 0 2 270)
(layer "F.SilkS")
(hide yes)
Expand Down Expand Up @@ -9123,7 +9123,7 @@
)
)
)
(gr_text "CAN bus to UART Adapter V1.0 by @thePunderWoman\ngithub.com/thePunderWoman/DroidCANAdapter"
(gr_text "CAN to UART Bridge V1.0 by @thePunderWoman\ngithub.com/thePunderWoman/DroidCANBridge"
(at 122.6 135.6 0)
(layer "F.SilkS")
(uuid "0c49e927-0a57-4a2e-89b7-26832f0ffc87")
Expand Down Expand Up @@ -9365,7 +9365,7 @@
)
)
)
(gr_text "DroidCANAdapter"
(gr_text "DroidCANBridge"
(at 122 110.5 0)
(layer "B.SilkS")
(uuid "c38b1919-d1d4-4341-933c-f8a30f2abf79")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
"pinned_symbol_libs": []
},
"meta": {
"filename": "DroidCANAdapter.kicad_pro",
"filename": "DroidCANBridge.kicad_pro",
"version": 3
},
"net_settings": {
Expand Down Expand Up @@ -411,8 +411,8 @@
"legacy_lib_list": [],
"top_level_sheets": [
{
"filename": "DroidCANAdapter.kicad_sch",
"name": "DroidCANAdapter",
"filename": "DroidCANBridge.kicad_sch",
"name": "DroidCANBridge",
"uuid": "00000000-0000-0000-0000-000000000000"
}
]
Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions PCB/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# DroidCANAdapter hardware
# DroidCANBridge hardware

The electrical design is Stackup KDL in [`stackup/`](stackup/) (`board.kdl`, plus the local parts in
`parts.kdl`). The KiCad board `DroidCANAdapter.kicad_pcb` is synced from it through
`DroidCANAdapter.stackup_sch`. Manufacturer datasheets are in [`datasheets/`](datasheets/), with
`parts.kdl`). The KiCad board `DroidCANBridge.kicad_pcb` is synced from it through
`DroidCANBridge.stackup_sch`. Manufacturer datasheets are in [`datasheets/`](datasheets/), with
their source URLs and hashes in `datasheets/manifest.json`.

```sh
Expand All @@ -14,7 +14,7 @@ the board closed:

```sh
/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/Current/bin/python3 \
<stackup checkout>/kicad-plugin/sync_headless.py PCB/DroidCANAdapter.kicad_pcb
<stackup checkout>/kicad-plugin/sync_headless.py PCB/DroidCANBridge.kicad_pcb
```

Commit the synced PCB with the KDL. CI fails if syncing would change the committed PCB.
Expand Down Expand Up @@ -108,7 +108,7 @@ firmware must leave the unused ones in their reset (analog) state.

## DC operating points

Supply states: WAGO only, FTDI only, both, and adapter unpowered with the UART device powered.
Supply states: WAGO only, FTDI only, both, and the bridge unpowered with the UART device powered.

| Node | Value | Limit (source) | OK |
|---|---|---|---|
Expand All @@ -123,7 +123,7 @@ Supply states: WAGO only, FTDI only, both, and adapter unpowered with the UART d
| Q_RX on (device TX low ≤ 0.8 V) | VGS ≥ 3.25 - 0.8 = 2.45 V | BSS138 VGS(th) max 1.5 V (onsemi, electrical characteristics) | ✓ |
| UART_RX_3V3, device low | ≤ 0.8 V + 3.3 mA × RDS(on) (≤ 6 Ω at 4.5 V; more at 2.45 V) ≈ 0.85 V | VIL 0.3 × VDD = 0.98 V (Table 50) | ✓ (assumes device VOL ≤ 0.8 V; typical ≤ 0.4 V) |
| UART_RX_3V3, device high | 3.25 V via R_RXPU | VIH 0.7 × VDD = 2.31 V | ✓ |
| UART_RX_3V3, adapter unpowered | ≈ 0 V (FET off, body diode reverse-biased) | FT pin max 4.0 V with VDD = 0 (Table 21) | ✓ |
| UART_RX_3V3, bridge unpowered | ≈ 0 V (FET off, body diode reverse-biased) | FT pin max 4.0 V with VDD = 0 (Table 21) | ✓ |
| BOOT0 at rest / pressed | 0 V / 3.3 V (0.33 mA) | VIL 0.98 V / VIH 2.31 V | ✓ |
| NRST on DTR fall, 3.3 V cable | 3.3 - 3.3 × 1 µF/1.1 µF = 0.3 V, below VIL for 7-16 ms (τ = 1.1 µF × RPU 25-55 kΩ) | VIL(NRST) 0.3 × VDD = 0.98 V; filter 70 ns (Table 53) | ✓ |
| NRST on DTR fall, 5 V cable | clamped by BAT54S to -0.35 to -0.52 V, below VIL for 12-27 ms (SPICE) | MCU negative injection ≤ 5 mA (Table 22): simulated ≤ 0.25 mA; without the BAT54S, 26 mA | ✓ |
Expand Down Expand Up @@ -167,7 +167,7 @@ Supply states: WAGO only, FTDI only, both, and adapter unpowered with the UART d
rate. But a strictly classic controller (e.g. MCP2515) answers FD frames with error frames. The
STM32 FDCAN can run in classic mode and ignore FD frames (protocol exception handling), so this
board stays safe on a mixed bus and can move to FD in firmware later. Messages addressed to the
adapter must be sent as classic frames while it runs in classic mode.
bridge must be sent as classic frames while it runs in classic mode.
- **TCAN334G, 3.3 V transceiver.** Running everything from 3.3 V lets the power path use plain
Schottky diodes for OR-ing and reverse protection: a 5 V-only transceiver (MCP2562FD, VDD ≥ 4.5 V)
would not tolerate the diode drop. This replaced the P-MOSFET reverse protection discussed earlier:
Expand All @@ -177,7 +177,7 @@ Supply states: WAGO only, FTDI only, both, and adapter unpowered with the UART d
`STM32C0xx/C092ECY_C092F(B-C)P`, so a small custom board JSON is enough. FDCAN is used through the
bundled HAL; STM32duino has no CAN library.
- **UART level shifting.** TX: open-drain with a pull-up to the J_VIO rail, no extra parts. RX: a
BSS138, because the FT pin's limit drops to 4.0 V with the adapter unpowered and positive injection
BSS138, because the FT pin's limit drops to 4.0 V with the bridge unpowered and positive injection
is not allowed (DS14720 Tables 21-22), so a series resistor can't protect it from a separately
powered 5 V device.
- **JST-XH** for CAN and UART (the community's preferred connector), **2-pin with no ground**: every
Expand Down Expand Up @@ -260,5 +260,5 @@ Accepted findings:
terminated). Exchange classic frames with a known node; confirm no error frames when an FD node
transmits FD frames.
7. UART: loopback at 3.3 V and 5 V settings; scope TX rise time at the target baud rate; with the
adapter unpowered and a powered 5 V device on J_UART, confirm PB7 stays ≈ 0 V.
bridge unpowered and a powered 5 V device on J_UART, confirm PB7 stays ≈ 0 V.
8. LDO temperature with the CAN bus heavily loaded.
File renamed without changes
2 changes: 1 addition & 1 deletion PCB/fp-lib-table
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(fp_lib_table
(version 7)
(lib (name "DroidCANAdapter") (type "KiCad") (uri "${KIPRJMOD}/libraries/DroidCANAdapter.pretty") (options "") (descr "Project footprints"))
(lib (name "DroidCANBridge") (type "KiCad") (uri "${KIPRJMOD}/libraries/DroidCANBridge.pretty") (options "") (descr "Project footprints"))
)
6 changes: 3 additions & 3 deletions PCB/libraries/3dmodels/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 3D models

Models for parts whose stock KiCad model is missing. Footprints in `../DroidCANAdapter.pretty`
Models for parts whose stock KiCad model is missing. Footprints in `../DroidCANBridge.pretty`
reference them as `${KIPRJMOD}/libraries/3dmodels/...`.

Some manufacturer models can't be committed: their terms of use forbid redistributing them. Those are
Expand All @@ -9,8 +9,8 @@ that part; the board, DRC and fab outputs are unaffected.

| File | Part | Source | In git | Alignment notes |
|---|---|---|---|---|
| `TS-1187A-B-A-B.step` | XKB TS-1187A-B-A-B (SW_BOOT) | SnapEDA (SnapMagic), STEP AP214 exported from SolidWorks | No: SnapEDA's terms allow use in your designs but not redistributing the models | Used by `DroidCANAdapter:XKB_TS-1187A-B-A-B` (KiCad's footprint, renamed so the Stackup sync picks it up). Rotate (90, 0, 0), no offset. The model is Y-up with its base on y = 0; body 0-1.55 mm, terminals at x = ±3.25 mm over pads at ±3.0 mm |
| `WAGO_2601-1102.stp` | WAGO 2601-1102 (J_PWR_IN, J_PWR_OUT) | WAGO via CADENAS PARTcommunity / 3Dfindit, STEP AP214 | No: [CADENAS terms](https://www.cadenas.de/terms-of-use-3d-cad-models) §8 bar passing models to third parties or making them public | Used by `DroidCANAdapter:WAGO_2601-1102_Horizontal` (copied from PowerBoards, pads identical to KiCad's stock footprint). Rotate (270, 0, 90), offset X +4.56 mm. The model is Y-up with its origin at an entry-side pin; this puts its pins on pads 1 and 2 |
| `TS-1187A-B-A-B.step` | XKB TS-1187A-B-A-B (SW_BOOT) | SnapEDA (SnapMagic), STEP AP214 exported from SolidWorks | No: SnapEDA's terms allow use in your designs but not redistributing the models | Used by `DroidCANBridge:XKB_TS-1187A-B-A-B` (KiCad's footprint, renamed so the Stackup sync picks it up). Rotate (90, 0, 0), no offset. The model is Y-up with its base on y = 0; body 0-1.55 mm, terminals at x = ±3.25 mm over pads at ±3.0 mm |
| `WAGO_2601-1102.stp` | WAGO 2601-1102 (J_PWR_IN, J_PWR_OUT) | WAGO via CADENAS PARTcommunity / 3Dfindit, STEP AP214 | No: [CADENAS terms](https://www.cadenas.de/terms-of-use-3d-cad-models) §8 bar passing models to third parties or making them public | Used by `DroidCANBridge:WAGO_2601-1102_Horizontal` (copied from PowerBoards, pads identical to KiCad's stock footprint). Rotate (270, 0, 90), offset X +4.56 mm. The model is Y-up with its origin at an entry-side pin; this puts its pins on pads 1 and 2 |

## Getting the WAGO 2601-1102 model

Expand Down
5 changes: 4 additions & 1 deletion PCB/stackup/board.kdl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// DroidCANAdapter electrical design: a CAN FD <-> UART bridge for droid builders.
// DroidCANBridge electrical design: a CAN FD <-> UART bridge for droid builders.
//
// STM32C092 (TSSOP-20) with a TCAN334G 3.3 V CAN FD transceiver; two 2-pin JST-XH CAN connectors
// wired in parallel for daisy-chaining, with a jumper for the 120 Ω terminator; a 2-pin JST-XH UART
Expand Down Expand Up @@ -37,6 +37,9 @@ mpn "0805W8F1200T5E" manufacturer="UNI-ROYAL" kind=resistor value="120Ω" {
catalog lcsc="C17437"
}

// The design keeps its original identifier. Stackup derives every footprint's UUID from the design
// name and the part's path, so renaming it would make the KiCad sync delete and re-place every part
// on the routed board. The project itself is DroidCANBridge.
design droidcanadapter {
stock { packages imperial="0603" }

Expand Down
Loading
Loading