---
title: VNA Hardware Trigger Wiring
description: Wire multiple NanoVNAs for Tier 2 synchronized measurements
---

import { Steps, Tabs, TabItem, Aside } from '@astrojs/starlight/components';

Hardware trigger synchronization (Tier 2) achieves ±10-50µs timing between VNAs—100x tighter than software coordination. This guide shows you how to wire the trigger lines between devices.

## When You Need This

| Use Case | Tier 1 (Software) | Tier 2 (Hardware Trigger) |
|----------|-------------------|---------------------------|
| Antenna comparison | ✓ | ✓ |
| SWR/impedance | ✓ | ✓ |
| Signal level measurements | ✓ | ✓ |
| Transmission path timing | Limited | ✓ |
| Differential S21 | Limited | ✓ |
| Multi-VNA transfer functions | ✗ | ✓ |

For phase-aligned measurements, you'll also need [external clock (Tier 3)](/hardware/external-clock/).

## Parts Needed

- Jumper wires (Dupont or similar)
- Soldering iron and solder (fine tip recommended)
- NanoVNA-H with custom firmware supporting trigger commands

<Aside type="caution">
This modification requires soldering to small test points. If you're not comfortable with fine soldering, consider having an experienced friend help.
</Aside>

## Pin Locations

The trigger system uses two GPIO pins on the STM32F303:

| Pin | Function | Location | Description |
|-----|----------|----------|-------------|
| **PA0** | TRIG_IN | See board diagram | External trigger input (rising edge) |
| **PB14** | TRIG_OUT | See board diagram | Pulse output at sweep start |

### NanoVNA-H Rev 3.4 Board

```
┌─────────────────────────────────────────┐
│                                         │
│   ┌───────────────────────┐             │
│   │                       │             │
│   │       LCD             │             │
│   │                       │             │
│   └───────────────────────┘             │
│                                         │
│                                         │
│   [PA0]●                      ●[PB14]   │
│   TRIG_IN                     TRIG_OUT  │
│                                         │
│   ┌──┐                         ┌──┐     │
│   │P1│                         │P2│     │
│   └──┘                         └──┘     │
│  Port 1                       Port 2    │
└─────────────────────────────────────────┘
```

<Aside type="note">
Pin locations vary by board revision. On some boards, these pins are on test points. On others, you may need to solder directly to the MCU. Consult your board's schematic.
</Aside>

## Wiring Steps

<Steps>
1. **Identify the leader VNA**

   Choose one VNA as the "leader"—it will generate the trigger pulse that starts all sweeps. The others are "followers."

2. **Solder wires to pins**

   On the **leader VNA**:
   - Solder a wire to **PB14** (TRIG_OUT)

   On each **follower VNA**:
   - Solder a wire to **PA0** (TRIG_IN)

   Use thin wire (30 AWG or similar) to avoid stressing the pads.

3. **Connect the trigger bus**

   Wire all followers' TRIG_IN lines to the leader's TRIG_OUT:

   ```
   Leader VNA                    Follower VNA #1
   ┌─────────┐                  ┌─────────┐
   │  PB14   │──────────────────│   PA0   │
   │(TRIG_OUT)│                  │(TRIG_IN) │
   └─────────┘         │        └─────────┘
                       │
                       │        Follower VNA #2
                       │        ┌─────────┐
                       └────────│   PA0   │
                                │(TRIG_IN) │
                                └─────────┘
   ```

   For more than 2 followers, daisy-chain or use a splitter.

4. **Verify ground reference**

   All VNAs share ground via USB (same host computer). No additional ground wire needed.

   If using VNAs on different computers, add a common ground wire.

5. **Test trigger signaling**

   Use a multimeter or oscilloscope to verify:
   - PB14 can be toggled (use `raw_command("trig_out pulse")`)
   - PA0 sees the pulse on followers

</Steps>

## Firmware Requirements

Stock NanoVNA firmware doesn't include trigger commands. You need custom firmware with:

| Command | Description |
|---------|-------------|
| `trig_mode {software\|hardware\|leader\|follower}` | Set trigger mode |
| `trig_out {on\|off\|pulse}` | Manual trigger control |
| `trig_status` | Read trigger state |

Check capability with `detect_capabilities()`:

```json
{
  "device_id": "0001234567",
  "capabilities": {
    "hardware_trigger": true,
    "external_clock": false
  },
  "tier": 2
}
```

<Aside type="tip">
See the NanoVNA-H community firmware for trigger-enabled builds, or build your own from the ChibiOS-based source.
</Aside>

## Using hardware_sync_sweep

Once wiring is complete and firmware supports triggers:

Say: "Run a hardware-synced sweep from 144 to 148 MHz with device 0001234567 as leader"

The assistant calls:

```
hardware_sync_sweep(
  leader_device_id="0001234567",
  follower_device_ids=["0009876543"],
  start_hz=144000000,
  stop_hz=148000000,
  points=101
)
```

This automatically:

1. Sets leader to "leader" mode
2. Sets followers to "follower" mode
3. Runs parallel scans (hardware synchronized)
4. Restores "software" mode

## Testing the Trigger Line

### Manual test via raw_command

```
# On leader - generate pulse
raw_command(device_id="0001234567", command="trig_out pulse")

# On follower - check status
raw_command(device_id="0009876543", command="trig_status")
```

Expected output: `trigger_count` should increment.

### Oscilloscope verification

- Pulse width: ~10µs
- Rising edge: < 1µs
- Voltage: 3.3V logic level

## Troubleshooting

### Trigger not detected

1. Verify wiring continuity with multimeter
2. Check firmware has `trig_mode` command: `raw_command("help")`
3. Ensure ground is shared between VNAs
4. Try shorter trigger wire (< 30cm recommended)

### Erratic triggering

1. Add 100Ω series resistor on TRIG_OUT to reduce ringing
2. Keep trigger wire away from RF paths
3. Use shielded wire for long runs (> 30cm)
4. Check for EMI from nearby equipment

### Sweeps still not synchronized

1. Verify both VNAs have same sweep settings (start, stop, points)
2. Check trigger mode is correctly set before sweep
3. Ensure leader starts sweep before followers timeout

### Capability shows false

1. Firmware may not support triggers
2. Flash custom firmware with trigger support
3. Run `detect_capabilities()` after firmware update

## Electrical Specifications

| Parameter | Value |
|-----------|-------|
| TRIG_OUT pulse width | 10µs |
| TRIG_IN threshold | 1.6V (TTL-compatible) |
| Maximum trigger cable length | 1m (unshielded), 5m (shielded) |
| Edge-to-sweep latency | < 50µs |

## Next Steps

- [External Clock Modification](/hardware/external-clock/) — Add Tier 3 phase coherence
- [Multi-VNA Coordination](/mcnanovna/multi-vna/) — Understand all synchronization tiers
- [Tool Reference](/mcnanovna/tools/) — Hardware trigger tools
