Hi everyone,
I am trying to write to the TRF registers to change the RF output from the Phaser board using the trf_write()
function. Currently I am writing to a total of 3 registers (registers 1, 2, 6), then a calibration using cal_trf_vco()
. However, the output I measure is not what is expected. For example, I want to output a frequency of 1655 MHz, but I get an output of 1132 MHz instead. I thought I was writing to the registers incorrectly but I have tried using something similar to the get_mmap()
method in the trf372017.py file and some of what the init()
is doing and still get the wrong output. This is code I have at the moment:
class PhaserExp(EnvExperiment):
rdiv = 25
ref_inv = 0
# more variables defined here #
def run(self):
self.core.reset()
self.phaser0.init()
self.phaser0.channel[1].en_trf_out(rf=0)
mmap = []
mmap.append(0x9 | (self.rdiv << 5) | (self.ref_inv << 19) | (self.neg_vco << 20) | (self.icp << 21)
| (self.icp_double << 26) | (self.cal_clk_sel << 27))
mmap.append(0xa | (self.nint << 5) | (self.pll_div_sel << 21) | (self.prsc_sel << 23) | (self.vco_sel << 26)
| (self.vcosel_mode << 28) | (self.cal_acc << 29) | (self.en_cal << 31))
mmap.append(0xe | (self.ioff << 5) | (self.qoff << 13) | (self.vref_sel << 21) | (self.tx_div_sel << 24)
| (self.lo_div_sel << 26) | (self.tx_div_bias << 28) | (self.lo_div_bias << 30))
self.change_rf(mmap)
@kernel
def change_rf(self, mmap):
self.core.break_realtime()
channel = self.phaser0.channel[1]
self.phaser0.set_cfg(clk_sel=0, dac_txena=0)
for data in mmap:
channel.trf_write(data)
channel.cal_trf_vco()
channel.en_trf_out()
self.phaser0.set_cfg(clk_sel=0)
channel.set_duc_cfg()
channel.set_att(0 * dB)
channel.oscillator[0].set_amplitude_phase(1.0, phase=0.)
channel.set_duc_frequency(0 * MHz)
self.phaser0.duc_stb()
When I tried to manipulate the values directly in the trf372017.py file, then calling the init() function in my run()
afterwards, I see the correct output. This makes me think that there is something different in how the trf registers are being updated in the phaser class vs how they are being updated in my run()
function in my experiment file. But I cannot seem to figure out the difference/what is causing the output to be different. Has anyone have this problem before or maybe I doing something wrong? Thanks.