test_10MHz.py
656 Bytes
from Si5351 import Si5351
import fractions
def asservissement(x):
freq=((x/1e7)*25); # frequence de l'ordre de 720 MHz ajustable `a mieux que le Hz
a=int(freq/25)
u=(freq-a*25)/25; # 700=28*25 i.e. a=28
t=fractions.Fraction(u).limit_denominator(1000000);
b=t.numerator
c=t.denominator
si = Si5351(busnum=1)
# vco = 25 MHz * (28 + 8 / 10) = 720 MHz
si.setupPLL(si.PLL_A, a, b, c)
#si.setupPLL(si.PLL_A, 24, 2, 3)
# out0 = 720 MHz / 25 = 28.8 MHz
si.setupMultisynth(0, si.PLL_A, int(25))
# out2 = 720 MHz / 72 = 10 MHz
si.setupMultisynth(1, si.PLL_A, int(72))
si.setupMultisynth(2, si.PLL_A, int(72))
si.enableOutputs(True)