From caecc645bf98238f317b2d6c6914e7a576fe4051 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Fri, 29 Oct 2021 12:04:22 +0100 Subject: [PATCH] Pico: 1.20v overvolt for stable 250MHz Required for stable 250MHz overclock on some PicoSystem units. Default voltage is 1.10v. --- 32blit-pico/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/32blit-pico/main.cpp b/32blit-pico/main.cpp index 4fb1872ba..7ab1174a0 100644 --- a/32blit-pico/main.cpp +++ b/32blit-pico/main.cpp @@ -3,6 +3,7 @@ #include "hardware/clocks.h" #include "hardware/structs/rosc.h" +#include "hardware/vreg.h" #include "pico/binary_info.h" #include "pico/stdlib.h" @@ -232,6 +233,10 @@ static int64_t timer_callback(alarm_id_t alarm_id, void *user_data) { int main() { #if OVERCLOCK_250 + // Apply a modest overvolt, default is 1.10v. + // this is required for a stable 250MHz on some RP2040s + vreg_set_voltage(VREG_VOLTAGE_1_20); + sleep_ms(10); set_sys_clock_khz(250000, false); #endif