From 2a5066ac5fb6acfe7b894a91f5e87a93e0bf8b71 Mon Sep 17 00:00:00 2001 From: occheung Date: Tue, 7 Jun 2022 13:49:14 +0800 Subject: [PATCH] 2118-2128: add <8ns short pulse example --- 2118-2128.tex | 11 ++++++++++- examples/ttl.py | 12 ++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/2118-2128.tex b/2118-2128.tex index beebe51..17fe27a 100644 --- a/2118-2128.tex +++ b/2118-2128.tex @@ -508,10 +508,19 @@ The channel should be configured as output in both the gateware and hardware. \newpage +\subsection{Sub-coarse-RTIO-cycle pulse} +With the use of the ARTIQ RTIO, only 1 event can be enqueued per coarse RTIO cycle, which is typically 8ns. +Therefore, to emit a pulse that is less than 8ns, additional delay is needed such that the \texttt{ttl.on()} \& \texttt{ttl.off()} event are submitted at different coarse RTIO cycles. +The TTL pulse parameter must satisfy the minimum pulse width stated in the electircal specifications. + +\inputcolorboxminted{firstline=88,lastline=92}{examples/ttl.py} + \subsection{Morse code} This example demonstrates some basic algorithmic features of the ARTIQ-Python language. \inputcolorboxminted{firstline=22,lastline=39}{examples/ttl.py} +\newpage + \subsection{Counting rising edges in a 1ms window} The channel should be configured as input in both the gateware and hardware. \inputcolorboxminted{firstline=47,lastline=52}{examples/ttl.py} @@ -520,7 +529,7 @@ This example code uses the software counter, which has a maximum count rate of a If the gateware counter is enabled on the TTL channel, it can typically count up to 125 million events per second: \inputcolorboxminted{firstline=60,lastline=65}{examples/ttl.py} -\newpage +To count falling edges or both rising \& falling edges, use \texttt{gate\char`_falling()} or \texttt{gate\char`_both()}. \subsection{Responding to an external trigger} One channel needs to be configured as input, and the other as output. diff --git a/examples/ttl.py b/examples/ttl.py index b98603e..7c38c80 100644 --- a/examples/ttl.py +++ b/examples/ttl.py @@ -78,3 +78,15 @@ class ExternalTrigger(EnvExperiment): timestamp_mu = self.ttlin.timestamp_mu(gate_end_mu) at_mu(timestamp_mu + self.core.seconds_to_mu(10*ms)) self.ttlout.pulse(1*us) + + +class ShortPulse(EnvExperiment): + def build(self): + self.setattr_device("core") + self.ttl0 = self.get_device("ttl0") + + @kernel + def run(self): + self.core.reset() + delay(6*ns) + self.ttl0.pulse(3*ns)