AXI GPIO in PYNQ Z2 for a pin package voltage control

I want to use the T10 pin on the PMODB of the Pynq Z2 as a control output. In Jupyter/Python, I want this pin to output a voltage of 3.3V when high and 0V when low. I have created an AXI GPIO in the block design and bound gpio_rtl_0_tri_io[0] to the T10 package pin in the Schematic I/O ports. I have generated the bitstream and uploaded it to the Pynq board. However, I’m unsure how to control the voltage level.

block design

I/O ports bound

python code I have tried

I haven’t found any tutorials specifically for this aspect. I’ve only seen tutorials for controlling LEDs or switches using GPIO.

There are a few tutorials which may be helpful here:

This video:

Example:

Cathal

Thank you for your contributions to the community! I watched the videos you made about PS GPIO and AXI GPIO, and I found them very helpful. However, I still have some questions. Regarding PS GPIO, how can I find the Linux index corresponding to the GPIO on the Pynq Z2, i.e., in the “get_gpio_pin(X)” function, how do I find the actual pin corresponding to X? I have the same question about AXI GPIO.

I’m thrilled to announce that I’ve successfully resolved the issue using this code. It’s incredibly concise, and I find it hard to believe that it took me four days to figure it out.

1 Like

Thanks a bunch for sharing this valuable information... Your expertise is truly appreciated!