🛠 Overclocker le RP2040 à 200 MHz (et au-delà) en toute connaissance

RP2040 (generic board / chip) · avance · Schéma : IMG-rp2040-generic-avance-3-rp2040-overclock-200mhz.svg — puce RP2040 avec régulateur VREG et boucle ROSC, clock XOSC 12 MHz multiplié vers 200 MHz, jauge de fréquence 133 vers 200 MHz, thermomètre de la puce

Objectives

The RP2040 datasheet lists a nominal frequency of 133 MHz, but the datasheet documents an extended mode: up to 200 MHz by over-volting the core to 1.15 V via the over_vrange bit in the VREG (RP2040 datasheet, §2.15.3 Overclocking; publicly confirmed by Raspberry Pi, see also the documentation discussion pico-feedback#499). The chip even features an auto-tuned ROSC that adapts the internal voltage to the silicon (§2.15.2). This tutorial covers how to cleanly reach 200 MHz, prove it with a benchmark, and understand the limitations (QSPI flash, thermal constraints, variability).

Hardware

Complete Code

// oc200.c — 200 MHz avec VREG forcé, benchmark Dhrystone-like
#include "pico/stdlib.h"
#include "hardware/vreg.h"
#include "hardware/clocks.h"

int main(void) {
    stdio_init_all;
    // 1) monter la tension du cœur AVANT la fréquence (datasheet 2.15.3)
    vreg_set_voltage(VREG_VOLTAGE_1_20);   // 1,20 V > nominal 1,10 V
    sleep_ms(10);                          // laisser le régulateur stabiliser
    // 2) demander 200 MHz au PLL (le SDK rebascule sur XOSC si besoin)
    set_sys_clock_khz(200000, true);
    printf("clk_sys = %lu Hz\n", clock_get_hz(clk_sys));

    // 3) benchmark : boucle dépendante, sans FPU (le M0+ n'en a pas)
    uint32_t t0 = time_us_32;
    volatile uint32_t x = 0;
    for (uint32_t i = 0; i < 1000000; i++) { x = x * 1664525u + 1013904223u; }
    uint32_t dt = time_us_32 - t0;
    printf("1e6 iters en %lu us (x=%lu)\n", dt, x);
    while (true) { sleep_ms(1000); }        // laisse la puce « au ralenti »
}

Expected Verification

clk_sys = 200000000 is displayed, and the benchmark time decreases by approximately 1.6× compared to the run at 125/133 MHz (the exact ratio depends on the code and flash wait states). The chip will sustain 200 MHz on a correct board — this is the certified "over_vrange" frequency from the datasheet. To overcome silicon variability, the SDK offers automatic tuning via ROSC (set_sys_clock_khz + autotune mode used by the sys_clk400 example in pico-extras) — MicroPython also documents overclocking beyond 400 MHz on lucky chips (docs rp2).

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials