# PS GPIO Overlay

**URL:** <https://discuss.pynq.io/t/ps-gpio-overlay/2752>\
**Category:** Support\
**Created:** [June 14, 2021, 9:46am UTC](https://discuss.pynq.io/t/ps-gpio-overlay/2752 "2021-06-14T09:46:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickcamel](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/nickcamel/32/1650_2.png) [@nickcamel](https://discuss.pynq.io/u/nickcamel)\
**Post date:** [June 14, 2021, 9:46am UTC](https://discuss.pynq.io/t/ps-gpio-overlay/2752/1 "2021-06-14T09:46:48Z")

</div>

PYNQ Z1 board.

Are there any preloaded overlays that support: [PS GPIO — Python productivity for Zynq (Pynq)](https://pynq.readthedocs.io/en/v2.6.1/pynq_libraries/psgpio.html)

I know that preloaded overlays, enables inter-configurations for connecting buttons, switches, leds, io etc…

E.g logictools

```auto
logictools = LogicToolsOverlay('logictools.bit')
boolean_generator = logictools.boolean_generator

function_specs = ['D0 = PB0']
boolean_generator.setup(function_specs)

```

But I wonder if there is a preloaded overlay where one can use the link above to directly configure/write to D0, D1, etc…, trough:

```auto
from pynq import GPIO

output = GPIO(GPIO.get_gpio_pin(0), 'out')
input = GPIO(GPIO.get_gpio_pin(1), 'in')

output.write(0)
input.read()

```

The info about this section is more or less just “_The PS GPIO need to be connected to something in an overlay before they can be used_”.

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [June 14, 2021, 11:15am UTC](https://discuss.pynq.io/t/ps-gpio-overlay/2752/2 "2021-06-14T11:15:32Z")

</div>

Which board, and what are you trying to do?  
You wouldn’t typically have (lots of) GPIO connected directly to IO in an FPGA. You are effectively bypassing the FPGA by doing this.  
There is a example overlay for the PYNQ-Z1/Z2 here that has GPIO connected to buttons/switches/LEDs:  
[https://github.com/Xilinx/PYNQ\_Workshop](https://github.com/Xilinx/PYNQ_Workshop)  
This notebook:  
[https://github.com/Xilinx/PYNQ\_Workshop/blob/master/Session\_4/1\_ps\_gpio.ipynb](https://github.com/Xilinx/PYNQ_Workshop/blob/master/Session_4/1_ps_gpio.ipynb)

Cathal

---

<div class="post-metadata">

**Author:** ![nickcamel](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/nickcamel/32/1650_2.png) [@nickcamel](https://discuss.pynq.io/u/nickcamel)\
**Post date:** [June 14, 2021, 2:08pm UTC](https://discuss.pynq.io/t/ps-gpio-overlay/2752/3 "2021-06-14T14:08:06Z")

</div>

Sorry, updated. It’s PYNQ Z1 board.  
Question stands regardless of one typically would or wouldn’t do.  
As mentioned, e.g. logictools overlay (which is a builtin overlay if one uses the “official” SD card image) provides an easy way of connecting GPIO to buttons, switches, LEDs etc. But what I’m asking if there was a way of putting e.g. DIO0 high/low from PS without having to connect it to a button. That is python code to control the output… just like the example in the link. But the link assumes an overlay was first loaded, so I asked whether such an overlay is built in.

Anyway, I just had to build a bitstream which has access to 8 DIO pins as output and that serves my purpose.

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [June 15, 2021, 10:31am UTC](https://discuss.pynq.io/t/ps-gpio-overlay/2752/4 "2021-06-15T10:31:33Z")

</div>

OK, understood. No, there isn’t a built in overlay to do this, so building your own overlay was needed.

Cathal
