# Signal Tap Lain — Solution

## Overview

A logic analyzer capture is streamed with 3 channels. Channel 1 (ch1) contains
UART data at 9600 baud, 8N1 format. The player must identify the protocol from
signal timing and decode the ASCII message.

## Steps

1. Connect and capture the data:

```bash
nc <host> 3800 > capture.csv
```

Wait for `--- END OF CAPTURE ---`.

1. Analyze the capture. Use `info` command for metadata:

```text
info
```

Shows 3 channels: ch0 (reference), ch1 (data), ch2 (noise).

1. Focus on ch1. Look for patterns:

   - Idle state is HIGH (1)
   - Periodic falling edges = start bits
   - Measure time between start bits to find character period

1. Calculate baud rate:

   - Bit period ≈ 104.17 μs → 9600 baud
   - Character frame = 10 bits (1 start + 8 data + 1 stop) = ~1041.67 μs

1. Decode UART 8N1:

   - Start bit: falling edge (HIGH → LOW)
   - Sample data bits at center of each bit period (1.5 × bit_period after start)
   - 8 data bits, LSB first
   - Stop bit: HIGH

1. Script or manually decode the ch1 data to ASCII. The message contains the flag
   repeated 3 times.

## Key Concepts

- **Logic analysis**: Reading digital signals and identifying protocols from timing patterns
- **UART 8N1**: Universal Asynchronous Receiver/Transmitter — start bit, 8 data bits LSB-first, no parity, 1 stop bit
- **Baud rate detection**: Measuring the shortest pulse width gives the bit period → baud rate
- **Signal separation**: In a multi-channel capture, identifying which channel carries useful data

## Flag

`ESPILON{s1gn4l_t4p_l41n}`
