From 03d5f985f8032c5ae076c6dad4f6d8801fc6d473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 23 Sep 2020 15:40:54 +0000 Subject: [PATCH] phaser: another artiq-python signed integer quirk --- artiq/coredevice/dac34h84.py | 9 +++++---- artiq/coredevice/phaser.py | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/artiq/coredevice/dac34h84.py b/artiq/coredevice/dac34h84.py index 6d40826b3..155096a1e 100644 --- a/artiq/coredevice/dac34h84.py +++ b/artiq/coredevice/dac34h84.py @@ -121,10 +121,11 @@ class DAC34H84: path_c_sel = 2 path_d_sel = 3 # swap dac pairs (CDAB) for layout - dac_a_sel = 2 - dac_b_sel = 3 - dac_c_sel = 0 - dac_d_sel = 1 + # swap I-Q dacs for spectral inversion + dac_a_sel = 3 + dac_b_sel = 2 + dac_c_sel = 1 + dac_d_sel = 0 dac_sleep_en = 0b1111 # msb a clkrecv_sleep_en = 1 diff --git a/artiq/coredevice/phaser.py b/artiq/coredevice/phaser.py index 787e4990e..8acaf9010 100644 --- a/artiq/coredevice/phaser.py +++ b/artiq/coredevice/phaser.py @@ -651,7 +651,7 @@ class PhaserChannel: :param frequency: DUC frequency in Hz (passband from -200 MHz to 200 MHz, wrapping around at +- 250 MHz) """ - ftw = int32(round(frequency*((1 << 31)/(250*MHz)))) + ftw = int32(round(frequency*((1 << 30)/(125*MHz)))) self.set_duc_frequency_mu(ftw) @kernel @@ -689,7 +689,7 @@ class PhaserChannel: :param frequency: NCO frequency in Hz (passband from -400 MHz to 400 MHz, wrapping around at +- 500 MHz) """ - ftw = int32(round(frequency*((1 << 31)/(500*MHz)))) + ftw = int32(round(frequency*((1 << 30)/(250*MHz)))) self.set_nco_frequency_mu(ftw) @kernel @@ -831,7 +831,7 @@ class PhaserOscillator: :param frequency: Frequency in Hz (passband from -10 MHz to 10 MHz, wrapping around at +- 12.5 MHz) """ - ftw = int32(round(frequency*((1 << 31)/(12.5*MHz)))) + ftw = int32(round(frequency*((1 << 30)/(6.25*MHz)))) self.set_frequency_mu(ftw) @kernel