From 141cc7d99f2c3ed933723a844d50e4f1eaf35faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Mon, 5 Nov 2018 12:17:16 +0000 Subject: [PATCH] ad9910: fiducial timestamp for tracking phase mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Jördens --- artiq/coredevice/ad9910.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/artiq/coredevice/ad9910.py b/artiq/coredevice/ad9910.py index f26ce010b..6b679d826 100644 --- a/artiq/coredevice/ad9910.py +++ b/artiq/coredevice/ad9910.py @@ -128,6 +128,7 @@ class AD9910: time stamp. This is functionally equivalent to :const:`PHASE_MODE_ABSOLUTE`. The only difference is the fiducial time stamp. This mode is also known as "coherent phase mode". + The default fiducial time stamp is 0. :math:`\phi(t) = p + (t - T) f` Where: @@ -281,6 +282,9 @@ class AD9910: # Auto-clear phase accumulator on IO_UPDATE. # This is active already for the next IO_UPDATE self.write32(_AD9910_REG_CFR1, 0x00002002) + if phase_mode == PHASE_MODE_TRACKING and ref_time < 0: + # set default fiducial time stamp + ref_time = 0 if ref_time >= 0: # 32 LSB are sufficient. # Also no need to use IO_UPDATE time as this