From 4b4fd32e3d756e555c593ba33a621c6602b32e5c Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Fri, 14 Oct 2016 13:21:42 +0200 Subject: [PATCH] phaser: add another sawg demo --- artiq/examples/phaser/repository/demo.py | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 artiq/examples/phaser/repository/demo.py diff --git a/artiq/examples/phaser/repository/demo.py b/artiq/examples/phaser/repository/demo.py new file mode 100644 index 000000000..ba67b96a4 --- /dev/null +++ b/artiq/examples/phaser/repository/demo.py @@ -0,0 +1,50 @@ +from artiq.experiment import * + + +class SAWGTest(EnvExperiment): + def build(self): + self.setattr_device("core") + self.setattr_device("led") + self.setattr_device("ttl_sma") + + self.setattr_device("sawg0") + self.setattr_device("sawg1") + self.setattr_device("sawg2") + self.setattr_device("sawg3") + + @kernel + def run(self): + self.core.break_realtime() + self.ttl_sma.output() + + while True: + self.sawg0.set_amplitude(0.) + self.sawg0.set_frequency(0*MHz) + self.sawg1.set_amplitude(0.) + self.sawg1.set_frequency(0*MHz) + delay(20*ms) + + self.sawg0.set_amplitude(.4) + self.sawg0.set_frequency(10*MHz) + self.sawg0.set_phase(0.) + self.sawg1.set_amplitude(.4) + self.sawg1.set_frequency(10*MHz) + self.sawg1.set_phase(0.) + self.ttl_sma.pulse(200*ns) + self.sawg1.set_amplitude(.1) + delay(200*ns) + self.sawg1.set_amplitude(-.4) + self.ttl_sma.pulse(200*ns) + self.sawg1.set_amplitude(.4) + delay(200*ns) + self.sawg1.set_phase(.25) + self.ttl_sma.pulse(200*ns) + self.sawg1.set_phase(.5) + delay(200*ns) + self.sawg0.set_phase(.5) + self.ttl_sma.pulse(200*ns) + self.sawg1.set_frequency(30*MHz) + delay(200*ns) + self.sawg1.set_frequency(10*MHz) + self.sawg1.set_phase(0.) + self.ttl_sma.pulse(200*ns)