From f97baa8aec4956d479620a47d798c5ebba5f4778 Mon Sep 17 00:00:00 2001 From: Marius Weber Date: Wed, 14 Apr 2021 16:20:44 +0100 Subject: [PATCH] phaser: workaround malformed output with `mixer_ena=1` & `nco_ena=0` When Phaser is powered on and `init()` is first called, enabling the DAC-mixer while leaving the NCO disabled causes malformed output. This commit implements a workaround by making sure the NCO is enabled, before being set to the disired state. This commit also avoids the following procedure, resulting in malformed output: 1. Operate Phaser with the DAC Mixer and NCO enabled 2. Set the NCO to a non-zero frequency 3. Disable the NCO in the device_db 4. Re-initialise Phaser After this procedure, with CMIX disabled, incorrect output is produced. To clear the fault one must re-enable the NCO and write the NCO freqeuncy to zero before disabling the NCO. Signed-off-by: Marius Weber --- artiq/coredevice/phaser.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/artiq/coredevice/phaser.py b/artiq/coredevice/phaser.py index 13ed4e37a..9b091b2b6 100644 --- a/artiq/coredevice/phaser.py +++ b/artiq/coredevice/phaser.py @@ -279,6 +279,16 @@ class Phaser: else: raise ValueError("DAC alarm") + # avoid malformed output for: mixer_ena=1, nco_ena=0 after power up + self.dac_write(self.dac_mmap[2] >> 16, self.dac_mmap[2] | (1 << 4)) + delay(40*us) + self.dac_sync() + delay(100*us) + self.dac_write(self.dac_mmap[2] >> 16, self.dac_mmap[2]) + delay(40*us) + self.dac_sync() + delay(100*us) + # power up trfs, release att reset self.set_cfg(clk_sel=self.clk_sel, dac_txena=0)