PYNQ: PYTHON PRODUCTIVITY FOR ZYNQ

PYNQ Z2 with Pmod OLED RGB

Hello,
I have used Pmod OLED with the PYNQ-Z2 and it works well. But, when I remove it and connect the Pmod OLED rgb, nothing happens. Here is a piece of the simplified code I am using. I appreciate your help.
FYI: This is my 2nd day of working with FPGA smile: :smile: it will be very helpful if guide me in a simple and pedagogical fashion :wink:

from pynq.overlays.base import BaseOverlay
base = BaseOverlay("base.bit")
from pynq.lib.pmod import Pmod_OLED
pmod_oled = Pmod_OLED(base.PMODA)
pmod_oled.clear()
pmod_oled.write("Resonance is @ " +"\n"+ "10"+" GHz")

The Pmod Oled RGB is a different module, and would need a different driver. It isn’t currently included in the PYNQ image, so you would need to write this yourself.

Cathal

Thanks a lot. As I am a newbie, I have some difficulty to see how to include that module in the PYNQ image. Is there any tutorial to do this? Any clue or reference to a book, website or whatever it is, to know how to take the first step and write that code?.
Cheers,

I should mention, we have support for a Grove RGB LED you may want to check

I’ll explain how the existing Pmod OLED works and this should give you an idea about whay you might need to do.

The Pmod port is controlled by a MicroBlaze soft processor. There is a C application running on the MicroBlaze. This code is here:


For new peripherals, you can usually find reference c code on the vendor website. You can usually uses this as a starting point, and port this to the MicroBlaze. If you look in the folder in the link above, you can see a make file to build this.
The executable is a bin file, you can find it a level up in the GitHub repo.

You then need a Python API. You can find this here.

If you study the code, you should be able to see how this works, and how commands are transferred.

You could try take an existing peripheral and modify the code for the new peripheral.

Depending on the peripheral, you may be able to also be able to use the MicroBlaze API:


This is probably more suited to simpler IPs.

If you are familiar with MicroBlaze programming, this should be reasonably straightforward. If you are very new to FPGA development, this could be challenging, but post back if you have questions and we can try guide you towards appropriate resources.

Cathal