2014-09-30 17:38:02 +08:00
|
|
|
from artiq import *
|
2014-07-24 07:09:49 +08:00
|
|
|
|
2014-09-05 12:03:22 +08:00
|
|
|
|
2015-03-08 22:43:04 +08:00
|
|
|
class DDSTest(Experiment, AutoDB):
|
|
|
|
"""DDS test"""
|
2015-02-21 05:01:34 +08:00
|
|
|
|
2015-01-12 18:51:23 +08:00
|
|
|
class DBKeys:
|
2015-03-08 18:37:53 +08:00
|
|
|
core = Device()
|
2015-05-08 22:17:06 +08:00
|
|
|
dds_bus = Device()
|
2015-01-12 18:51:23 +08:00
|
|
|
dds0 = Device()
|
|
|
|
dds1 = Device()
|
|
|
|
dds2 = Device()
|
2015-05-08 14:44:39 +08:00
|
|
|
ttl0 = Device()
|
|
|
|
ttl1 = Device()
|
|
|
|
ttl2 = Device()
|
2015-01-12 18:51:23 +08:00
|
|
|
led = Device()
|
2014-09-05 12:03:22 +08:00
|
|
|
|
|
|
|
@kernel
|
|
|
|
def run(self):
|
2015-05-09 14:47:40 +08:00
|
|
|
with self.dds_bus.batch:
|
|
|
|
self.dds1.set(120*MHz)
|
|
|
|
self.dds2.set(200*MHz)
|
|
|
|
delay(1*us)
|
2015-05-08 14:44:39 +08:00
|
|
|
|
2014-09-10 16:06:27 +08:00
|
|
|
for i in range(10000):
|
2014-09-05 12:03:22 +08:00
|
|
|
if i & 0x200:
|
2014-11-20 04:33:33 +08:00
|
|
|
self.led.on()
|
2014-09-05 12:03:22 +08:00
|
|
|
else:
|
2014-11-20 04:33:33 +08:00
|
|
|
self.led.off()
|
2014-09-05 12:03:22 +08:00
|
|
|
with parallel:
|
|
|
|
with sequential:
|
2015-05-08 14:44:39 +08:00
|
|
|
self.dds0.set(100*MHz + 4*i*kHz)
|
|
|
|
self.ttl0.pulse(500*us)
|
|
|
|
self.ttl1.pulse(500*us)
|
|
|
|
self.ttl2.pulse(100*us)
|
2014-11-20 04:33:33 +08:00
|
|
|
self.led.off()
|