Wiring diagram: use net labels instead of wire traces

This commit is contained in:
Ryan Malloy 2026-02-03 10:56:56 -07:00
parent 86a5db5b08
commit a5b690530f

View File

@ -1,143 +1,214 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 520" width="800" height="520"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 420" width="800" height="420">
<defs> <defs>
<style> <style>
.board { fill: #1a472a; stroke: #0d2818; stroke-width: 2; } .board { fill: #1a472a; stroke: #0d2818; stroke-width: 2; }
.board-label { font-family: monospace; font-size: 14px; font-weight: bold; fill: white; } .board-label { font-family: monospace; font-size: 14px; font-weight: bold; fill: white; }
.pin-label { font-family: monospace; font-size: 11px; fill: #333; }
.pin-label-white { font-family: monospace; font-size: 10px; fill: #e0e0e0; } .pin-label-white { font-family: monospace; font-size: 10px; fill: #e0e0e0; }
.wire { stroke-width: 2.5; fill: none; }
.wire-data { stroke: #2196F3; }
.wire-power { stroke: #f44336; }
.wire-gnd { stroke: #333; }
.title { font-family: sans-serif; font-size: 18px; font-weight: bold; fill: #333; } .title { font-family: sans-serif; font-size: 18px; font-weight: bold; fill: #333; }
.subtitle { font-family: sans-serif; font-size: 12px; fill: #666; } .subtitle { font-family: sans-serif; font-size: 12px; fill: #666; }
.note { font-family: sans-serif; font-size: 11px; fill: #555; } .note { font-family: sans-serif; font-size: 11px; fill: #555; }
.note-box { fill: #e3f2fd; stroke: #1976d2; stroke-width: 1; rx: 5; }
.header { fill: #333; }
.pin { fill: #c9a227; stroke: #8b7355; stroke-width: 1; } .pin { fill: #c9a227; stroke: #8b7355; stroke-width: 1; }
.sma { fill: #c9a227; stroke: #8b7355; stroke-width: 1; } .sma { fill: #c9a227; stroke: #8b7355; stroke-width: 1; }
.usb { fill: #333; stroke: #222; stroke-width: 1; } .usb { fill: #333; stroke: #222; stroke-width: 1; }
.chip { fill: #1a1a1a; stroke: #333; stroke-width: 1; } .chip { fill: #1a1a1a; stroke: #333; stroke-width: 1; }
.net-label { font-family: monospace; font-size: 11px; font-weight: bold; }
.net-data { fill: #1565c0; }
.net-power { fill: #c62828; }
.net-gnd { fill: #333; }
.net-box { stroke-width: 1.5; fill: white; rx: 3; }
.net-box-data { stroke: #1565c0; }
.net-box-power { stroke: #c62828; }
.net-box-gnd { stroke: #333; }
.code { font-family: monospace; font-size: 10px; fill: #1565c0; } .code { font-family: monospace; font-size: 10px; fill: #1565c0; }
.table-header { font-family: sans-serif; font-size: 11px; font-weight: bold; fill: #333; }
.table-cell { font-family: monospace; font-size: 10px; fill: #444; }
</style> </style>
</defs> </defs>
<!-- Title --> <!-- Title -->
<text x="400" y="28" text-anchor="middle" class="title">HMC472A Attenuator Controller Wiring</text> <text x="400" y="28" text-anchor="middle" class="title">HMC472A Attenuator Controller Wiring</text>
<text x="400" y="46" text-anchor="middle" class="subtitle">Optimized Mapping: GPIO(n) = Step Bit (n-1) — Enables Direct Bitwise Ops</text> <text x="400" y="46" text-anchor="middle" class="subtitle">Optimized Mapping: GPIO(n) = Step Bit (n-1)</text>
<!-- ESP32-S2 Mini Board --> <!-- ESP32-S2 Mini Board -->
<rect x="80" y="80" width="180" height="260" rx="5" class="board"/> <rect x="60" y="70" width="160" height="220" rx="5" class="board"/>
<text x="170" y="102" text-anchor="middle" class="board-label">ESP32-S2 Mini</text> <text x="140" y="92" text-anchor="middle" class="board-label">ESP32-S2 Mini</text>
<text x="170" y="116" text-anchor="middle" class="pin-label-white">(WEMOS/LOLIN)</text>
<!-- USB-C on S2 Mini --> <!-- USB-C -->
<rect x="145" y="70" width="50" height="14" rx="3" class="usb"/> <rect x="115" y="62" width="50" height="12" rx="3" class="usb"/>
<text x="170" y="80" text-anchor="middle" style="font-size:8px;fill:#888;">USB-C</text> <text x="140" y="71" text-anchor="middle" style="font-size:7px;fill:#888;">USB-C</text>
<!-- ESP32 chip representation --> <!-- ESP32 chip -->
<rect x="130" y="130" width="80" height="50" rx="2" class="chip"/> <rect x="100" y="105" width="80" height="40" rx="2" class="chip"/>
<text x="170" y="160" text-anchor="middle" style="font-size:9px;fill:#666;">ESP32-S2</text> <text x="140" y="130" text-anchor="middle" style="font-size:9px;fill:#666;">ESP32-S2</text>
<!-- S2 Mini Pin Header (left side) --> <!-- S2 Mini Pins with net labels -->
<g transform="translate(85, 195)"> <g transform="translate(65, 160)">
<rect x="0" y="0" width="25" height="10" class="pin"/><text x="30" y="9" class="pin-label-white">3V3</text> <!-- Left side pins -->
<rect x="0" y="15" width="25" height="10" class="pin"/><text x="30" y="24" class="pin-label-white">GPIO1</text> <rect x="0" y="0" width="20" height="9" class="pin"/>
<rect x="0" y="30" width="25" height="10" class="pin"/><text x="30" y="39" class="pin-label-white">GPIO2</text> <text x="25" y="8" class="pin-label-white">3V3</text>
<rect x="0" y="45" width="25" height="10" class="pin"/><text x="30" y="54" class="pin-label-white">GPIO3</text>
<rect x="0" y="60" width="25" height="10" class="pin"/><text x="30" y="69" class="pin-label-white">GPIO4</text> <rect x="0" y="14" width="20" height="9" class="pin"/>
<rect x="0" y="75" width="25" height="10" class="pin"/><text x="30" y="84" class="pin-label-white">GPIO5</text> <text x="25" y="22" class="pin-label-white">GPIO1</text>
<rect x="0" y="90" width="25" height="10" class="pin"/><text x="30" y="99" class="pin-label-white">GPIO6</text> <rect x="70" y="11" width="42" height="14" class="net-box net-box-data"/>
<rect x="0" y="105" width="25" height="10" class="pin"/><text x="30" y="114" class="pin-label-white">GND</text> <text x="91" y="22" text-anchor="middle" class="net-label net-data">D0</text>
<rect x="0" y="28" width="20" height="9" class="pin"/>
<text x="25" y="36" class="pin-label-white">GPIO2</text>
<rect x="70" y="25" width="42" height="14" class="net-box net-box-data"/>
<text x="91" y="36" text-anchor="middle" class="net-label net-data">D1</text>
<rect x="0" y="42" width="20" height="9" class="pin"/>
<text x="25" y="50" class="pin-label-white">GPIO3</text>
<rect x="70" y="39" width="42" height="14" class="net-box net-box-data"/>
<text x="91" y="50" text-anchor="middle" class="net-label net-data">D2</text>
<rect x="0" y="56" width="20" height="9" class="pin"/>
<text x="25" y="64" class="pin-label-white">GPIO4</text>
<rect x="70" y="53" width="42" height="14" class="net-box net-box-data"/>
<text x="91" y="64" text-anchor="middle" class="net-label net-data">D3</text>
<rect x="0" y="70" width="20" height="9" class="pin"/>
<text x="25" y="78" class="pin-label-white">GPIO5</text>
<rect x="70" y="67" width="42" height="14" class="net-box net-box-data"/>
<text x="91" y="78" text-anchor="middle" class="net-label net-data">D4</text>
<rect x="0" y="84" width="20" height="9" class="pin"/>
<text x="25" y="92" class="pin-label-white">GPIO6</text>
<rect x="70" y="81" width="42" height="14" class="net-box net-box-data"/>
<text x="91" y="92" text-anchor="middle" class="net-label net-data">D5</text>
<rect x="0" y="98" width="20" height="9" class="pin"/>
<text x="25" y="106" class="pin-label-white">GND</text>
<rect x="70" y="95" width="42" height="14" class="net-box net-box-gnd"/>
<text x="91" y="106" text-anchor="middle" class="net-label net-gnd">GND</text>
</g> </g>
<!-- S2 Mini Pin Header (right side) --> <!-- Right side 5V -->
<g transform="translate(210, 195)"> <g transform="translate(175, 160)">
<rect x="0" y="0" width="25" height="10" class="pin"/><text x="-5" y="9" text-anchor="end" class="pin-label-white">5V</text> <rect x="0" y="0" width="20" height="9" class="pin"/>
<rect x="0" y="105" width="25" height="10" class="pin"/><text x="-5" y="114" text-anchor="end" class="pin-label-white">GND</text> <text x="-5" y="8" text-anchor="end" class="pin-label-white">5V</text>
<rect x="-47" y="-3" width="42" height="14" class="net-box net-box-power"/>
<text x="-26" y="8" text-anchor="middle" class="net-label net-power">+5V</text>
</g> </g>
<!-- HMC472A Module Board --> <!-- HMC472A Module Board -->
<rect x="520" y="80" width="200" height="260" rx="5" class="board"/> <rect x="520" y="70" width="220" height="220" rx="5" class="board"/>
<text x="620" y="102" text-anchor="middle" class="board-label">HMC472A Module</text> <text x="630" y="92" text-anchor="middle" class="board-label">HMC472A Module</text>
<text x="620" y="116" text-anchor="middle" class="pin-label-white">6-bit RF Attenuator</text>
<!-- HMC472A chip representation --> <!-- HMC472A chip -->
<rect x="555" y="130" width="60" height="40" rx="2" class="chip"/> <rect x="570" y="105" width="60" height="35" rx="2" class="chip"/>
<text x="585" y="155" text-anchor="middle" style="font-size:8px;fill:#666;">HMC472A</text> <text x="600" y="127" text-anchor="middle" style="font-size:8px;fill:#666;">HMC472A</text>
<!-- SMA Connectors --> <!-- SMA Connectors -->
<ellipse cx="540" cy="200" rx="15" ry="20" class="sma"/> <ellipse cx="545" cy="170" rx="12" ry="16" class="sma"/>
<text x="540" y="228" text-anchor="middle" class="pin-label-white">RF IN</text> <text x="545" y="192" text-anchor="middle" style="font-size:8px;" class="pin-label-white">RF IN</text>
<ellipse cx="700" cy="200" rx="15" ry="20" class="sma"/> <ellipse cx="715" cy="170" rx="12" ry="16" class="sma"/>
<text x="700" y="228" text-anchor="middle" class="pin-label-white">RF OUT</text> <text x="715" y="192" text-anchor="middle" style="font-size:8px;" class="pin-label-white">RF OUT</text>
<!-- HMC472A Control Header (8-pin) - optimized order --> <!-- HMC472A Pins with net labels -->
<g transform="translate(595, 250)"> <g transform="translate(595, 210)">
<rect x="0" y="0" width="25" height="10" class="pin"/><text x="30" y="9" class="pin-label-white">+5V</text> <rect x="0" y="0" width="20" height="9" class="pin"/>
<rect x="0" y="15" width="25" height="10" class="pin"/><text x="30" y="24" class="pin-label-white">V6 (0.5dB) bit0</text> <text x="25" y="8" class="pin-label-white">+5V</text>
<rect x="0" y="30" width="25" height="10" class="pin"/><text x="30" y="39" class="pin-label-white">V5 (1dB) bit1</text> <rect x="-47" y="-3" width="42" height="14" class="net-box net-box-power"/>
<rect x="0" y="45" width="25" height="10" class="pin"/><text x="30" y="54" class="pin-label-white">V4 (2dB) bit2</text> <text x="-26" y="8" text-anchor="middle" class="net-label net-power">+5V</text>
<rect x="0" y="60" width="25" height="10" class="pin"/><text x="30" y="69" class="pin-label-white">V3 (4dB) bit3</text>
<rect x="0" y="75" width="25" height="10" class="pin"/><text x="30" y="84" class="pin-label-white">V2 (8dB) bit4</text> <rect x="0" y="14" width="20" height="9" class="pin"/>
<rect x="0" y="90" width="25" height="10" class="pin"/><text x="30" y="99" class="pin-label-white">V1 (16dB) bit5</text> <text x="25" y="22" class="pin-label-white">V6 (0.5dB)</text>
<rect x="0" y="105" width="25" height="10" class="pin"/><text x="30" y="114" class="pin-label-white">GND</text> <rect x="-47" y="11" width="42" height="14" class="net-box net-box-data"/>
<text x="-26" y="22" text-anchor="middle" class="net-label net-data">D0</text>
<rect x="0" y="28" width="20" height="9" class="pin"/>
<text x="25" y="36" class="pin-label-white">V5 (1dB)</text>
<rect x="-47" y="25" width="42" height="14" class="net-box net-box-data"/>
<text x="-26" y="36" text-anchor="middle" class="net-label net-data">D1</text>
<rect x="0" y="42" width="20" height="9" class="pin"/>
<text x="25" y="50" class="pin-label-white">V4 (2dB)</text>
<rect x="-47" y="39" width="42" height="14" class="net-box net-box-data"/>
<text x="-26" y="50" text-anchor="middle" class="net-label net-data">D2</text>
<rect x="0" y="56" width="20" height="9" class="pin"/>
<text x="25" y="64" class="pin-label-white">V3 (4dB)</text>
<rect x="-47" y="53" width="42" height="14" class="net-box net-box-data"/>
<text x="-26" y="64" text-anchor="middle" class="net-label net-data">D3</text>
<rect x="0" y="70" width="20" height="9" class="pin"/>
<text x="25" y="78" class="pin-label-white">V2 (8dB)</text>
<rect x="-47" y="67" width="42" height="14" class="net-box net-box-data"/>
<text x="-26" y="78" text-anchor="middle" class="net-label net-data">D4</text>
<rect x="0" y="84" width="20" height="9" class="pin"/>
<text x="25" y="92" class="pin-label-white">V1 (16dB)</text>
<rect x="-47" y="81" width="42" height="14" class="net-box net-box-data"/>
<text x="-26" y="92" text-anchor="middle" class="net-label net-data">D5</text>
<rect x="0" y="98" width="20" height="9" class="pin"/>
<text x="25" y="106" class="pin-label-white">GND</text>
<rect x="-47" y="95" width="42" height="14" class="net-box net-box-gnd"/>
<text x="-26" y="106" text-anchor="middle" class="net-label net-gnd">GND</text>
</g> </g>
<!-- Wiring: Power (5V) - Red --> <!-- Connection table in the middle -->
<path d="M 235 200 H 280 V 100 H 560 V 250 H 595" class="wire wire-power"/> <rect x="260" y="120" width="200" height="180" rx="5" fill="#f5f5f5" stroke="#ddd"/>
<circle cx="235" cy="200" r="4" fill="#f44336"/> <text x="360" y="140" text-anchor="middle" class="table-header">Net Connections</text>
<circle cx="595" cy="255" r="4" fill="#f44336"/>
<!-- Wiring: GND - Black --> <line x1="270" y1="148" x2="450" y2="148" stroke="#ccc"/>
<path d="M 110 305 H 65 V 375 H 575 V 360 H 595" class="wire wire-gnd"/>
<circle cx="110" cy="305" r="4" fill="#333"/>
<circle cx="595" cy="360" r="4" fill="#333"/>
<!-- Straight-through data wiring (optimized - no crossovers!) --> <!-- Table headers -->
<!-- GPIO1 → V6 --> <text x="295" y="164" text-anchor="middle" class="table-header">Net</text>
<path d="M 110 215 H 60 V 365 H 590 V 270 H 595" class="wire wire-data"/> <text x="360" y="164" text-anchor="middle" class="table-header">ESP32</text>
<circle cx="110" cy="215" r="3" fill="#2196F3"/> <text x="425" y="164" text-anchor="middle" class="table-header">HMC472A</text>
<circle cx="595" cy="270" r="3" fill="#2196F3"/>
<!-- GPIO2 → V5 --> <line x1="270" y1="170" x2="450" y2="170" stroke="#ccc"/>
<path d="M 110 230 H 55 V 370 H 585 V 285 H 595" class="wire wire-data"/>
<circle cx="110" cy="230" r="3" fill="#2196F3"/>
<circle cx="595" cy="285" r="3" fill="#2196F3"/>
<!-- GPIO3 → V4 --> <!-- Table rows -->
<path d="M 110 245 H 50 V 375 H 580 V 300 H 595" class="wire wire-data"/> <text x="295" y="186" text-anchor="middle" class="table-cell" style="fill:#1565c0;font-weight:bold;">D0</text>
<circle cx="110" cy="245" r="3" fill="#2196F3"/> <text x="360" y="186" text-anchor="middle" class="table-cell">GPIO1</text>
<circle cx="595" cy="300" r="3" fill="#2196F3"/> <text x="425" y="186" text-anchor="middle" class="table-cell">V6 (0.5dB)</text>
<!-- GPIO4 → V3 --> <text x="295" y="202" text-anchor="middle" class="table-cell" style="fill:#1565c0;font-weight:bold;">D1</text>
<path d="M 110 260 H 45 V 380 H 575 V 315 H 595" class="wire wire-data"/> <text x="360" y="202" text-anchor="middle" class="table-cell">GPIO2</text>
<circle cx="110" cy="260" r="3" fill="#2196F3"/> <text x="425" y="202" text-anchor="middle" class="table-cell">V5 (1dB)</text>
<circle cx="595" cy="315" r="3" fill="#2196F3"/>
<!-- GPIO5 → V2 --> <text x="295" y="218" text-anchor="middle" class="table-cell" style="fill:#1565c0;font-weight:bold;">D2</text>
<path d="M 110 275 H 40 V 385 H 570 V 330 H 595" class="wire wire-data"/> <text x="360" y="218" text-anchor="middle" class="table-cell">GPIO3</text>
<circle cx="110" cy="275" r="3" fill="#2196F3"/> <text x="425" y="218" text-anchor="middle" class="table-cell">V4 (2dB)</text>
<circle cx="595" cy="330" r="3" fill="#2196F3"/>
<!-- GPIO6 → V1 --> <text x="295" y="234" text-anchor="middle" class="table-cell" style="fill:#1565c0;font-weight:bold;">D3</text>
<path d="M 110 290 H 35 V 390 H 565 V 345 H 595" class="wire wire-data"/> <text x="360" y="234" text-anchor="middle" class="table-cell">GPIO4</text>
<circle cx="110" cy="290" r="3" fill="#2196F3"/> <text x="425" y="234" text-anchor="middle" class="table-cell">V3 (4dB)</text>
<circle cx="595" cy="345" r="3" fill="#2196F3"/>
<text x="295" y="250" text-anchor="middle" class="table-cell" style="fill:#1565c0;font-weight:bold;">D4</text>
<text x="360" y="250" text-anchor="middle" class="table-cell">GPIO5</text>
<text x="425" y="250" text-anchor="middle" class="table-cell">V2 (8dB)</text>
<text x="295" y="266" text-anchor="middle" class="table-cell" style="fill:#1565c0;font-weight:bold;">D5</text>
<text x="360" y="266" text-anchor="middle" class="table-cell">GPIO6</text>
<text x="425" y="266" text-anchor="middle" class="table-cell">V1 (16dB)</text>
<line x1="270" y1="272" x2="450" y2="272" stroke="#ccc"/>
<text x="295" y="288" text-anchor="middle" class="table-cell" style="fill:#c62828;font-weight:bold;">+5V</text>
<text x="360" y="288" text-anchor="middle" class="table-cell">5V</text>
<text x="425" y="288" text-anchor="middle" class="table-cell">+5V</text>
<text x="295" y="304" text-anchor="middle" class="table-cell" style="fill:#333;font-weight:bold;">GND</text>
<text x="360" y="304" text-anchor="middle" class="table-cell">GND</text>
<text x="425" y="304" text-anchor="middle" class="table-cell">GND</text>
<!-- Footer note -->
<text x="400" y="340" text-anchor="middle" class="note">D0-D5 = Step bits 0-5 (LSB to MSB)</text>
<text x="400" y="356" text-anchor="middle" class="note">Active-LOW: D=1 → GPIO LOW → Attenuate</text>
<text x="400" y="380" text-anchor="middle" class="code">GPIO.out_w1tc = (step &amp; 0x3F) &lt;&lt; 1</text>
<!-- Legend --> <!-- Legend -->
<rect x="270" y="410" width="260" height="100" rx="5" class="note-box"/> <g transform="translate(280, 390)">
<text x="400" y="428" text-anchor="middle" style="font-weight:bold;" class="note">Optimized Bitwise Mapping</text> <rect x="0" y="0" width="30" height="12" class="net-box net-box-data"/>
<text x="35" y="10" class="note">Data</text>
<line x1="285" y1="445" x2="305" y2="445" stroke="#2196F3" stroke-width="3"/> <rect x="80" y="0" width="30" height="12" class="net-box net-box-power"/>
<text x="310" y="449" class="note">Data: GPIO(n) → V(7-n)</text> <text x="115" y="10" class="note">Power</text>
<rect x="160" y="0" width="30" height="12" class="net-box net-box-gnd"/>
<line x1="285" y1="465" x2="305" y2="465" stroke="#f44336" stroke-width="3"/> <text x="195" y="10" class="note">Ground</text>
<text x="310" y="469" class="note">Power (+5V from USB)</text> </g>
<line x1="285" y1="485" x2="305" y2="485" stroke="#333" stroke-width="3"/>
<text x="310" y="489" class="note">Ground</text>
<text x="400" y="503" text-anchor="middle" class="code">GPIO.out_w1tc = (step &amp; 0x3F) &lt;&lt; 1</text>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 11 KiB