Hi!
We are triggering our ARTIQ on an external trigger, in a similar way to what you once suggested:
https://forum.m-labs.hk/d/463-artiq-missing-triggers
`
def build(self):
self.setattr_device("core")
self.setattr_device('ttl0')
self.setattr_device('ttl4')
self.t0_cycle = np.int64(1)
@kernel
def run(self):
self.core.reset()
self.ttl0.input()
self.ttl4.output()
delay(1*ms)
# flush buffer
while self.ttl0.timestamp_mu(now_mu()) >= 0:
pass
delay(5.*us) # slack
self.ttl0._set_sensitivity(1)
for i in range(30):
delay(21*ms)
trigger_mu = self.ttl0.timestamp_mu(now_mu() + self.core.seconds_to_mu(80*ms))
if trigger_mu > 0:
at_mu(trigger_mu + self.core.seconds_to_mu(5*us))
self.t0_cycle = now_mu()
delay(100*us)
#our pulse
at_mu(self.t0_cycle + self.core.seconds_to_mu(5*1e-6))
self.ttl4.on()
at_mu(self.t0_cycle + self.core.seconds_to_mu(10*1e-6))
self.ttl4.off()
else:
print(trigger_mu)
self.ttl0._set_sensitivity(0)`
However, the artiq sometimes triggers on EMI pickup in the lab (due to high-voltage pulsers).
To solve that, I though to make sure the artiq triggers only on a trigger with a specific / minimum length.
That can be maybe done with measuring the rising edge, then the falling edge, and checking their difference in time.
Is this possible? How would you write it?
If not, do you have other suggestions?
Thanks in advance!
Eliana