/Designs/Measuring_instruments/RMDS01C/SW/Host_controller/setSi570.py
1,6 → 1,11
#!/usr/bin/python
#
# Utility for setting frequency of Si570
# Utility for setting frequency of Si570 without a frequency measurement.
# The factory calibration is used for changing the frequency.
# This utility reset the Si570 to factory default 10 MHz first and than set a new frequency.
#
# This utility use an USBI2C01A module.
# (c) MLAB 2014
 
import time
import datetime
31,12 → 36,12
)
cfg.initialize()
 
fgen = cfg.get_device("clkgen")
fgen = cfg.get_device("clkgen")
sys.stdout.write("Frequency will be set to " + sys.argv[2] + " MHz.\r\n")
fgen.reset()
fgen.reset() # Reset Si570 to 10 MHz
time.sleep(3)
fgen = cfg.get_device("clkgen")
fgen.set_freq(10., float(eval(sys.argv[2])))
fgen = cfg.get_device("clkgen") # Reopen CP2112
fgen.set_freq(10., float(eval(sys.argv[2]))) # Set frequency
sys.stdout.write("Done.\r\n")
sys.stdout.flush()
sys.exit(0)