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
|
|
|
|
2014-08-13 18:30:57 +08:00
|
|
|
class DDSTest(AutoContext):
|
2014-12-03 18:20:30 +08:00
|
|
|
dds0 = Device("dds")
|
|
|
|
dds1 = Device("dds")
|
|
|
|
dds2 = Device("dds")
|
2014-12-02 17:19:05 +08:00
|
|
|
led = Device("gpio_out")
|
2014-09-05 12:03:22 +08:00
|
|
|
|
|
|
|
@kernel
|
|
|
|
def run(self):
|
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:
|
2014-12-03 18:20:30 +08:00
|
|
|
self.dds0.pulse(100*MHz + 4*i*kHz, 500*us)
|
|
|
|
self.dds1.pulse(120*MHz, 500*us)
|
|
|
|
self.dds2.pulse(200*MHz, 100*us)
|
2014-11-20 04:33:33 +08:00
|
|
|
self.led.off()
|