From b5794c5f8d2ad3b8dec8094bb8709ddd75d36f11 Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Tue, 3 Feb 2026 00:04:56 -0700 Subject: [PATCH] Add hardware wiring documentation and KiCad schematic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - wiring.md: Pin mapping table, module pinout, logic levels - wiring-diagram.svg: Visual connection diagram (S2 Mini ↔ HMC472A) - hmc472-controller.kicad_pro/sch: KiCad project for EDA work GPIO1-6 → V1-V6 (active-low, 16/8/4/2/1/0.5 dB) 5V VBUS → +5V, GND → GND --- hardware/hmc472-controller.kicad_pro | 120 ++++++++ hardware/hmc472-controller.kicad_sch | 434 +++++++++++++++++++++++++++ hardware/wiring-diagram.svg | 138 +++++++++ hardware/wiring.md | 85 ++++++ 4 files changed, 777 insertions(+) create mode 100644 hardware/hmc472-controller.kicad_pro create mode 100644 hardware/hmc472-controller.kicad_sch create mode 100644 hardware/wiring-diagram.svg create mode 100644 hardware/wiring.md diff --git a/hardware/hmc472-controller.kicad_pro b/hardware/hmc472-controller.kicad_pro new file mode 100644 index 0000000..308e71f --- /dev/null +++ b/hardware/hmc472-controller.kicad_pro @@ -0,0 +1,120 @@ +{ + "board": { + "3dviewports": [], + "design_settings": { + "defaults": {}, + "diff_pair_dimensions": [], + "drc_exclusions": [], + "rules": {}, + "track_widths": [], + "via_dimensions": [] + }, + "ipc2581": { + "dist": "", + "distpn": "", + "internal_id": "", + "mfg": "", + "mpn": "" + }, + "layer_presets": [], + "viewports": [] + }, + "boards": [], + "cvpcb": { + "equivalence_files": [] + }, + "libraries": { + "pinned_footprint_libs": [], + "pinned_symbol_libs": [] + }, + "meta": { + "filename": "hmc472-controller.kicad_pro", + "version": 1 + }, + "net_settings": { + "classes": [ + { + "name": "Default", + "wire_width": 6 + } + ], + "meta": { + "version": 3 + }, + "net_colors": null, + "netclass_assignments": null, + "netclass_patterns": [] + }, + "pcbnew": { + "last_paths": { + "gencad": "", + "idf": "", + "netlist": "", + "plot": "", + "pos_files": "", + "specctra_dsn": "", + "step": "", + "svg": "", + "vrml": "" + }, + "page_layout_descr_file": "" + }, + "schematic": { + "annotate_start_num": 0, + "bom_fmt_presets": [], + "bom_fmt_settings": { + "field_delimiter": ",", + "keep_line_breaks": false, + "keep_tabs": false, + "name": "", + "ref_delimiter": ",", + "ref_range_delimiter": "", + "string_delimiter": "\"" + }, + "bom_presets": [], + "drawing": { + "dashed_lines_dash_length_ratio": 12.0, + "dashed_lines_gap_length_ratio": 3.0, + "default_line_thickness": 6.0, + "default_text_size": 50.0, + "field_names": [], + "intersheets_ref_own_page": false, + "intersheets_ref_prefix": "", + "intersheets_ref_short": false, + "intersheets_ref_show": false, + "intersheets_ref_suffix": "", + "junction_size_choice": 3, + "label_size_ratio": 0.375, + "operating_point_overlay_i_precision": 3, + "operating_point_overlay_i_range": "~A", + "operating_point_overlay_v_precision": 3, + "operating_point_overlay_v_range": "~V", + "overbar_offset_ratio": 1.23, + "pin_symbol_size": 25.0, + "text_offset_ratio": 0.15 + }, + "legacy_lib_dir": "", + "legacy_lib_list": [], + "meta": { + "version": 1 + }, + "net_format_name": "", + "page_layout_descr_file": "", + "plot_directory": "", + "ng_spice": { + "fix_include_paths": true, + "meta": { + "version": 0 + }, + "model_mode": 0, + "ngspice_path": "" + } + }, + "sheets": [ + [ + "e63e39d7-6ac0-4ffd-8aa3-1841a4541b55", + "Root" + ] + ], + "text_variables": {} +} diff --git a/hardware/hmc472-controller.kicad_sch b/hardware/hmc472-controller.kicad_sch new file mode 100644 index 0000000..f0a4ac7 --- /dev/null +++ b/hardware/hmc472-controller.kicad_sch @@ -0,0 +1,434 @@ +(kicad_sch + (version 20231120) + (generator "eeschema") + (generator_version "8.0") + (uuid "e63e39d7-6ac0-4ffd-8aa3-1841a4541b55") + (paper "A4") + (title_block + (title "HMC472A Attenuator Controller") + (date "2026-02-02") + (rev "1.0") + (comment 1 "ESP32-S2 Mini to HMC472A Module Wiring") + (comment 2 "6-bit Digital RF Attenuator 0-31.5dB") + ) + + (lib_symbols + (symbol "Connector_Generic:Conn_01x08" + (pin_names (offset 1.016) hide) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "J" + (at 0 10.16 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "Conn_01x08" + (at 0 -12.7 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" + (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" + (at 0 0 0) + (effects (font (size 1.27 1.27)) hide) + ) + (symbol "Conn_01x08_1_1" + (rectangle (start -1.27 7.62) (end 1.27 -10.16) + (stroke (width 0.254) (type default)) + (fill (type background)) + ) + (pin passive line (at -5.08 7.62 0) (length 3.81) (name "Pin_1" (effects (font (size 1.27 1.27)))) (number "1" (effects (font (size 1.27 1.27))))) + (pin passive line (at -5.08 5.08 0) (length 3.81) (name "Pin_2" (effects (font (size 1.27 1.27)))) (number "2" (effects (font (size 1.27 1.27))))) + (pin passive line (at -5.08 2.54 0) (length 3.81) (name "Pin_3" (effects (font (size 1.27 1.27)))) (number "3" (effects (font (size 1.27 1.27))))) + (pin passive line (at -5.08 0 0) (length 3.81) (name "Pin_4" (effects (font (size 1.27 1.27)))) (number "4" (effects (font (size 1.27 1.27))))) + (pin passive line (at -5.08 -2.54 0) (length 3.81) (name "Pin_5" (effects (font (size 1.27 1.27)))) (number "5" (effects (font (size 1.27 1.27))))) + (pin passive line (at -5.08 -5.08 0) (length 3.81) (name "Pin_6" (effects (font (size 1.27 1.27)))) (number "6" (effects (font (size 1.27 1.27))))) + (pin passive line (at -5.08 -7.62 0) (length 3.81) (name "Pin_7" (effects (font (size 1.27 1.27)))) (number "7" (effects (font (size 1.27 1.27))))) + (pin passive line (at -5.08 -10.16 0) (length 3.81) (name "Pin_8" (effects (font (size 1.27 1.27)))) (number "8" (effects (font (size 1.27 1.27))))) + ) + ) + ) + + (text "ESP32-S2 Mini\n(WEMOS/LOLIN)" + (exclude_from_sim no) + (at 63.5 50.8 0) + (effects (font (size 2.54 2.54) bold) (justify left)) + (uuid "text-esp32-title") + ) + + (text "HMC472A Module\n6-bit RF Attenuator" + (exclude_from_sim no) + (at 152.4 50.8 0) + (effects (font (size 2.54 2.54) bold) (justify left)) + (uuid "text-hmc472-title") + ) + + (text "ACTIVE LOW LOGIC:\nLOW = Attenuate\nHIGH = Pass (0 dB)" + (exclude_from_sim no) + (at 109.22 130.81 0) + (effects (font (size 1.524 1.524)) (justify left)) + (uuid "text-logic-note") + ) + + (text "Control Pins (active-low):" + (exclude_from_sim no) + (at 152.4 60.96 0) + (effects (font (size 1.524 1.524)) (justify left)) + (uuid "text-control-header") + ) + + (symbol + (lib_id "Connector_Generic:Conn_01x08") + (at 76.2 78.74 0) + (mirror y) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (uuid "esp32-s2-mini-header") + (property "Reference" "J1" + (at 76.2 60.96 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "ESP32-S2 Mini" + (at 76.2 93.98 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" + (at 76.2 78.74 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" + (at 76.2 78.74 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" + (uuid "esp32-pin1") + ) + (pin "2" + (uuid "esp32-pin2") + ) + (pin "3" + (uuid "esp32-pin3") + ) + (pin "4" + (uuid "esp32-pin4") + ) + (pin "5" + (uuid "esp32-pin5") + ) + (pin "6" + (uuid "esp32-pin6") + ) + (pin "7" + (uuid "esp32-pin7") + ) + (pin "8" + (uuid "esp32-pin8") + ) + (instances + (project "hmc472-controller" + (path "/e63e39d7-6ac0-4ffd-8aa3-1841a4541b55" + (reference "J1") + (unit 1) + ) + ) + ) + ) + + (symbol + (lib_id "Connector_Generic:Conn_01x08") + (at 160.02 78.74 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (uuid "hmc472-module-header") + (property "Reference" "J2" + (at 160.02 60.96 0) + (effects (font (size 1.27 1.27))) + ) + (property "Value" "HMC472A Module" + (at 160.02 93.98 0) + (effects (font (size 1.27 1.27))) + ) + (property "Footprint" "" + (at 160.02 78.74 0) + (effects (font (size 1.27 1.27)) hide) + ) + (property "Datasheet" "~" + (at 160.02 78.74 0) + (effects (font (size 1.27 1.27)) hide) + ) + (pin "1" + (uuid "hmc472-pin1") + ) + (pin "2" + (uuid "hmc472-pin2") + ) + (pin "3" + (uuid "hmc472-pin3") + ) + (pin "4" + (uuid "hmc472-pin4") + ) + (pin "5" + (uuid "hmc472-pin5") + ) + (pin "6" + (uuid "hmc472-pin6") + ) + (pin "7" + (uuid "hmc472-pin7") + ) + (pin "8" + (uuid "hmc472-pin8") + ) + (instances + (project "hmc472-controller" + (path "/e63e39d7-6ac0-4ffd-8aa3-1841a4541b55" + (reference "J2") + (unit 1) + ) + ) + ) + ) + + (text "5V (VBUS)" + (exclude_from_sim no) + (at 63.5 71.12 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid "label-esp-5v") + ) + + (text "GPIO1" + (exclude_from_sim no) + (at 63.5 73.66 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid "label-esp-gpio1") + ) + + (text "GPIO2" + (exclude_from_sim no) + (at 63.5 76.2 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid "label-esp-gpio2") + ) + + (text "GPIO3" + (exclude_from_sim no) + (at 63.5 78.74 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid "label-esp-gpio3") + ) + + (text "GPIO4" + (exclude_from_sim no) + (at 63.5 81.28 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid "label-esp-gpio4") + ) + + (text "GPIO5" + (exclude_from_sim no) + (at 63.5 83.82 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid "label-esp-gpio5") + ) + + (text "GPIO6" + (exclude_from_sim no) + (at 63.5 86.36 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid "label-esp-gpio6") + ) + + (text "GND" + (exclude_from_sim no) + (at 63.5 88.9 0) + (effects (font (size 1.27 1.27)) (justify right)) + (uuid "label-esp-gnd") + ) + + (text "+5V" + (exclude_from_sim no) + (at 172.72 71.12 0) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid "label-hmc-5v") + ) + + (text "V6 (0.5dB)" + (exclude_from_sim no) + (at 172.72 73.66 0) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid "label-hmc-v6") + ) + + (text "V5 (1dB)" + (exclude_from_sim no) + (at 172.72 76.2 0) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid "label-hmc-v5") + ) + + (text "V4 (2dB)" + (exclude_from_sim no) + (at 172.72 78.74 0) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid "label-hmc-v4") + ) + + (text "V3 (4dB)" + (exclude_from_sim no) + (at 172.72 81.28 0) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid "label-hmc-v3") + ) + + (text "V2 (8dB)" + (exclude_from_sim no) + (at 172.72 83.82 0) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid "label-hmc-v2") + ) + + (text "V1 (16dB)" + (exclude_from_sim no) + (at 172.72 86.36 0) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid "label-hmc-v1") + ) + + (text "GND" + (exclude_from_sim no) + (at 172.72 88.9 0) + (effects (font (size 1.27 1.27)) (justify left)) + (uuid "label-hmc-gnd") + ) + + (wire + (pts (xy 81.28 71.12) (xy 154.94 71.12)) + (stroke (width 0) (type default)) + (uuid "wire-5v") + ) + + (wire + (pts (xy 81.28 73.66) (xy 127 73.66)) + (stroke (width 0) (type default)) + (uuid "wire-gpio1-a") + ) + (wire + (pts (xy 127 73.66) (xy 127 86.36)) + (stroke (width 0) (type default)) + (uuid "wire-gpio1-b") + ) + (wire + (pts (xy 127 86.36) (xy 154.94 86.36)) + (stroke (width 0) (type default)) + (uuid "wire-gpio1-c") + ) + + (wire + (pts (xy 81.28 76.2) (xy 124.46 76.2)) + (stroke (width 0) (type default)) + (uuid "wire-gpio2-a") + ) + (wire + (pts (xy 124.46 76.2) (xy 124.46 83.82)) + (stroke (width 0) (type default)) + (uuid "wire-gpio2-b") + ) + (wire + (pts (xy 124.46 83.82) (xy 154.94 83.82)) + (stroke (width 0) (type default)) + (uuid "wire-gpio2-c") + ) + + (wire + (pts (xy 81.28 78.74) (xy 121.92 78.74)) + (stroke (width 0) (type default)) + (uuid "wire-gpio3-a") + ) + (wire + (pts (xy 121.92 78.74) (xy 121.92 81.28)) + (stroke (width 0) (type default)) + (uuid "wire-gpio3-b") + ) + (wire + (pts (xy 121.92 81.28) (xy 154.94 81.28)) + (stroke (width 0) (type default)) + (uuid "wire-gpio3-c") + ) + + (wire + (pts (xy 81.28 81.28) (xy 119.38 81.28)) + (stroke (width 0) (type default)) + (uuid "wire-gpio4-a") + ) + (wire + (pts (xy 119.38 81.28) (xy 119.38 78.74)) + (stroke (width 0) (type default)) + (uuid "wire-gpio4-b") + ) + (wire + (pts (xy 119.38 78.74) (xy 154.94 78.74)) + (stroke (width 0) (type default)) + (uuid "wire-gpio4-c") + ) + + (wire + (pts (xy 81.28 83.82) (xy 116.84 83.82)) + (stroke (width 0) (type default)) + (uuid "wire-gpio5-a") + ) + (wire + (pts (xy 116.84 83.82) (xy 116.84 76.2)) + (stroke (width 0) (type default)) + (uuid "wire-gpio5-b") + ) + (wire + (pts (xy 116.84 76.2) (xy 154.94 76.2)) + (stroke (width 0) (type default)) + (uuid "wire-gpio5-c") + ) + + (wire + (pts (xy 81.28 86.36) (xy 114.3 86.36)) + (stroke (width 0) (type default)) + (uuid "wire-gpio6-a") + ) + (wire + (pts (xy 114.3 86.36) (xy 114.3 73.66)) + (stroke (width 0) (type default)) + (uuid "wire-gpio6-b") + ) + (wire + (pts (xy 114.3 73.66) (xy 154.94 73.66)) + (stroke (width 0) (type default)) + (uuid "wire-gpio6-c") + ) + + (wire + (pts (xy 81.28 88.9) (xy 154.94 88.9)) + (stroke (width 0) (type default)) + (uuid "wire-gnd") + ) + + (text "Wiring Table:\nGPIO1 → V1 (16dB)\nGPIO2 → V2 (8dB)\nGPIO3 → V3 (4dB)\nGPIO4 → V4 (2dB)\nGPIO5 → V5 (1dB)\nGPIO6 → V6 (0.5dB)\n5V → +5V\nGND → GND" + (exclude_from_sim no) + (at 63.5 111.76 0) + (effects (font (size 1.524 1.524)) (justify left)) + (uuid "text-wiring-table") + ) + + (text "Notes:\n• HMC472A accepts 0-5V TTL/CMOS logic\n• ESP32-S2 GPIO is 3.3V — compatible\n• Total attenuation = sum of active bits\n• Max attenuation: 31.5 dB (all LOW)\n• Min attenuation: 0 dB (all HIGH)" + (exclude_from_sim no) + (at 127 111.76 0) + (effects (font (size 1.524 1.524)) (justify left)) + (uuid "text-notes") + ) +) diff --git a/hardware/wiring-diagram.svg b/hardware/wiring-diagram.svg new file mode 100644 index 0000000..2583556 --- /dev/null +++ b/hardware/wiring-diagram.svg @@ -0,0 +1,138 @@ + + + + + + + + HMC472A Attenuator Controller Wiring + ESP32-S2 Mini to HMC472A Module Connection Diagram + + + + ESP32-S2 Mini + (WEMOS/LOLIN) + + + + USB-C + + + + ESP32-S2 + + + + + 3V3 + GPIO1 + GPIO2 + GPIO3 + GPIO4 + GPIO5 + GPIO6 + GND + + + + + 5V + GND + + + + + HMC472A Module + 6-bit RF Attenuator + + + + HMC472A + + + + RF IN + + RF OUT + + + + +5V + V6 (0.5dB) + V5 (1dB) + V4 (2dB) + V3 (4dB) + V2 (8dB) + V1 (16dB) + GND + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Wiring Summary + + Power (+5V) + + Ground + + Data (GPIO→Vx) + Active-LOW: LOW=Attenuate, HIGH=Pass + diff --git a/hardware/wiring.md b/hardware/wiring.md new file mode 100644 index 0000000..8034d00 --- /dev/null +++ b/hardware/wiring.md @@ -0,0 +1,85 @@ +# HMC472A Attenuator Controller Wiring + +## Connection Diagram + +![Wiring Diagram](wiring-diagram.svg) + +## Pin Mapping Table + +| ESP32-S2 Mini | HMC472A Module | Function | Attenuation | +|---------------|----------------|----------|-------------| +| GPIO1 | V1 | Bit 5 (MSB) | 16 dB | +| GPIO2 | V2 | Bit 4 | 8 dB | +| GPIO3 | V3 | Bit 3 | 4 dB | +| GPIO4 | V4 | Bit 2 | 2 dB | +| GPIO5 | V5 | Bit 1 | 1 dB | +| GPIO6 | V6 | Bit 0 (LSB) | 0.5 dB | +| 5V (VBUS) | +5V | Power | — | +| GND | GND | Ground | — | + +## HMC472A Module Header Pinout + +The 8-pin header on the HMC472A module (top to bottom when viewing from component side): + +| Pin | Signal | Description | +|-----|----------|--------------------------| +| 1 | +5V | Power supply (+5V DC) | +| 2 | V6 | 0.5 dB control (active-low) | +| 3 | V5 | 1 dB control (active-low) | +| 4 | V4 | 2 dB control (active-low) | +| 5 | V3 | 4 dB control (active-low) | +| 6 | V2 | 8 dB control (active-low) | +| 7 | V1 | 16 dB control (active-low) | +| 8 | GND | Ground | + +## Logic Levels + +**Active-LOW control:** +- **LOW (0V)** = Attenuate (apply the dB value) +- **HIGH (3.3V or 5V)** = Pass (0 dB contribution) + +The HMC472A accepts 0–5V TTL/CMOS logic. The ESP32-S2's 3.3V GPIO output is fully compatible. + +## Attenuation Examples + +| GPIO State (1-6) | Step | Total Attenuation | +|------------------|------|-------------------| +| `111111` (all HIGH) | 0 | 0 dB (insertion loss only) | +| `111110` | 1 | 0.5 dB | +| `111100` | 3 | 1.5 dB | +| `110000` | 15 | 7.5 dB | +| `100000` | 31 | 15.5 dB | +| `000000` (all LOW) | 63 | 31.5 dB | + +Formula: `attenuation = step × 0.5 dB` where step = 0–63 + +## ESP32-S2 Mini Physical Pinout + +``` + ┌─────────────────┐ + │ USB-C │ + └─────────────────┘ + 3V3 ─┤ 1 16 ├─ 5V (VBUS) ◄── Power to HMC472A + GPIO1 ─┤ 2 15 ├─ GPIO15 (LED) + GPIO2 ─┤ 3 14 ├─ GPIO14 + GPIO3 ─┤ 4 13 ├─ GPIO13 + GPIO4 ─┤ 5 12 ├─ GPIO12 + GPIO5 ─┤ 6 11 ├─ GPIO11 + GPIO6 ─┤ 7 10 ├─ GPIO10 + GND ─┤ 8 9 ├─ GPIO9 + └─────────────────┘ + (Left header) +``` + +GPIOs 1–6 are on the left header, pins 2–7. Convenient sequential layout for ribbon cable. + +## KiCad Schematic + +A full KiCad schematic is available at `hmc472-controller.kicad_sch` for detailed EDA work. + +## Notes + +1. **No level shifting required** — ESP32-S2 3.3V GPIO drives HMC472A directly +2. **Boot state** — GPIOs default HIGH at boot = 0 dB attenuation (safe) +3. **Glitch-free switching** — Firmware uses register-level writes (`GPIO.out_w1ts`/`GPIO.out_w1tc`) to change all 6 bits atomically +4. **Power** — The S2 Mini's 5V pin sources USB VBUS directly, sufficient for HMC472A's 2.5 mA draw