# I2S HAT — KiCad Handoff for Shawn

## What's Done (in Gitea, commit 0ae2ca6)

- **Schematic** (`hardware/pi-multifx-hat.kicad_sch`) — all 5 pages drawn:
  - Page 1: Power regulation (AMS1117-3.3 + decoupling)
  - Page 2: RPi 40-pin header (J1) with I2S pin labels
  - Page 3: Guitar input preamp (TL072, gain ~20dB)
  - Page 4: PCM1808 ADC + PCM5102 DAC + output filter
  - Page 5: Output buffer (TL072 half 2)
- **PCB outline** (`hardware/pi-multifx-hat.kicad_pcb`) — 65×56mm, 4 mounting holes
- **Project file** (`hardware/pi-multifx-hat.kicad_pro`) — 2-layer, 0.254mm min track
- **DT overlay** (`hardware/pcm1808-pcm5102-overlay.dts`)
- **BOM** (`docs/hardware-bom.md`)
- **Fab instructions** (`hardware/gerber/fabrication-readme.md`)
- **Install script** (`scripts/install_hat.sh`)

## What Needs You (KiCad GUI on your machine)

1. **Open the project** in KiCad 8.0+ on your machine
2. **Assign footprints** — the schematic uses generic `Device:IC` symbols. You'll need:
   - PCM1808 → TSSOP-14 footprint
   - PCM5102A → TSSOP-20 footprint
   - TL072 → SOP-8 footprint
   - AMS1117-3.3 → SOT-223 footprint
   - 0805 passives (caps + resistors)
   - 6.35mm audio jacks (panel-mount)
   - 2×20 female stacking header
3. **Update PCB from Schematic** — KiCad menu: Tools → Update PCB from Schematic
4. **Place components** on the 65×56mm board
5. **Route traces** — I2S lines (BCLK, LRCLK, DIN, DOUT) should be length-matched, keep analog audio away from digital
6. **GND flood fill** both layers
7. **Run DRC** — Design Rules Check
8. **Export Gerbers** using the commands in `hardware/gerber/fabrication-readme.md`
9. **Upload to JLCPCB** — ~$29.25/board, 5 minimum

## Design Decisions (from coder's review)

| Decision | Value |
|----------|-------|
| Preamp gain | ~20dB (1MΩ input Z, TL072 non-inverting) |
| Regulator | AMS1117-3.3 from RPi 5V rail |
| ADC config | PCM1808: I2S mode, 48kHz, always active |
| DAC config | PCM5102: low-latency filter, unmuted |
| Output filter | 330Ω + 10µF RC for hiss reduction |
| I2S pins | BCLK=GPIO18, LRCLK=GPIO19, DIN=GPIO20, DOUT=GPIO21 |
| Board size | 65×56mm (1590B enclosure) |
| Surface finish | ENIG (gold) preferred for audio |
| JLCPCB parts | PCM1808(C469019), PCM5102A(C965928), TL072(C8290), AMS1117(C6078) |

## After Boards Arrive

1. Solder the through-hole parts (jacks, header, electrolytics)
2. Install the DT overlay: `sudo bash scripts/install_hat.sh`
3. Swap `hw:1,0` (Focusrite USB) → `hw:0,0` (I2S HAT) in JACK config
4. Test noise floor (< -90dB target)
5. Mount in 1590B enclosure
