Skip to content

Commit

Permalink
pipistrello: expose LED{1..4} as RTIO channels.
Browse files Browse the repository at this point in the history
whitequark committed Nov 23, 2015
1 parent 7384527 commit 9fc7a42
Showing 2 changed files with 26 additions and 24 deletions.
14 changes: 5 additions & 9 deletions artiq/gateware/targets/pipistrello.py
Original file line number Diff line number Diff line change
@@ -128,12 +128,7 @@ def __init__(self, cpu_type="or1k", **kwargs):
"""
platform.add_extension(nist_qc1.papilio_adapter_io)

self.submodules.leds = gpio.GPIOOut(Cat(
platform.request("user_led", 0),
platform.request("user_led", 1),
platform.request("user_led", 2),
platform.request("user_led", 3),
))
self.submodules.leds = gpio.GPIOOut(platform.request("user_led", 4))

self.comb += [
platform.request("ttl_l_tx_en").eq(1),
@@ -170,9 +165,10 @@ def __init__(self, cpu_type="or1k", **kwargs):
self.submodules += phy
rtio_channels.append(rtio.Channel.from_phy(phy, ofifo_depth=4))

phy = ttl_simple.Output(platform.request("user_led", 4))
self.submodules += phy
rtio_channels.append(rtio.Channel.from_phy(phy, ofifo_depth=4))
for led_number in range(4):
phy = ttl_simple.Output(platform.request("user_led", led_number))
self.submodules += phy
rtio_channels.append(rtio.Channel.from_phy(phy, ofifo_depth=4))

self.add_constant("RTIO_REGULAR_TTL_COUNT", len(rtio_channels))

36 changes: 21 additions & 15 deletions doc/manual/core_device.rst
Original file line number Diff line number Diff line change
@@ -54,21 +54,27 @@ The low-cost Pipistrello FPGA board can be used as a lower-cost but slower alter

When plugged to an adapter, the NIST QC1 hardware can be used. The TTL lines are mapped to RTIO channels as follows:

+--------------+----------+------------+
| RTIO channel | TTL line | Capability |
+==============+==========+============+
| 0 | PMT0 | Input |
+--------------+----------+------------+
| 1 | PMT1 | Input |
+--------------+----------+------------+
| 2-16 | TTL0-14 | Output |
+--------------+----------+------------+
| 17 | EXT_LED | Output |
+--------------+----------+------------+
| 18 | USER_LED | Output |
+--------------+----------+------------+
| 19 | TTL15 | Clock |
+--------------+----------+------------+
+--------------+------------+------------+
| RTIO channel | TTL line | Capability |
+==============+============+============+
| 0 | PMT0 | Input |
+--------------+------------+------------+
| 1 | PMT1 | Input |
+--------------+------------+------------+
| 2-16 | TTL0-14 | Output |
+--------------+------------+------------+
| 17 | EXT_LED | Output |
+--------------+------------+------------+
| 18 | USER_LED_1 | Output |
+--------------+------------+------------+
| 19 | USER_LED_2 | Output |
+--------------+------------+------------+
| 20 | USER_LED_3 | Output |
+--------------+------------+------------+
| 21 | USER_LED_4 | Output |
+--------------+------------+------------+
| 22 | TTL15 | Clock |
+--------------+------------+------------+

The input only limitation on channels 0 and 1 comes from the QC-DAQ adapter. When the adapter is not used (and physically unplugged from the Pipistrello board), the corresponding pins on the Pipistrello can be used as outputs. Do not configure these channels as outputs when the adapter is plugged, as this would cause electrical contention.

0 comments on commit 9fc7a42

Please sign in to comment.