Hello, when I use a 50hz square wave to trigger another pulse sequence,why is its period changing?20ms、10ms,the code is as following,build part is omitted ,I am puzzled:
`
@kernel #this code runs on the FPGA
def run(self):
self.core.reset() #resets core device
self.ttl0.input()
self.ttl30.output() #sets TTL0 as an input
self.ttl6.output() #sets TTL0 as an input #sets TTL6 as an output
delay(1*us)
for i in range(1000000): #1us delay, necessary for using trigger, no error given if removed
gate_end_mu=self.ttl0.gate_rising(20*ms) #opens gate for rising edges to be detected on TTL0 for 10ms
#sets variable t_end as time(in MUs) at which detection stops
t_edge=self.ttl0.timestamp_mu(gate_end_mu) #sets variable t_edge as time(in MUs) at which first edge is detected
#if no edge is detected, sets t_edge to -1
if t_edge>0:
at_mu(t_edge)
delay(500*us) #set time cursor to position of edge
self.ttl30.on()
delay(3*ms)
self.ttl30.off()
self.core.reset()`