- 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
86 lines
3.2 KiB
Markdown
86 lines
3.2 KiB
Markdown
# HMC472A Attenuator Controller Wiring
|
||
|
||
## Connection Diagram
|
||
|
||

|
||
|
||
## 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
|