POG422 Pi handshake / FPC mapping

Design notes for moving M-S and OIS handshake lines off XR UART GPIO onto Seeed Dual Ethernet J19 (3.3 V level-shifted). Export of agent response, 2026-08-10.

Mapping kit for when the flex lands — grounded in what’s already true in the tree, with the 5.52 M-S / OIS names and the Seeed Dual GbE J19 FPC as the Pi landing.

1. Rename (docs / silk / schematics)

Legacy (today in code/docs) 5.52 name Role
SLV (machine / ch B) M-S Master↔Slave gameplay copper (machine bus)
MST (legacy “master ch A”) OIS OIS plane (ttyXRUSB0 / former MST block)
SLV-HS M-S HS Half-duplex handshake pair for the machine bus
SLV-OUT M-S_OUT Drive: “we own the bus / DE”
SLV-IN M-S_IN Sense: HS active (often same physical pair via RX path)
MST-OUT OIS_OUT Drive OIS DE / HS out
MST-IN OIS_IN Sense OIS HS in

Software still says SLV_* / GPIO7 heavily; rename can trail the PCB. Prefer new names on the flex silk + netlist first.

2. What those four nets are today (XR path)

On the XR21B1422 hat (present software path), effective roles are:

Net XR side (today) Direction (Pi bridge) Function
M-S_OUT (SLV-OUT) GPIOB7 manual DE Pi → bus Assert before TX, release after TEMT / air margin so Master can reply
M-S_IN (SLV-IN) GPIOB1 / CD bus → Pi HS sense; inject forensics / wait-for-idle
OIS_OUT (MST-OUT) GPIOA7 often RS485_EN_ACT auto Pi → OIS DE tracks OIS UART today
OIS_IN (MST-IN) A-side HS sense (mirror of B) OIS → Pi OIS HS window edges

Important bus rule (unchanged with new names): only the sender drives HS; peers wait for idle. Drop HS mid-frame and T340+ trashes the packet. Spec: FIXTURE_TOPOLOGY.md SLV-HS section + XR README channel/GPIO table.

Physics on Rev D HAT: RS-422 sense is often 5 V-domain (SLV_HS at LED/R6); TXS0108E makes 3.3 V SLV-IN into the XR. Your new path is: post TXS / 3.3 V clean logic → flex → Seeed J19 → CM GPIO. Keep all four nets 3.3 V class at the FPC; never put 5 V on RP1/CM I/O.

3. Seeed landing: J19 I/O FPC (limited)

Documented in HS_GPIO_TAP.md (Seeed CM4 Dual GbE, J19 Molex 525590834). Verified physical map 2026-08-11 (j19_io_mapper + probe). Seeed schematic sheet 13 is reversed vs FPC pad order — use this table only:

Phys. pin I/O Line (mapper) BCM / net Notes
1 8 GPIO11 SPI0 SCLK
2 7 GPIO9 SPI0 MISO — preferred HS tap
3 6 GPIO10 SPI0 MOSI
4 5 GPIO8 SPI0 CE0
5 4 GPIO2 LED1 / EtherGold — green, active-low (see §4a)
6 3 GPIO3 LED2 / DyzineFrame — green, active-low (see §4a)
7 — nc No flex GND — USB already bonds grounds (loop risk)
8 — nc No 3.3 V on flex — Seeed DCDC_3V3 must not fight HAT regulator
Flex is signals only: four HS nets + two status LEDs. No rails on pins 7–8. Disable I2C on the carrier when driving LED outs on GPIO2/3.

So the flex should be labeled with both:

  1. Connector pin number (1–8)
  2. Intended electrical net (M-S_IN, LED1, …)

And bring-up must map pin→BCM by electrical test, not by PDF alone.

Six data pins used (four HS + two LEDs). Fan pins GPIO12/17 stay committed.

4. Recommended net → strip / J19 assignment (verified 2026-08-11)

Strip pin = 0.5 mm FPC breakout pin 1…8 (same numbers as j19_io_mapper physical walk). HS on SPI bank; status LEDs on GPIO2/3 (disable dtparam=i2c_arm).

Flex net Dir at Pi Strip pin BCM / GPIO Why
M-S_OUT out 1 11 Machine DE is timing-critical; clean SPI-bank out
M-S_IN in 2 9 Machine HS sense; interrupt-friendly
OIS_OUT out 3 10 OIS DE
OIS_IN in 4 8 OIS HS sense
LED1 (EtherGold) out (sink) 5 2 EG status — exclusive EtherGold
LED2 (DyzineFrame) out (sink) 6 3 DF status — exclusive DyzineFrame
(nc) — 7 — No flex GND when USB already bonds Pi↔HAT (avoid loop)
(nc) — 8 — No 3.3 V — Seeed DCDC_3V3 must not fight HAT regulator

4a. Status LEDs (LED1 / LED2)

Two green indicators only — not the HAT DS1 bargraph (DS1 is hardwired to bus signals). ~2–5 mA; no external driver.

