---
title: Logic Levels and Interface Physical Layers
url: https://doc.liz6.com/en/hardware/06-interfaces-and-communication/01-logic-levels-and-interface-physical-layers
locale: en
area: hardware
tags:
- hardware
- interfaces-and-communication
date: 2026-06-30
modified: 2026-07-16
description: 'Logic Levels and Interface Physical Layers Why Logic Levels Are Needed When two chips communicate, they must agree on: What voltage counts as "1"? What counts a…'
---

# Logic Levels and Interface Physical Layers

## Why Logic Levels Are Needed

When two chips communicate, they must agree on: What voltage counts as "1"? What counts as "0"? What is the drive capability? What is the noise margin? Mismatches lead to communication failures or even chip damage.

---

## Single-Ended Signals

### TTL (Transistor-Transistor Logic)
```
The oldest standard (74 series)

Vcc: 5V ± 10%
VOH > 2.4V, VOL < 0.4V
VIH > 2.0V, VIL < 0.8V

Noise margin is approx. 0.4V (small!)
Output drive: Weak sourcing (~0.4mA), Strong sinking (~16mA)

Being replaced by CMOS, but 3.3V is still common
```

### CMOS (Complementary Metal-Oxide-Semiconductor)
```
Modern mainstream logic levels

Vcc = 5V:
  VOH > Vcc-0.1V, VOL < 0.1V  (Almost rail-to-rail!)
  VIH > 0.7×Vcc, VIL < 0.3×Vcc

Vcc = 3.3V:
  VIH > 2.0V, VIL < 0.8V

Vcc = 1.8V:
  VIH > 0.65×Vcc, VIL < 0.35×Vcc

Large noise margin → Good interference immunity
Extremely low static power consumption (only consumes power during switching)

Note: 3.3V CMOS output can drive 5V TTL input (VIH=2.0V)
      But 5V output cannot be directly connected to 3.3V CMOS input (may cause damage or latch-up)
```

---

## Differential Signals

### Why Differential
<svg viewBox="0 0 720 368" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,'Source Han Sans CN','Microsoft YaHei',sans-serif" role="img" aria-label="Comparison of Single-Ended and Differential Signal Principles">
  <rect width="720" height="368" fill="#ffffff"/>
  <text x="360" y="28" text-anchor="middle" font-size="17" font-weight="700" fill="#1f2933">Single-Ended vs Differential: One Less Ground Reference Line for Interference Immunity and High Speed</text>

  <text x="48" y="68" font-size="13" font-weight="700" fill="#64748b">Single-Ended</text>
  <text x="48" y="84" font-size="11" fill="#94a3b8">Requires Ground Reference</text>
  <rect x="140" y="50" width="130" height="44" rx="6" fill="#e2e8f0"/>
  <text x="205" y="76" text-anchor="middle" font-size="12" font-weight="700" fill="#334155">Signal Line</text>
  <rect x="290" y="50" width="170" height="44" rx="6" fill="#e2e8f0"/>
  <text x="375" y="72" text-anchor="middle" font-size="12" font-weight="700" fill="#334155">GND Reference</text>
  <text x="375" y="88" text-anchor="middle" font-size="10" fill="#64748b">(Must be Common Ground)</text>

  <text x="48" y="134" font-size="13" font-weight="700" fill="#0f766e">Differential</text>
  <text x="48" y="150" font-size="11" fill="#0d9488">No Ground Reference Needed</text>
  <rect x="140" y="116" width="130" height="44" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="205" y="142" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">Positive Line</text>
  <rect x="290" y="116" width="170" height="44" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="375" y="138" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">Negative Line</text>
  <text x="375" y="154" text-anchor="middle" font-size="10" fill="#0f766e">(No GND Reference!)</text>

  <text x="48" y="182" font-size="13" font-weight="700" fill="#166534">Differential Advantages</text>
  <rect x="40" y="196" width="312" height="44" rx="6" fill="#dcfce7" stroke="#4ade80"/>
  <text x="54" y="214" font-size="12" font-weight="700" fill="#166534">✓ Common-Mode Noise Cancellation</text>
  <text x="54" y="231" font-size="10" fill="#15803d">Interference is identical on both lines; difference remains unchanged</text>
  <rect x="368" y="196" width="312" height="44" rx="6" fill="#dcfce7" stroke="#4ade80"/>
  <text x="524" y="222" text-anchor="middle" font-size="12" font-weight="700" fill="#166534">✓ No Ground Loop Issues</text>
  <rect x="40" y="252" width="312" height="44" rx="6" fill="#dcfce7" stroke="#4ade80"/>
  <text x="54" y="270" font-size="12" font-weight="700" fill="#166534">✓ High-Speed Transmission</text>
  <text x="54" y="287" font-size="10" fill="#15803d">Low Swing</text>
  <rect x="368" y="252" width="312" height="44" rx="6" fill="#dcfce7" stroke="#4ade80"/>
  <text x="382" y="270" font-size="12" font-weight="700" fill="#166534">✓ Lower EMI</text>
  <text x="382" y="287" font-size="10" fill="#15803d">Positive and Negative currents cancel out, resulting in low radiation</text>

  <rect x="40" y="312" width="640" height="40" rx="8" fill="#f0fdfa"/>
  <text x="60" y="337" font-size="12" fill="#115e59">Core: Common-mode interference is identical on both differential lines; the receiver subtracts them to cancel interference—no common ground reference needed, thus strong immunity, high speed, and low EMI.</text>
