- Edited
Hi all, first post here. Running with ARTIQ 7 on Kasli-EEM Controller.
I'm hoping for a little help trying to understand how to read out a TTL channel very quickly as I believe I have some confusion over how things work.
For context, I have a PMT running into a TTL input and it works fine. Generally, I just use something like the following code for my needs:
...
@kernel
def readout(self):
pmt_active = self.pmt.gate_rising(2 * ms)
total_counts = self.pmt.count(pmt_active)
...
Recently, I'd like to bin the exposure instead; i.e. I would like to break my 2 ms exposure time into many short bins of say 1-20 us and possibly insert some logic between them. I am constantly running into RTIO Underflow errors unless I insert delays of about 5 us between bins. This is far too long, so I am wondering if there are some tricks for speeding things up. One idea I had come across was to split the PMT signal into 2 TTL inputs and read them out alternatingly:
...
@kernel
def fast_readout(self):
for _ in range(200):
pmt1_active = self.pmt1.gate_rising(10*us)
total_counts+=self.pmt1.count(pmt1_active)
delay(100*ns)
pmt2_active = self.pmt2.gate_rising(10*us)
total_counts+=self.pmt2.count(pmt2_active)
delay(100*ns)
...
To my surprise, this code produces RTIO Underflow errors until the delay between the exposure periods is... 5 us, exactly the same as with a single input channel. My understanding was that the gate_rising() call would advance the timeline cursor to the end of the active period at which point the next exposure would be scheduled and so on... but I must be mistaken. I had been basing this understanding off of the RTI/O Docs, of course;
https://m-labs.hk/artiq/manual-release-3/rtio.html#input-channels-and-events
I am wondering if anyone can weigh in as to why my approach doesn't work? Do I even need to bother splitting the PMT into 2 channels in the first place?