Skip to content

Commit

Permalink
kasli_test: add RF switch control
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourdeauducq committed May 18, 2018
1 parent f457b59 commit f953bee
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions artiq/examples/kasli_basic/repository/kasli_tester.py
Expand Up @@ -156,14 +156,28 @@ def setup_urukul(self, channel, frequency):
channel.sw.on()
channel.set_att(6.)

@kernel
def rf_switch_wave(self, channels):
while not is_enter_pressed():
self.core.break_realtime()
# do not fill the FIFOs too much to avoid long response times
t = now_mu() - self.core.seconds_to_mu(0.2)
while self.core.get_rtio_counter_mu() < t:
pass
for channel in channels:
channel.sw.pulse(100*ms)
delay(100*ms)

# We assume that RTIO channels for switches are grouped by card.
def test_urukuls(self):
print("*** Testing Urukul DDSes.")

print("Initializing CPLDs...")
for name, cpld in sorted(self.urukul_cplds.items(), key=lambda x: x[0]):
print(name + "...")
self.init_urukul(cpld)
print("...done")

print("Frequencies:")
for card_n, channels in enumerate(chunker(self.urukuls, 4)):
for channel_n, (channel_name, channel_dev) in enumerate(channels):
Expand All @@ -173,6 +187,9 @@ def test_urukuls(self):
print("Press ENTER when done.")
input()

print("Testing RF switch control. Press ENTER when done.")
self.rf_switch_wave([channel_dev for channel_name, channel_dev in self.urukuls])

def run(self):
print("****** Kasli system tester ******")
print("")
Expand Down

0 comments on commit f953bee

Please sign in to comment.