element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
RoadTests & Reviews
  • Products
  • More
RoadTests & Reviews
Blog PYNQ-Z2 Dev Kit - Working with Base Overlays
  • Blog
  • RoadTest Forum
  • Documents
  • RoadTests
  • Reviews
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join RoadTests & Reviews to participate - click to join for free!
  • Share
  • More
  • Cancel
  • Author Author: ralphjy
  • Date Created: 29 Jun 2019 12:56 AM Date Created
  • Views 1723 views
  • Likes 6 likes
  • Comments 2 comments
Related
Recommended
  • RoadTest
  • pynqworkshpch
  • pynq-z2

PYNQ-Z2 Dev Kit - Working with Base Overlays

ralphjy
ralphjy
29 Jun 2019

As an introduction to FPGA programming the PYNQ-Z2 provides FPGA overlays.  An overlay is a generic FPGA design that provides some specific functionality, in essence a hardware library.  An overlay is generally programmed via a software abstraction layer that has a defined API.  The PYNQ-Z2 has a base overlay that provides access to its onboard and external peripheral interfaces via Python.  The base overlay bitstream is loaded when the PYNQ-Z2 boots up, so its functions are immediately available via Python.

 

The following diagram shows the structure of the base overlay.  The onboard peripherals are controlled by a fixed GPIO controller and the external peripherals are controlled using programmable MicroBlaze IO Processors (IOPs).  The base overlay also provides video and audio processing.

 

image

 

 

The next diagram show the location of the onboard peripherals and the external IO connectors.

image

Onboard peripherals

  • Four green LEDs (LD0-3)
  • Two multi-color LEDs (LD4-5)
  • Two slide switches (SW0-1)
  • Four push-buttons (BTN0-3)

 

External IO connectors

  • Raspberry Pi compatible 40 pin GPIO header
  • Arduino Uno compatible GPIO headers
  • Two Pmod connectors

 

The first workshop session demonstrates the use of the base overlay to control the onboard peripherals.  The programming is pretty straightforward.

 

1) import the BaseOverlay, the bitstream file is base.bit

image

2) import the peripheral classes

image

3) Instantiate the peripherals

image

4) control via the peripheral functions (e.g. on/off for LEDs)

image

 

Here is a short video showing the onboard peripheral control using the lab Jupyter notebook:

I apologize in advance that the board image is upside down in the video.  I need to do some work on my camera mounting and lighting.

I also use the term "function" a lot when I mean code segment.  I'll work on these things for the next video.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply

Top Comments

  • fmilburn
    fmilburn over 5 years ago +1
    Hi Ralph, Very nice and it seems easy enough so far I will be interested to see the process for adding outside buttons, LEDs and such not on the board to the GPIO pins. This is the kind of thing I would…
  • genebren
    genebren over 5 years ago

    Ralph,

     

    That is pretty cool.  It is nice to be able to follow along with a script and see the function occur.  This is sure a handy way to learn how to control the functions.

     

    Gene

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 5 years ago

    Hi Ralph,

     

    Very nice and it seems easy enough so far image  I will be interested to see the process for adding outside buttons, LEDs and such not on the board to the GPIO pins.  This is the kind of thing I would expect the Arduino MKR Vidor board to do. 

     

    Frank

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube