From 031d8d08901505ebc6ef86c57d50e67d97dfef08 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 28 Aug 2015 16:29:56 +0800 Subject: [PATCH] doc/manual: add note about bidirectional TTL in tutorial --- doc/manual/getting_started_core.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/manual/getting_started_core.rst b/doc/manual/getting_started_core.rst index f5a05a5e0..8671f62c3 100644 --- a/doc/manual/getting_started_core.rst +++ b/doc/manual/getting_started_core.rst @@ -20,11 +20,16 @@ As a very first step, we will turn on a LED on the core device. Create a file `` def run(self): self.led.on() - The central part of our code is our ``LED`` class, that derives from :class:`artiq.language.environment.EnvExperiment`. Among other features, ``EnvExperiment`` calls our ``build`` method and provides the ``attr_device`` method that interfaces to the device database to create the appropriate device drivers and make those drivers accessible as ``self.core`` and ``self.led``. The ``@kernel`` decorator tells the system that the ``run`` method must be executed on the core device (instead of the host). The decorator uses ``self.core`` internally, which is why we request the core device using ``attr_device`` like any other. Copy the files ``ddb.pyon`` and ``pdb.pyon`` (containing the device and parameter databases) from the ``examples/master`` folder of ARTIQ into the same directory as ``led.py`` (alternatively, you can use the ``-d`` and ``-p`` options of ``artiq_run``). You can open the database files using a text editor - their contents are in a human-readable format. You will probably want to set the IP address of the core device in ``ddb.pyon`` so that the computer can connect to it (it is the ``host`` parameter of the ``comm`` entry). See :ref:`ddb` for more information. The example device database is designed for the NIST QC1 hardware on the KC705; see :ref:`board-ports` for RTIO channel assignments if you need to adapt the device database to a different hardware platform. +.. note:: + If the ``led`` device is a bidirectional TTL (i.e. ``TTLInOut`` instead of ``TTLOut``), you need to put it in output (driving) mode. Add the following at the beginning of ``run``: :: + + self.led.output() + delay(0.1*us) + Run your code using ``artiq_run``, which is part of the ARTIQ front-end tools: :: $ artiq_run led.py