Skip to content

Commit

Permalink
adi/ad9084_mc.py: Support for Triton Rev.B
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hennerich <[email protected]>
  • Loading branch information
mhennerich committed Aug 9, 2024
1 parent 5b026c5 commit b67c8c7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 12 deletions.
44 changes: 37 additions & 7 deletions adi/ad9084_mc.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ def __init__(self, uri="", calibration_board_attached=False):
self._clock_chip_c = self._ctx.find_device("ltc6953_c")
self._clock_chip_f = self._ctx.find_device("ltc6953_f")

self._rx_dsa = self._ctx.find_device("hmc425a")
self._rx_dsa0 = self._ctx.find_device("dsa0")
self._rx_dsa1 = self._ctx.find_device("dsa1")
self._rx_dsa2 = self._ctx.find_device("dsa2")
self._rx_dsa3 = self._ctx.find_device("dsa3")

self._lpf_ctrl = genmux(uri, device_name="lpf-ctrl")
self._hpf_ctrl = genmux(uri, device_name="hpf-ctrl")
Expand All @@ -345,13 +348,40 @@ def __init__(self, uri="", calibration_board_attached=False):
self._cb_gpio = self._ctx.find_device("one-bit-adc-dac")

@property
def rx_dsa_gain(self):
"""rx_dsa_gain: Receiver digital step attenuator gain"""
return self._get_iio_attr("voltage0", "hardwaregain", True, self._rx_dsa)
def rx_dsa0_gain(self):
"""rx_dsa0_gain: Receiver digital step attenuator gain"""
return self._get_iio_attr("voltage0", "hardwaregain", True, self._rx_dsa0)

@rx_dsa_gain.setter
def rx_dsa_gain(self, value):
self._set_iio_attr("voltage0", "hardwaregain", True, value, self._rx_dsa)
@rx_dsa0_gain.setter
def rx_dsa0_gain(self, value):
self._set_iio_attr("voltage0", "hardwaregain", True, value, self._rx_dsa0)

@property
def rx_dsa1_gain(self):
"""rx_dsa1_gain: Receiver digital step attenuator gain"""
return self._get_iio_attr("voltage0", "hardwaregain", True, self._rx_dsa1)

@rx_dsa1_gain.setter
def rx_dsa1_gain(self, value):
self._set_iio_attr("voltage0", "hardwaregain", True, value, self._rx_dsa1)

@property
def rx_dsa2_gain(self):
"""rx_dsa2_gain: Receiver digital step attenuator gain"""
return self._get_iio_attr("voltage0", "hardwaregain", True, self._rx_dsa2)

@rx_dsa2_gain.setter
def rx_dsa2_gain(self, value):
self._set_iio_attr("voltage0", "hardwaregain", True, value, self._rx_dsa2)

@property
def rx_dsa3_gain(self):
"""rx_dsa3_gain: Receiver digital step attenuator gain"""
return self._get_iio_attr("voltage0", "hardwaregain", True, self._rx_dsa3)

@rx_dsa3_gain.setter
def rx_dsa3_gain(self, value):
self._set_iio_attr("voltage0", "hardwaregain", True, value, self._rx_dsa3)

@property
def lpf_ctrl(self):
Expand Down
16 changes: 11 additions & 5 deletions examples/Triton_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def measure_and_adjust_phase_offset(chan0, chan1, phase_correction):
return (sub_phases(phase_correction, [int(p * 1000)] * 4), s)


dev = adi.Triton("ip:192.168.2.1", calibration_board_attached=False)
dev = adi.Triton("ip:10.44.3.50", calibration_board_attached=False)

print(dev.rx_channel_nco_frequencies["axi-ad9084-rx-hpc"])
print(dev.rx_main_nco_frequencies["axi-ad9084-rx-hpc"])
Expand Down Expand Up @@ -99,17 +99,23 @@ def measure_and_adjust_phase_offset(chan0, chan1, phase_correction):
# dev.gpio_ctrl_rx_combined = 0

# Zero attenuation
dev.rx_dsa_gain = 0
dev.rx_dsa0_gain = 0
dev.rx_dsa1_gain = 0
dev.rx_dsa2_gain = 0
dev.rx_dsa3_gain = 0

dev.hpf_ctrl = 7
dev.lpf_ctrl = 12

# Set NCOs
dev.rx_channel_nco_frequencies = [0] * N_RX
dev.tx_channel_nco_frequencies = [0] * N_TX

dev.rx_main_nco_frequencies = [1000000000] * NM_RX
dev.tx_main_nco_frequencies = [3000000000] * NM_TX
dev.rx_main_nco_frequencies = [-2800000000] * NM_RX
dev.tx_main_nco_frequencies = [10000000000] * NM_TX

dev.rx_enabled_channels = RX_CHAN_EN
dev.tx_enabled_channels = [1] * N_TX
dev.tx_enabled_channels = [*range(N_TX)]
dev.rx_nyquist_zone = ["even"] * NM_TX

dev.rx_buffer_size = 2 ** 12
Expand Down

0 comments on commit b67c8c7

Please sign in to comment.