</svg>

### LVDS (Low Voltage Differential Signaling)
```
Swing: ~350mV (differential)
Common-mode voltage: ~1.2V
Speed: Hundreds of Mbps to several Gbps

Termination: 100Ω differential termination resistor
Power consumption: Extremely low (constant current drive ~3.5mA)

Applications: Displays (FPD-Link), Cameras (MIPI D-PHY), Backplanes
```

### RS-232 — Classic Serial Port
```
Single-ended, Full-duplex
Logic: 1 = -3~-15V, 0 = +3~+15V
      (Note: Negative voltage is Logic 1!)
Drive capability: Long-line drive (~15m)

High voltage, large noise margin, but slow speed (≤115.2kbps)
Level Shifter: MAX232 (TTL ↔ RS-232)

DB9 Pins:
  Pin2: RXD (Receive)
  Pin3: TXD (Transmit)
  Pin5: GND
```

### RS-485 — Mainstay of Industrial Communication
```
Differential, Half-duplex or Full-duplex
Swing: > 1.5V (differential)
Common-mode range: -7V ~ +12V (Large! Tolerates ground potential differences)

Distance: Up to 1200m (at low speeds)
Speed: Up to ~50Mbps (short distances)
Multi-point: 32~256 nodes can be connected on one bus

Termination: 120Ω differential termination resistor (one at each end)

Applications: MODBUS, PROFIBUS, DMX512
Chips: MAX485, SN75176
```

### CAN Bus
```
Differential, Multi-master, Priority Arbitration
Dominant (0): CANH-CANL > 0.9V
Recessive (1): CANH-CANL ≈ 0V

Speed: Up to 1Mbps (CAN FD up to 8Mbps)
Fault Tolerance: Extremely strong (Error detection + Auto-retransmission + Fault isolation)

Termination: 120Ω at each end

Applications: Automotive (OBD-II), Industrial Control, Robotics
```

---

## Open-Drain / Open-Collector

```
          Vpullup
             │
             Rpullup
             │
Internal     ├── SDA/Signal Line
┌────┐        │
│    │───┐   │
│ GPIO│  NMOS │
│    │───┘   │
└────┘        │
             GND

NMOS ON  → Pulls Low (Strong drive capability)
NMOS OFF → Pulled High by Pull-up Resistor (Weak drive capability)

Applications:
- I2C (Multi-master shared bus)
- Wire-AND: Multiple open-drain outputs can be directly connected; if any pulls the bus low, it is low
- Level Shifting: Changing Vpullup changes the output high level
```

---

## Level Shifting

### Scenarios
```
3.3V MCU connecting to 5V Peripheral — Most Common!
1.8V Sensor connecting to 3.3V MCU
```

### Solutions
```
1. Resistor Voltage Divider (Step-down only): 3.3→1.8, 5→3.3
   ──┤├───┬── Simple but weak pull-up, slow speed
          ├── Signal
   ──┤├───┘

2. Dedicated Level Shifter Chips:
   TXB0104 (Auto-direction, Low Speed)
   TXS0108E (Auto-direction, Open-Drain Compatible)
   SN74LVC1T45 (Direction Control, High Speed)

3. MOSFET Solution (Bi-directional, Low Speed):
         VCC_LOW     VCC_HIGH
            │           │
            Rp          Rp
            │           │
   LOW ─────┤ S    D ├── HIGH
            │  ──┬──  │
            │    │G   │
            │    │    │
           GND  GND  GND
```

---

## Quick Reference for Common Levels

| Standard | Diff/Single | Swing | Max Speed | Distance | Application |
|------|-------|------|----------|------|------|
| TTL 5V | Single-Ended | 0~5V | ~50MHz | PCB | Traditional Digital |
| CMOS 3.3V | Single-Ended | 0~3.3V | ~100MHz | PCB | Mainstream Digital |
| CMOS 1.8V | Single-Ended | 0~1.8V | ~200MHz | PCB | Low Power |
| LVDS | Differential | ±350mV | Gbps | ~10m | Display/High Speed |
| RS-232 | Single-Ended | ±12V | 115kbps | 15m | Debug Serial |
| RS-485 | Differential | >1.5V | 50Mbps | 1200m | Industrial |
| CAN | Differential | >0.9V | 8Mbps | ~1km | Automotive |
| USB 2.0 | Differential | ±400mV | 480Mbps | 5m | PC Peripherals |

---
*Keywords: TTL, CMOS, LVDS, Differential Signals, Open-Drain, RS-232, RS-485, CAN, Level Shifting*
