PicoVGA  1.0-cmake
VGA/TV display on Raspberry Pico
CPU Overclocking

Description

Some display functions may be CPU speed intensive and may require overclocking to a higher speed. It should be understood that overclocking places the processor in areas where proper function is not guaranteed. The PicoVGA library allows you to control the overclocking of the processor, according to the desired video mode. The minimum and maximum processor frequency can be specified in the VgaCfg() function. By default, the library allows a range of 120 to 270 MHz. However, it may happen that at higher frequencies the processor will not operate correctly and it may be necessary to lower the upper limit. The searched processor frequency can be set with the set_sys_clock_pll() function.

Functions

bool vcocalc (u32 reqkhz, u32 input, u32 vcomin, u32 vcomax, bool lowvco, u32 *outkhz, u32 *outvco, u16 *outfbdiv, u8 *outpd1, u8 *outpd2)
 Search PLL setup. More...
 
bool FindSysClock (u32 reqkhz, u32 *outkhz, u32 *outvco, u16 *outfbdiv, u8 *outpd1, u8 *outpd2)
 Find PLL generator settings with default parameters. (use set_sys_clock_pll to set sysclock) More...
 
void __not_in_flash_func() FlashSpeedSetup (int baud)
 Setting the interface speed for external flash. More...
 

Function Documentation

◆ vcocalc()

bool vcocalc ( u32  reqkhz,
u32  input,
u32  vcomin,
u32  vcomax,
bool  lowvco,
u32 *  outkhz,
u32 *  outvco,
u16 *  outfbdiv,
u8 *  outpd1,
u8 *  outpd2 
)

Search PLL setup.

Function for finding the optimal setting of the PLL system clock generator. The function is used to specify the desired output frequency, the input frequency of the crystal (12 MHz in Raspberry Pico), the minimum and maximum frequency of the VCO oscillator. The output is the parameters for setting the PLL oscillator. The function returns True if it was able to find a setting for the exact value of the desired frequency. Otherwise, it searches for the setting for the closest frequency and returns False.

Parameters
reqkhzRequired output frequency in kHz
inputPLL input frequency in kHz (default 12000, or use clock_get_hz(clk_ref)/1000)
vcominMinimal VCO frequency in kHz (default 400000)
vcomaxMaximal VCO frequency in kHz (default 1600000)
lowvcoPrefer low VCO (lower power but more jiter)
outkhzOutput achieved frequency in kHz (0=not found)
outvcoOutput VCO frequency in kHz
outfbdivOutput fbdiv (16..320)
outpd1Output postdiv1 (1..7)
outpd2Output postdiv2 (1..7)
Returns
True if precise frequency has been found, or near frequency used otherwise.

◆ FindSysClock()

bool FindSysClock ( u32  reqkhz,
u32 *  outkhz,
u32 *  outvco,
u16 *  outfbdiv,
u8 *  outpd1,
u8 *  outpd2 
)

Find PLL generator settings with default parameters. (use set_sys_clock_pll to set sysclock)

Parameters
reqkhzRequired frequency in kHz
outkhzOutput achieved frequency in kHz (0=not found)
outvcoOutput VCO frequency in kHz
outfbdivOutput fbdiv (16..320)
outpd1Output postdiv1 (1..7)
outpd2Output postdiv2 (1..7)
Returns
True if precise frequency has been found, or near frequency used otherwise.

◆ FlashSpeedSetup()

void __not_in_flash_func() FlashSpeedSetup ( int  baud)

Setting the interface speed for external flash.

Parameters
baudFlash SSI speed (4 default, <4 faster, >4 slower)