Hi,
I'm trying to program a fastino with a delay. However, I've notice anything above 5ms the system just skips over. Is this correct? The final use case is setting the output to a DC voltage and then after some time (seconds) to turn it off or to a lower voltage. Can this not be done? What is the correct way to do this?
from artiq.experiment import *
class fastio(EnvExperiment):
"""fastio with changing time"""
def build(self):
self.setattr_device("core")
self.setattr_device("fastino0")
def prepare(self):
self.voltages = [5.0,1.0]
@kernel
def run(self):
self.core.reset()
self.core.break_realtime()
self.fastino0.init()
delay(1*ms)
self.fastino0.set_leds(0x55)
delay(1*ms)
print("Start", self.core.get_rtio_counter_mu())
for i in range(len(self.voltages)):
self.fastino0.set_dac(0, self.voltages[i])
delay(10.0)
print("Mid",i, self.core.get_rtio_counter_mu())
self.fastino0.set_leds(0xAA)
delay(1*ms)
print("End", self.core.get_rtio_counter_mu())
Output:
INFO:worker(120,fast2.py):print:Start 141306383312
INFO:worker(120,fast2.py):print:Mid 0 141306593616
INFO:worker(120,fast2.py):print:Mid 1 141306713752
INFO:worker(120,fast2.py):print:End 14130690989600000000000000