- Edited
dpn Thank you, that helps. Do you see a mistake in my calculation of dt_mu
below? Or another logic error?
- In
device_db.py
, Urukul 0 is set to 1 GHzSYS_CLK
and 250 MHzSYNC_CLK
. - I verify that
self.urukul0_ch0.sync_data.io_update_delay == self.urukul0_ch0.tune_io_update_delay()
. - I schedule
self.urukul0_ch0.io_update.pulse_mu(8)
only at coarse RTIO time stamps because only those have a constant delay to the SYS_CLK cycle where the new FTW comes into effect. I also store the time stampnow_mu()
right before eachself.urukul0_ch0.io_update.pulse_mu(8)
like so:# align to coarse RTIO which aligns SYNC_CLK at_mu(now_mu() & ~7) delay_mu(int64(self.urukul0_ch0.sync_data.io_update_delay)) # store time stamp self.urukul0_ch0.t_acc_start_mu = now_mu() # transfer new FTW to active output register self.urukul0_ch0.io_update.pulse_mu(8)
- At the next frequency change, the duration
dt_mu
of phase accumulation only depends on the difference of the two time stamps:# align to coarse RTIO which aligns SYNC_CLK at_mu(now_mu() & ~7) delay_mu(int64(self.urukul0_ch0.sync_data.io_update_delay)) # calculate duration of phase accumulation now = now_mu() dt_mu = now - self.urukul0_ch0.t_acc_start_mu # store new time stamp self.urukul0_ch0.t_acc_start_mu = now # transfer mirror frequency 1 to active output register self.urukul0_ch0.io_update.pulse_mu(8)