forked from M-Labs/artiq
1
0
Fork 0

examples/nac3devices: demonstrate new capabilities

This commit is contained in:
Sebastien Bourdeauducq 2021-11-28 12:48:18 +08:00
parent e45c194c49
commit b2f7022e0a
2 changed files with 25 additions and 4 deletions

View File

@ -10,6 +10,11 @@
"type": "zotino", "type": "zotino",
"ports": [0] "ports": [0]
}, },
{
"type": "mirny",
"ports": [1],
"clk_sel": "mmcx"
},
{ {
"type": "urukul", "type": "urukul",
"dds": "ad9912", "dds": "ad9912",

View File

@ -1,19 +1,26 @@
from artiq.experiment import * from artiq.experiment import *
from artiq.coredevice.core import Core from artiq.coredevice.core import Core
from artiq.coredevice.zotino import Zotino from artiq.coredevice.zotino import Zotino
from artiq.coredevice.urukul import CPLD from artiq.coredevice.mirny import Mirny as MirnyCPLD
from artiq.coredevice.adf5356 import ADF5356
from artiq.coredevice.urukul import CPLD as UrukulCPLD
from artiq.coredevice.ad9912 import AD9912 from artiq.coredevice.ad9912 import AD9912
@nac3 @nac3
class NAC3Devices(EnvExperiment): class NAC3Devices(EnvExperiment):
core: KernelInvariant[Core] core: KernelInvariant[Core]
zotino0: KernelInvariant[Zotino] zotino0: KernelInvariant[Zotino]
urukul0_cpld: KernelInvariant[CPLD] mirny0_cpld: KernelInvariant[MirnyCPLD]
mirny0_ch0: KernelInvariant[ADF5356]
urukul0_cpld: KernelInvariant[UrukulCPLD]
urukul0_ch0: KernelInvariant[AD9912] urukul0_ch0: KernelInvariant[AD9912]
def build(self): def build(self):
self.setattr_device("core") self.setattr_device("core")
self.setattr_device("zotino0") self.setattr_device("zotino0")
self.setattr_device("mirny0_cpld")
self.setattr_device("mirny0_ch0")
self.setattr_device("urukul0_cpld") self.setattr_device("urukul0_cpld")
self.setattr_device("urukul0_ch0") self.setattr_device("urukul0_ch0")
@ -21,14 +28,23 @@ class NAC3Devices(EnvExperiment):
def run(self): def run(self):
self.core.reset() self.core.reset()
self.core.delay(1.*ms) self.core.delay(1.*ms)
self.zotino0.init(False) self.zotino0.init()
self.zotino0.set_leds(0x15) self.zotino0.set_leds(0x15)
self.core.delay(1.*ms) self.core.delay(1.*ms)
self.zotino0.set_dac([1.2, -5.3, 3.4, 4.5], [0, 1, 2, 3]) self.zotino0.set_dac([1.2, -5.3, 3.4, 4.5], [0, 1, 2, 3])
self.core.break_realtime() self.core.break_realtime()
self.core.delay(1.*ms) self.core.delay(1.*ms)
self.urukul0_cpld.init(False) self.mirny0_cpld.init()
self.mirny0_ch0.init()
self.mirny0_ch0.set_att_mu(160)
self.mirny0_ch0.sw.on()
self.core.break_realtime()
self.mirny0_ch0.set_frequency(2500.*MHz)
self.core.break_realtime()
self.core.delay(1.*ms)
self.urukul0_cpld.init()
self.urukul0_ch0.init() self.urukul0_ch0.init()
self.urukul0_ch0.sw.on() self.urukul0_ch0.sw.on()
for i in range(10): for i in range(10):