forked from M-Labs/artiq
1
0
Fork 0

phaser: another artiq-python signed integer quirk

This commit is contained in:
Robert Jördens 2020-09-23 15:40:54 +00:00
parent ef65ee18bd
commit 03d5f985f8
2 changed files with 8 additions and 7 deletions

View File

@ -121,10 +121,11 @@ class DAC34H84:
path_c_sel = 2 path_c_sel = 2
path_d_sel = 3 path_d_sel = 3
# swap dac pairs (CDAB) for layout # swap dac pairs (CDAB) for layout
dac_a_sel = 2 # swap I-Q dacs for spectral inversion
dac_b_sel = 3 dac_a_sel = 3
dac_c_sel = 0 dac_b_sel = 2
dac_d_sel = 1 dac_c_sel = 1
dac_d_sel = 0
dac_sleep_en = 0b1111 # msb a dac_sleep_en = 0b1111 # msb a
clkrecv_sleep_en = 1 clkrecv_sleep_en = 1

View File

@ -651,7 +651,7 @@ class PhaserChannel:
:param frequency: DUC frequency in Hz (passband from -200 MHz to :param frequency: DUC frequency in Hz (passband from -200 MHz to
200 MHz, wrapping around at +- 250 MHz) 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) self.set_duc_frequency_mu(ftw)
@kernel @kernel
@ -689,7 +689,7 @@ class PhaserChannel:
:param frequency: NCO frequency in Hz (passband from -400 MHz :param frequency: NCO frequency in Hz (passband from -400 MHz
to 400 MHz, wrapping around at +- 500 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) self.set_nco_frequency_mu(ftw)
@kernel @kernel
@ -831,7 +831,7 @@ class PhaserOscillator:
:param frequency: Frequency in Hz (passband from -10 MHz to 10 MHz, :param frequency: Frequency in Hz (passband from -10 MHz to 10 MHz,
wrapping around at +- 12.5 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) self.set_frequency_mu(ftw)
@kernel @kernel