element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • 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
RoadTests & Reviews
  • Products
  • More
RoadTests & Reviews
Blog PYNQ-Z2 Dev Kit - Working with Base Overlays
  • Blog
  • RoadTest Forum
  • Documents
  • Events
  • RoadTests
  • Reviews
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • RoadTest
  • pynqworkshpch
  • pynq-z2
  • Share
  • Subscribe by email
  • More
  • Cancel
Related
Recommended

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.

 

 

 

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

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

2) import the peripheral classes

3) Instantiate the peripherals

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

 

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
Upload Preview

Anonymous

Top Comments

  • fmilburn
    fmilburn over 2 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 2 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
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 2 years ago

    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 expect the Arduino MKR Vidor board to do. 

     

    Frank

    • Cancel
    • Up +1 Down
    • Reply
    • More
    • Cancel
Element14

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 © 2022 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube