Skip to content

Commit 2aff060

Browse files
committed
coredevice.suservo: clean up IO update alignment measurement
1 parent 9f34725 commit 2aff060

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

artiq/coredevice/suservo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ def measure_io_update_alignment(self, delay_start, delay_stop):
815815
# set up DRG
816816
self.set_cfr1(drg_load_lrr=1, drg_autoclear=1)
817817
# DRG -> FTW, DRG enable
818-
self.write32(ad9910._AD9910_REG_CFR2, 0x01090000)
818+
self.set_cfr2(drg_enable=1)
819819
# no limits
820820
self.write64(ad9910._AD9910_REG_RAMP_LIMIT, -1, 0)
821821
# DRCTL=0, dt=1 t_SYNC_CLK
@@ -843,12 +843,12 @@ def measure_io_update_alignment(self, delay_start, delay_stop):
843843
# un-mask DDS
844844
self.cpld.cfg_write(cfg_masked & ~(0xf << urukul.CFG_MASK_NU))
845845
at_mu(t + 0x20000 + delay_stop)
846-
self.cpld.io_update_ttl.pulse(self.core.mu_to_seconds(16 - delay_stop)) # realign
846+
self.cpld.io_update_ttl.pulse_mu(16 - delay_stop) # realign
847847
# re-mask DDS
848848
self.cpld.cfg_write(cfg_masked)
849849
ftw = self.read32(ad9910._AD9910_REG_FTW) # read out effective FTW
850-
delay(100*us) # slack
850+
delay(100 * us) # slack
851851
# disable DRG
852-
self.write32(ad9910._AD9910_REG_CFR2, 0x01010000)
853-
self.cpld.io_update.pulse(16 * ns)
852+
self.set_cfr2(drg_enable=0)
853+
self.cpld.io_update.pulse_mu(16)
854854
return ftw & 1

0 commit comments

Comments
 (0)