Ref Owner Strip pin BCM Wiring (active-low / sink)
LED1 (R11) EtherGold 5 2 HAT VDD → R11 470 Ω → LED1 anode → cathode → J5 pin 5 → Pi GPIO2 (drive low = on). Netlist: N$30
LED2 (R12) DyzineFrame 6 3 HAT VDD → R12 470 Ω → LED2 anode → cathode → J5 pin 6 → Pi GPIO3 (drive low = on). Netlist: N$38
# Suggested software constants
EG_STATUS_LED_GPIO=2    # strip pin 5, LED1 EtherGold
DF_STATUS_LED_GPIO=3    # strip pin 6, LED2 DyzineFrame
# Active-low: write 0 = on, 1 = off

Do not put HS _OUT nets on strip pins 5–6 (GPIO2/3) — reserved for LED1/LED2.

Active level for M-S: today active-high on manual GPIO7 assert for TX DE; HS sense polarity on the tap was active-low LED domain — your 3.3 V post-TXS nets may be inverted relative to LED (same as current XR SI). Capture polarity once on the flex nets with a scope/logger before software assumes.

4b. HAT J5 vs Seeed strip (netlist v2, 2026-08-11)

Source: POG-COM-PI-HAT-REV_E__Netlist_v3.txt. FPC is signal-only (no rails). Jumpers select who drives OUT: center pin = *_OUT_3.3, outer pins = UART vs PI.

J5 pin Net (Rev E) Also on Seeed strip / BCM
1 M-S-OUT_PI J3 pin 3 (jumper to M-S-OUT_3.3) 1 / GPIO11
2 M-S-IN_3.3 XR GPIOB1, TXS A3 2 / GPIO9
3 OIS-OUT_PI J4 pin 1 (jumper to OIS-OUT_3.3) 3 / GPIO10
4 OIS-IN_3.3 XR GPIOA1, TXS A8 4 / GPIO8
5 LED1 cathode (N$30) LED1 EtherGold sink 5 / GPIO2
6 LED2 cathode (N$38) LED2 DyzineFrame sink 6 / GPIO3
7 (no net) nc — no flex GND 7 nc
8 (no net) nc — no flex 3.3 V 8 nc

Status LEDs are on the HAT, fed from HAT VDD (regulator) through R11/R12 (470 Ω), not from Seeed DCDC_3V3 over the flex. Current return: HAT VDD → R → LED → J5 → Pi GPIO sink → Pi/USB ground bond → HAT GND.

5. Mapping process (when flex arrives)

Treat this as a signed pin map artifact, not a one-time guess.

  1. Cold continuity
    Flex unplugged: ohm-test HAT pad → FFC pad → expected pin number.
  2. Dead-Pi pinctrl sweep (all 6 signals)
    With flex plugged, no POG bus traffic:
    # For each candidate BCM on J19: enable internal pull up, then down, watch line.
    pinctrl get 2 3 8 9 10 11
    # For OUT nets: briefly drive high/low under controlled script;
    # confirm HAT side at TXS A-side / OUT pad.
    Fill:
    Net J19 pin Measured BCM Dir Idle level Active on TX / peer HS
           
  3. Single-net live proof
    • Only M-S_OUT: manually assert/release around a known inject; confirm HS LED/scope.
    • Only M-S_IN: peer TX; edge count vs copper.
    • Repeat OIS.
  4. Lock file
    e.g. /etc/ethergold/hs_gpio.env / pog422_hs_pi.env:
    MS_OUT_GPIO=11
    MS_IN_GPIO=9
    OIS_OUT_GPIO=10
    OIS_IN_GPIO=8
    MS_ACTIVE_HIGH=1
    OIS_ACTIVE_HIGH=1
    Same pattern as today’s HS_GPIO_LINE=3 for the diagnostic tap.
  5. Software phase (later, separate rev)
    Today DE/sense is XR ioctl (SET_GPIO7, GET_SLV_IN, table-8 GPIO INT). Pi-native path means uartd/inject grow a gpiod / sysfs backend while UART stays on XRUSB — that is the big software revisiting, not the flex day-one. Mapping first.

6. What to freeze on the flex this week

7. Open decisions (for you / next session)

  1. Active levels of the four 3.3 V nets (post-shift): match XR today or invert once at the flex and say so in silk?
  2. OIS_OUT: stay hardware-auto (tied to OIS UART TX sense) vs always software-driven like M-S? Software prefers software-driven for clean DE.
  3. Will M-S_IN/OUT still be galvanically the same RS-422 pair, or separate single-ended already after the HAT front-end? (matters for which pad you label OUT vs IN)
  4. After flex BOM is fixed, write POG422_PI_HS_MAP.md (or extend HS_GPIO_TAP.md) with the measured table and config keys — before coding the Pi GPIO backend.
Do not invent a final BCM map until a flex continuity + pinctrl pass says so. When the flex is here, run the mapping process and lock a four-row table for tooling/software.