Commit f97f959b authored by Dave Newbold's avatar Dave Newbold

Adding I2C stuff to test script

parent 5492d082
......@@ -6,7 +6,24 @@ import sys
import collections
uhal.setLogLevelTo(uhal.LogLevel.ERROR)
board = uhal.getDevice("board", "ipbusudp-2.0://192.168.235.199:50001", "file://addrtab/top.xml")
hw = uhal.getDevice("board", "ipbusudp-2.0://192.168.235.199:50001", "file://addrtab/top.xml")
board.getNode("csr.ctrl.soft_rst").write(1) # Reset ipbus registers
board.dispatch()
hw.getNode("csr.ctrl.soft_rst").write(1) # Reset ipbus registers
hw.dispatch()
clock_I2C = I2CCore(hw, 10, 5, "i2c", None)
zeClock=si5344(clock_I2C)
res= zeClock.getDeviceVersion()
zeClock.setPage(0, True)
zeClock.getPage()
regCfgList=zeClock.parse_clk("Si5344.txt")
zeClock.writeConfiguration(regCfgList)
hw.getNode("io.freq.ctrl.chan_sel").write(i);
hw.getNode("io.freq.ctrl.en_crap_mode").write(0);
hw.dispatch()
time.sleep(2)
fq = hw.getNode("io.freq.freq.count").read();
fv = hw.getNode("io.freq.freq.valid").read();
hw.dispatch()
print "Freq:", i, int(fv), int(fq) * 119.20928 / 1000000;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment