Datasheet

Table Of Contents
2.17.2.1. Jitter vs Power Consumption
There are often several ways to get the desired output frequency, especially if you are willing to add some margin to the
desired output frequency (124 MHz or 126 Mhz instead of 125 MHz). It is up to the programmer to decide whether they
optimise for low power consumption or low jitter. The lower the jitter, the lower the variation in the period of the clock. A
clock optimised for low jitter will be more accurate than one optimised for low power consumption. A high accuracy clock
is often needed for audio and video applications, or where data is being transmitted and received in accordance with a
specification. For example, the USB specification defines a maximum amount of allowable jitter.
To achieve low jitter, the VCO frequency should be high and divided down. For example, 1500 MHz VCO / 6 / 2 = 125MHz. To
reduce power consumption, the VCO frequency should be as low as possible. For example: 500 MHZ VCO / 4 / 1 = 125 MHz.
Pico SDK provides a Python script that shows various VCO and post divider options for a desired output frequency:
Pico SDK: https://github.com/raspberrypi/pico-sdk/tree/pre_release/src/rp2_common/hardware_clocks/scripts/vcocalc.py Lines 1 - 37
Ê1 #!/usr/bin/env python3
Ê2
Ê3 import argparse
Ê4
Ê5 parser = argparse.ArgumentParser(description="PLL parameter calculator")
Ê6 parser.add_argument("--input", "-i", default=12, help="Input (reference) frequency. Default
Ê 12 MHz", type=float)
Ê7 parser.add_argument("--vco-max", default=1600, help="Override maximum VCO frequency. Default
Ê 1600 MHz", type=float)
Ê8 parser.add_argument("--vco-min", default=400, help="Override minimum VCO frequency. Default
Ê 400 MHz", type=float)
Ê9 parser.add_argument("--low-vco", "-l", action="store_true", help="Use a lower VCO frequency
Ê when possible. This reduces power consumption, at the cost of increased jitter")
10 parser.add_argument("output", help="Output frequency in MHz.", type=float)
11 args = parser.parse_args()
12
13 # Fixed hardware parameters
14 fbdiv_range = range(16, 320 + 1)
15 postdiv_range = range(1, 7 + 1)
16
17 best = (0, 0, 0, 0)
18 best_margin = args.output
19
20 for fbdiv in (fbdiv_range if args.low_vco else reversed(fbdiv_range)):
21 vco = args.input * fbdiv
22 if vco < args.vco_min or vco > args.vco_max:
23 continue
24 # pd1 is inner loop so that we prefer higher ratios of pd1:pd2
25 for pd2 in postdiv_range:
26 for pd1 in postdiv_range:
27 out = vco / pd1 / pd2
28 margin = abs(out - args.output)
29 if margin < best_margin:
30 best = (out, fbdiv, pd1, pd2)
31 best_margin = margin
32
33 print("Requested: {} MHz".format(args.output))
34 print("Achieved: {} MHz".format(best[0]))
35 print("VCO: {} MHz".format(args.input * best[1]))
36 print("PD1: {}".format(best[2]))
37 print("PD2: {}".format(best[3]))
Given an input and output frequency, this script will find the best possible set of PLL parameters to get as close as
possible. Where multiple equally good combinations are found, it returns the parameters which yield the highest VCO
frequency, for best output stability. The -l or --low-vco flag will instead prefer lower frequencies, for reduced power
RP2040 Datasheet
2.17. PLL 203