Clock Distribution and PLL in Mining ASICs
How clock distribution and PLL work in mining hash boards — crystal oscillators, frequency multiplication, clock chains, and diagnosing clock-related failures.
Introduction
Every computation inside an ASIC chip happens in lockstep with a clock signal. Without a stable, precisely timed clock, the billions of SHA-256 hash attempts per second that make mining profitable would be impossible. The clock distribution system on a hash board is responsible for generating, multiplying, and delivering that timing signal to every chip in the chain.
This article explains how clock signals originate from a crystal oscillator, how each chip's internal Phase-Locked Loop (PLL) multiplies that reference into a high-speed core clock, how the clock propagates across dozens of chips, and what happens when things go wrong.
Understanding clock distribution is essential for diagnosing some of the trickiest hash board failures — from entire boards going dark to intermittent hash errors that defy easy explanation.
Clock Sources in Mining Hardware
The Crystal Oscillator
At the start of every hash board's clock tree sits a crystal oscillator — a small, four-pin component that generates a stable reference frequency. In virtually all Bitmain hash boards (S19 series through S21), this is a 25 MHz crystal oscillator.
The crystal oscillator works by exploiting the piezoelectric properties of quartz. When voltage is applied, the quartz crystal vibrates at a precise mechanical resonance frequency. This vibration is converted back into an electrical signal — a clean, stable 25 MHz square wave.
Why 25 MHz? This frequency is a widely available industry standard that offers a good balance: high enough to serve as a useful reference, low enough to propagate reliably across PCB traces without significant signal integrity concerns, and easily multiplied by PLLs to reach the 400–800 MHz range that ASIC cores need.
Why a Reference Clock is Needed
ASIC chips cannot generate their own precise clock internally. While ring oscillators and RC oscillators exist, they drift with temperature and voltage — sometimes by 10% or more. A crystal oscillator provides:
- Accuracy: typically within ±50 ppm (parts per million) of the target frequency
- Stability: minimal drift across the operating temperature range (0–85°C)
- Low jitter: clean edges that PLLs can lock onto reliably
The 25 MHz crystal is one of the cheapest components on a hash board, but its failure will take down every single chip. It is a single point of failure for the entire board.
Clock Input Pin (XCLK / CLKI)
The crystal oscillator's output connects to the first chip in the daisy chain via its clock input pin, commonly labeled XCLK or CLKI in datasheets. From there, the clock propagates chip-to-chip through the CI/CO (Clock In / Clock Out) chain.
PLL Operation Explained
What is a PLL?
A Phase-Locked Loop (PLL) is a feedback control circuit that generates a high-frequency output signal synchronized to a low-frequency reference input. Every ASIC mining chip — BM1366, BM1368, BM1370, BM1398, and others — contains one or more on-chip PLLs.
The PLL's job is to take the 25 MHz reference and multiply it up to the chip's core operating frequency, typically 400–800 MHz depending on the chip model and firmware configuration.
PLL Block Diagram
A PLL consists of four fundamental blocks:
┌─────────────────────────────────┐
Reference │ PLL Circuit │
25 MHz ──────►┌──────────┐ ┌──────────┐ ┌─────┐│ Core Clock
│ Phase │ │ Loop │ │ ││───► 400-800 MHz
│ Detector ├───►│ Filter ├───►│ VCO ││
└────▲─────┘ └──────────┘ └──┬──┘│
│ │ │
│ ┌──────────────┐ │ │
└────┤ Feedback │◄────────┘ │
│ Divider │ │
│ (÷N) │ │
└──────────────┘ │
└─────────────────────────────────┘Phase Detector
The phase detector compares the reference clock (25 MHz) to the feedback clock (the output divided down by N). It produces an error signal proportional to the phase difference between the two. When the PLL is locked, this error is essentially zero — the two signals are aligned in phase and frequency.
Loop Filter
The loop filter is a low-pass filter (typically a combination of resistors and capacitors, integrated on-chip) that smooths the error signal from the phase detector. It determines how quickly the PLL responds to changes and how stable the lock is. A well-designed loop filter suppresses high-frequency noise while allowing the PLL to track the reference.
Voltage-Controlled Oscillator (VCO)
The VCO generates the high-frequency output clock. Its frequency is controlled by the voltage from the loop filter — higher voltage means higher frequency. The VCO in a BM1366 or BM1368 can typically oscillate across a range of roughly 200 MHz to 1.2 GHz, though the usable range is constrained by the chip's voltage and thermal limits.
Feedback Divider (÷N)
The feedback divider divides the VCO output frequency by an integer N before feeding it back to the phase detector. This is how frequency multiplication works: if the reference is 25 MHz and the divider is set to N=20, the PLL locks when the VCO output is 25 × 20 = 500 MHz.
The firmware controls the value of N (and related dividers) through PLL configuration registers.
Lock Time and Stability
When a PLL is first enabled or its frequency is changed, it takes time to lock — to stabilize at the target frequency. This lock time is typically 50–200 microseconds for mining ASICs. During lock-up, the output clock is unstable and the chip should not be performing hashing work.
Firmware initialization sequences account for this by inserting delays after PLL configuration:
// After writing PLL registers, wait for lock
bm1366_set_pll(chain, chip_addr, target_freq);
vTaskDelay(pdMS_TO_TICKS(5)); // 5ms — generous margin over ~100µs lock timeA PLL that cannot lock — due to a missing reference clock, insufficient supply voltage, or silicon defect — will cause the chip to either not respond at all or produce erratic, useless output.
PLL Configuration in Bitmain ASIC Chips
Register-Based Frequency Setting
Bitmain ASIC chips expose PLL configuration through memory-mapped registers accessible via the serial command interface. The firmware writes specific register values during chip initialization to set each chip's core frequency.
The PLL register encodes several fields:
- FBDIV (Feedback Divider): the main multiplication factor
- REFDIV (Reference Divider): divides the input reference before the phase detector
- POSTDIV1 / POSTDIV2 (Post-Dividers): divide the VCO output after the PLL loop
The effective output frequency is calculated as:
f_out = (f_ref × FBDIV) / (REFDIV × POSTDIV1 × POSTDIV2)For a 25 MHz reference targeting 500 MHz with REFDIV=1, POSTDIV1=1, POSTDIV2=1:
FBDIV = 500 / 25 = 20
f_out = (25 × 20) / (1 × 1 × 1) = 500 MHzBM1366 and BM1368 PLL Registers
The BM1366 (used in Antminer S19 XP) uses a 5-byte PLL register write. The register address is embedded in the command payload. Common frequency presets:
// BM1366 PLL frequency presets
// Format: { reg_addr_hi, reg_addr_lo, data[0], data[1], data[2] }
// 400 MHz: FBDIV=16, REFDIV=1, POSTDIV1=1, POSTDIV2=1
static const uint8_t pll_400mhz[] = { 0x00, 0xF0, 0x20, 0x64, 0x01 };
// 500 MHz: FBDIV=20, REFDIV=1, POSTDIV1=1, POSTDIV2=1
static const uint8_t pll_500mhz[] = { 0x00, 0xF0, 0x28, 0x64, 0x01 };
// 600 MHz: FBDIV=24, REFDIV=1, POSTDIV1=1, POSTDIV2=1
static const uint8_t pll_600mhz[] = { 0x00, 0xF0, 0x30, 0x64, 0x01 };
// 700 MHz: FBDIV=28, REFDIV=1, POSTDIV1=1, POSTDIV2=1
static const uint8_t pll_700mhz[] = { 0x00, 0xF0, 0x38, 0x64, 0x01 };A typical initialization sequence sends the PLL register write command to each chip address (or as a broadcast to all chips):
// BM1366 PLL initialization — set all chips to 500 MHz
void bm1366_init_pll(uint8_t chain_id) {
// PLL register write command (CMD_WRITE_REG = 0x41)
uint8_t cmd[] = {
0x55, 0xAA, // Preamble
0x51, 0x09, // Header: all-chip, length=9
0x41, // CMD_WRITE_REG
0x00, 0x00, // Chip address (0x0000 = broadcast)
0x00, 0xF0, // Register: PLL0
0x28, 0x64, 0x01, // PLL data: 500 MHz
0x00 // CRC placeholder
};
uart_write(chain_id, cmd, sizeof(cmd));
// Wait for PLL lock across all chips
vTaskDelay(pdMS_TO_TICKS(10));
}The BM1368 (used in Antminer S21) follows a similar register layout but with updated PLL characteristics tuned for higher efficiency at lower voltages. The register address and encoding scheme remain compatible:
// BM1368 PLL frequency presets
// The BM1368 supports finer granularity via fractional dividers
// 400 MHz
static const uint8_t pll_400mhz[] = { 0x00, 0xF0, 0x20, 0x64, 0x01 };
// 500 MHz
static const uint8_t pll_500mhz[] = { 0x00, 0xF0, 0x28, 0x64, 0x01 };
// 525 MHz (typical S21 stock frequency)
static const uint8_t pll_525mhz[] = { 0x00, 0xF0, 0x2A, 0x64, 0x01 };
// 600 MHz (overclocked)
static const uint8_t pll_600mhz[] = { 0x00, 0xF0, 0x30, 0x64, 0x01 };The BM1368 also supports per-chip frequency tuning, allowing the firmware to set different frequencies for chips that run hotter or cooler based on their position on the board:
// Set chip 15 to a lower frequency (450 MHz) due to thermal hotspot
void bm1368_tune_chip(uint8_t chain_id, uint8_t chip_index) {
uint16_t chip_addr = chip_index * chip_addr_interval;
uint8_t cmd[] = {
0x55, 0xAA,
0x41, 0x09,
0x41, // CMD_WRITE_REG
(chip_addr >> 8) & 0xFF, // Chip address high
chip_addr & 0xFF, // Chip address low
0x00, 0xF0, // Register: PLL0
0x24, 0x64, 0x01, // PLL data: 450 MHz
0x00 // CRC
};
uart_write(chain_id, cmd, sizeof(cmd));
}Post-Divider Configuration
The post-dividers (POSTDIV1, POSTDIV2) provide additional flexibility. Instead of running the VCO at exactly the target frequency, the VCO can run at a higher frequency within its optimal range and be divided down:
Example: Targeting 200 MHz
Option A: VCO at 200 MHz (may be below VCO optimal range)
Option B: VCO at 800 MHz, POSTDIV1=2, POSTDIV2=2 → 800/4 = 200 MHz (better)The post-divider encoding varies between chip generations. In the BM1398, the post-divider register value uses the raw divider value. In the BM1366/BM1368 and later, the register stores the divider value minus one. Sending the wrong encoding will result in incorrect frequencies — often double or half the intended value.
The firmware must account for this difference:
// Post-divider encoding differs by chip model
uint8_t encode_postdiv(uint16_t chip_model, uint8_t divider) {
switch (chip_model) {
case 0x1398: // BM1398
return divider; // Raw value
case 0x1366: // BM1366
case 0x1368: // BM1368
case 0x1370: // BM1370
return divider - 1; // Minus one encoding
default:
return divider;
}
}Frequency Ramping During Initialization
Production firmware does not jump directly to the target frequency. Instead, it ramps the PLL frequency in steps to avoid voltage droops caused by sudden current spikes:
// Gradual PLL ramp-up during initialization
void bm1366_ramp_pll(uint8_t chain_id, uint16_t target_mhz) {
uint16_t steps[] = { 200, 300, 400, 0 }; // Intermediate steps
for (int i = 0; steps[i] != 0 && steps[i] < target_mhz; i++) {
bm1366_set_pll_freq(chain_id, BM_ADDR_BROADCAST, steps[i]);
vTaskDelay(pdMS_TO_TICKS(10)); // Settle time between steps
}
// Final target
bm1366_set_pll_freq(chain_id, BM_ADDR_BROADCAST, target_mhz);
vTaskDelay(pdMS_TO_TICKS(20)); // Longer settle at final frequency
}This ramping is visible in logic analyzer captures of the initialization sequence — you can see multiple PLL register writes spaced a few milliseconds apart with increasing FBDIV values.
Frequency and Hashrate Relationship
The Linear Relationship
The relationship between clock frequency and hashrate is approximately linear: doubling the core frequency roughly doubles the hash rate. Each clock cycle, the hashing cores complete one step of the SHA-256 pipeline. More cycles per second means more hashes per second.
Hashrate ∝ Frequency × Number_of_Cores
Example (BM1366):
At 500 MHz: ~52 TH/s per chip (estimated)
At 600 MHz: ~62 TH/s per chip (estimated)
At 700 MHz: ~73 TH/s per chip (estimated)The Power Problem: V²×f
While hashrate scales linearly with frequency, power consumption does not. Dynamic power in CMOS circuits follows:
P_dynamic = C × V² × f
Where:
C = capacitance (fixed by chip design)
V = supply voltage
f = clock frequencyHigher frequencies require higher voltages for reliable switching. The relationship between frequency and required voltage is roughly linear in the operating range, which means:
- Power scales approximately as f³ (since V scales with f, and P ∝ V² × f)
- Going from 500 MHz to 700 MHz (1.4× frequency) can increase power by ~2.7× (1.4³)
- Energy efficiency (J/TH) degrades rapidly at higher frequencies
The Efficiency Sweet Spot
Every chip has a frequency range where the joules per terahash (J/TH) metric is minimized. This is the sweet spot where you get the most hashing per watt of electricity consumed.
| Frequency | Hashrate | Power | Efficiency |
|---|---|---|---|
| 400 MHz | ~80% baseline | ~60% baseline | Best (J/TH) |
| 500 MHz | Baseline | Baseline | Good |
| 600 MHz | ~120% baseline | ~170% baseline | Moderate |
| 700 MHz | ~140% baseline | ~270% baseline | Poor |
Most stock firmware operates slightly above the efficiency sweet spot, trading some efficiency for higher total hashrate. Custom firmware like Braiins and Vnish allow operators to choose their own trade-off point based on electricity costs.
Clock Tree on a Hash Board
Crystal to First Chip
The clock distribution starts with the crystal oscillator and propagates through the entire chain of chips:
Crystal Chip 0 Chip 1 Chip 2 Chip N
OSC ──────► CLKI → PLL CLKI → PLL CLKI → PLL CLKI → PLL
CLKO ────────► ↑ CLKO ────────► ↑ ↑
... ────────┘Crystal Oscillator Output
The 25 MHz crystal oscillator generates a clean reference clock. Its output is routed via a PCB trace to the CLKI (Clock In) pin of Chip 0 — the first chip in the daisy chain.
PLL Lock and Core Operation
Chip 0's PLL locks to the 25 MHz reference and generates the internal core clock (e.g., 500 MHz). The chip begins hashing once the PLL is locked and firmware has sent a work job.
Clock Output Regeneration
Chip 0 also drives its CLKO (Clock Out) pin with a regenerated version of the reference clock — typically the 25 MHz reference itself, buffered and re-driven. This CLKO connects to Chip 1's CLKI via a PCB trace.
Chain Propagation
Each subsequent chip receives the clock from the previous chip's CLKO, locks its own PLL, and regenerates the clock for the next chip. This continues through the entire chain — 114 chips in a BM1366 board, 156 chips in a BM1368 board.
CI/CO Signal Characteristics
The CI (Clock In) and CO (Clock Out) signals on Bitmain hash boards are typically:
- Voltage level: 1.8V LVCMOS or 0.8V differential (varies by generation)
- Frequency: 25 MHz reference (not the multiplied core clock)
- Rise/fall time: ~2 ns typical
- Trace impedance: 50 ohm controlled impedance on well-designed boards
Clock Jitter Accumulation
Every time the clock signal passes through a chip's clock buffer (CLKI → CLKO), a small amount of jitter is added. Jitter is the variation in the timing of clock edges — the clock edge arrives slightly early or late compared to the ideal position.
After passing through many chips, this accumulated jitter can become significant:
Jitter per chip: ~5-15 ps RMS (typical for modern ASICs)
After 50 chips: ~35-106 ps RMS (jitter adds as √N)
After 100 chips: ~50-150 ps RMS
After 150 chips: ~61-184 ps RMSAt 25 MHz, one clock period is 40 ns (40,000 ps), so even 200 ps of jitter is only 0.5% of the period — well within tolerance. However, the PLL inside each chip amplifies jitter relative to the multiplication factor. At 500 MHz (20× multiplication), 200 ps of input jitter could contribute to ~200 ps of output jitter, and one period is only 2 ns (2,000 ps). This is why clock jitter matters more for chips at the end of long chains.
Chips near the end of the chain are more susceptible to jitter-induced hash errors. If you see higher error rates on the last 10-20% of chips, clock jitter accumulation may be a contributing factor — especially on boards with damaged or poorly soldered chips mid-chain.
Overclocking and Underclocking
How Custom Firmware Adjusts Frequency
Custom firmware solutions provide granular control over PLL frequencies:
Braiins OS+ implements per-chip auto-tuning. The firmware:
- Starts all chips at a conservative frequency
- Gradually increases each chip's PLL frequency individually
- Monitors hash error rates per chip
- Backs off frequency for chips that show elevated errors
- Continuously optimizes, adapting to temperature changes
This results in a frequency distribution where cooler chips (at the board edges) run faster and hotter chips (in the center) run slower.
Vnish firmware provides manual per-chip frequency profiles alongside automatic tuning. Operators can:
- Set a global target frequency with automatic per-chip adjustment
- Create custom frequency profiles for specific board positions
- Define frequency-voltage curves that the firmware follows
- Set maximum power limits that constrain the frequency ceiling
Stock Bitmain firmware uses a single PLL frequency for all chips (broadcast write). All chips run at the same clock speed regardless of their thermal conditions. The frequency is set conservatively to ensure stability across the worst-case chip on the board.
Overclocking: Risks and Rewards
Increasing PLL frequency beyond stock settings trades efficiency for higher hashrate:
Rewards:
- Higher total hashrate from existing hardware
- Can be profitable when Bitcoin price is high relative to electricity cost
Risks:
- Increased power consumption (non-linear — see V²×f above)
- Higher operating temperatures, potentially exceeding thermal limits
- Elevated hash error rates, reducing effective hashrate
- Accelerated electromigration and chip degradation
- Risk of power delivery failure if voltage regulators are pushed beyond design margins
Underclocking: The Efficiency Play
Reducing PLL frequency below stock settings is increasingly popular among miners focused on efficiency:
- 10-20% frequency reduction can yield 30-40% power savings (due to voltage reduction)
- Lower temperatures extend component lifespan
- Fewer hash errors mean more consistent effective hashrate
- Quieter operation from reduced fan speeds
- Particularly attractive in regions with higher electricity costs
// Example: Underclocking a BM1368 from 525 MHz stock to 425 MHz
// Power reduction: ~40%, Hashrate reduction: ~19%, Efficiency gain: ~25%
bm1368_set_pll_freq(chain_id, BM_ADDR_BROADCAST, 425);
bm1368_set_core_voltage(chain_id, 0.265); // Lower voltage matches lower freqDiagnosing Clock-Related Issues
Clock problems manifest in distinct patterns that help narrow the diagnosis.
Symptom: All Chips Missing
Cause: No reference clock reaching the first chip.
When the crystal oscillator fails or its output trace is broken, no chip on the board receives a clock. Without a clock, the chips' PLLs cannot lock and the chips cannot respond to commands.
Diagnosis:
- Use an oscilloscope to probe the crystal oscillator output — you should see a clean 25 MHz square wave
- Probe the CLKI pin of Chip 0 — signal should be present
- Check for physical damage to the crystal oscillator or surrounding passives
Expected: Clean 25 MHz square wave, 1.8V amplitude, <2 ns rise time
Failure: No signal, DC level, or severely distorted waveformCrystal oscillator failures are rare but not unheard of. They can be caused by physical shock (dropping the board), corrosion, or manufacturing defects. Replacement crystals are inexpensive and straightforward to solder.
Symptom: Intermittent Hash Errors
Cause: Clock jitter, marginal PLL lock, or power supply noise.
When the clock signal is present but degraded, PLLs may lock intermittently or with excessive jitter. The core clock will have timing violations that cause occasional computational errors.
Diagnosis:
- Check error rates per chip — if errors correlate with chain position (worse toward the end), jitter accumulation is likely
- Probe CI/CO signals at the problem chip — look for reduced amplitude, slow edges, or ringing
- Check power supply ripple on the chip's VDD — excessive ripple couples into the PLL
Symptom: Partial Chain Loss
Cause: Clock break at a specific chip in the chain.
If Chip N's CLKO fails, all chips from N+1 onward lose their clock reference. The firmware will see chips 0 through N responding normally and all subsequent chips missing.
Diagnosis:
- Identify the last responding chip — call it Chip N
- Probe Chip N's CLKO pin — if absent or distorted, Chip N's clock output circuit is damaged
- Probe Chip N+1's CLKI pin to confirm the signal is not arriving
- Common causes: cold solder joint on CLKO/CLKI pin, damaged chip, broken PCB trace
Control Board → Chip 0 ✓ → Chip 1 ✓ → ... → Chip N ✓ → Chip N+1 ✗ → ... → Chip M ✗
│
CLKO failure hereDo not confuse clock chain breaks with communication (RI/RO) chain breaks. Both cause "missing chips" after a certain point. To distinguish: a clock break means the downstream chips do not respond at all (not even to direct-address commands), while a communication break means chips are powered and clocked but unreachable via the serial chain. An oscilloscope on the CI/CO and RI/RO pins at the suspected break point will clarify which system is broken.
Testing with an Oscilloscope
An oscilloscope is the definitive tool for clock diagnostics. Key measurement points:
| Test Point | Expected Signal | What to Look For |
|---|---|---|
| Crystal output | 25 MHz, 1.8V, clean edges | Missing signal, distortion, wrong frequency |
| Chip 0 CLKI | 25 MHz, matched to crystal | Attenuation, reflections |
| Any chip CLKO | 25 MHz, regenerated | Reduced amplitude, excessive jitter |
| Chip N+1 CLKI (at break) | 25 MHz | Missing or severely degraded |
Recommended oscilloscope settings for clock measurement:
- Bandwidth: 200 MHz minimum (10× the fundamental for edge quality)
- Timebase: 10-20 ns/div to see individual clock cycles
- Trigger: rising edge on the channel being measured
- Probe: 10:1 passive probe, properly compensated
For jitter measurements, use the oscilloscope's histogram or persistence mode on the clock edges. Normal jitter should appear as a tight distribution; problematic jitter will show broad, sometimes bimodal distributions.
See Oscilloscope Basics for Miners for a complete guide to oscilloscope operation.
Key Takeaways
-
The crystal oscillator is the clock source for the entire hash board — a single 25 MHz reference that every chip depends on.
-
PLLs multiply the reference clock from 25 MHz up to 400–800 MHz using feedback divider registers controlled by firmware.
-
PLL registers are chip-specific — the BM1366, BM1368, and other models use register-based frequency configuration with subtle encoding differences (especially post-divider encoding).
-
Frequency and hashrate are linearly related, but power scales much faster than frequency (approximately V²×f), creating a clear efficiency sweet spot.
-
Clock propagates chip-to-chip via the CI/CO daisy chain, with each chip regenerating the reference for the next. Jitter accumulates along the chain.
-
Custom firmware enables per-chip tuning — overclocking for maximum hashrate or underclocking for maximum efficiency.
-
Clock failures produce distinctive patterns: all chips missing (crystal failure), intermittent errors (jitter/instability), or partial chain loss (mid-chain clock break).
Apply This Knowledge
Now that you understand clock distribution and PLL operation, explore these related topics:
- How Hash Boards Work — the broader context of hash board architecture
- Signal Integrity Basics — understanding signal quality, reflections, and impedance matching
- Voltage Domains & Regulators — how power delivery interacts with clock frequency
- Oscilloscope Basics for Miners — hands-on measurement techniques for clock signals
- Auto-Tuning Explained — how firmware automatically optimizes per-chip frequencies
- UART, SPI & I2C Explained — the communication protocols used alongside clock distribution
Power Delivery Systems in Mining Hardware
Understanding mining hardware power delivery — from PSU rails to buck converters, voltage domains, and protection circuits. Essential knowledge for hash board repair.
UART, SPI, and I2C Protocols in Mining Hardware
Understanding serial communication in ASIC miners — UART chip chains, SPI data paths, I2C sensor buses, protocol debugging, and common failure diagnosis.