Image processing is a good way to show the co-processing environment of Xilinx Zynq SOC (System on Chip). This demo shows the application of several image filters to a streaming high definition video stream.
The stream is input from a bidirectional HDMI port, passed through the integrated FPGA, filters applied and passed out into the VGA port. The on-board ARM Cortex A9 processor is managing the inputs and allowing the booting from SD card.
The goal of this instructable is to give a user a quick demonstration of what the Zybo board is capable of. There is no programming of the board and instead you are using the previously prepared files that are loading on the microSD Card. This means that this demo does NOT require you to build the source files. To do that you will need to have a base level understanding of the Xilinx chain as well as familiarity with programming the Zynq processor. Steps to do this are not included in this instructable.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Gather Your Materials
Begin by gathering the materials for the demo
- Zybo Development Kit- you can purchase from Digilent Inc. directly.
- Zybo Accessory Kit- you can find these pieces individually, but Digilent runs a promotion that you buy this with your Zybo and you get $20.00 off, you will need to cart the Zybo and the option to select the kit as an add on appears.
- Voucher for Xilinx Vivado® Design Suite: Design Edition
- (One full seat, node locked, device-locked to the Zynq-7000 XC7Z010)
- 4GB Micro SD card
- Micro USB cable
- 5V 2.5A switching power supply
- VGA Cable to connect to a monitor
- Monitor capable of doing 720p with a VGA Input
- MicroSD Card Adapter
- Windows PC
- Camera capable of doing 720p streaming video over HDMI (most modern laptop computers work or a GoPro).
- active internet connection
Step 2: Format the Micro SD Card
Get your microSD card and get your computer to format it.
The Zybo reads files in the Fat32 Format.
It's recommended that you use a Windows PC:
- Connect SD card (My PC happens to have a SD Card slot, so I only needed a SD Card adapter to get it connected. Others may have different connections. )
- Once you have your SD Card connected to your PC find the SD Card then > Right Click > Select Format
- Select Fat32 (should be the Default)
- Click format.
If you have a Mac:
- Attach your SD Card > Open your Launchpad > Find the "Other" folder > Disk Utility
- Then you will open Disk Utility and you should see your SD Card.
- Select the actual SD Card Name (usually indented below the SD Card Description).
- Go to the Erase menu
- Select MS DOS (FAT)
Step 3: Download File and Put on SD Card
The Zynq chip (on the Zybo) has an ARM Cortex A9 processor integrated that allows you to boot from an SD Card.
Now that you have formatted your SD card in the correct file format, you need to put on the card what you want the board to load when it boots up.
This means you will need a BOOT.bin file.
You can download that file on the Digilent-Maker GIT Hub
or use the file attached on this page.
Once you have that file, drag it into your SD Card. It should reside in the main/root folder (no other folders).
Step 4: Put the SD Card in Your Zybo and Apply Power
Put your SD Card into your Zybo.
Make sure you change JP5 to the "SD" setting (load from SD Card)
Then, apply power using the wall plug (in the accessory kit).
It's important to make sure that your jumper is switched from USB Power (default how it ships) to Wall Power.
Once you have your board powered up you should see LD11 (red) and LD10 (green) turn on.
Step 5: Connect Your Camera (video Source)
Next you will connect your video source.
The way that the demo is written, the Zybo only advertises that it supports 780p resolution.
Most higher end cameras will adjust their output streams to what the display advertises.
It was this feature that helped us select using the GoPro.
The GoPro has microHDMI output and the Zybo has full HDMI input. You will need to get a micro to Full HDMI cable.
Plug both in and turn on the GoPro.
Step 6: Connect Your Monitor Using the VGA
Next connect your monitor using the VGA cable.
Make sure your monitor is on.
Once you have camera and monitor connected you setup is done!
Step 7: Play With the Video Stream!
The video conversions fall into two categories:
- Linear Filtering is controlled by the buttons.
- Color Space Conversion is controlled by the switches.
The bulk of the video conversions is being carried out in the programmable logic fabric (FPGA) of the Zynq 7010 part. If you want to dig into these conversions you can take a peek at the source code that is in git folder. We'll go into building these into a later tutorial, but for now it's about using the pre-loaded conversions.
Step 8: Buttons = Linear Filters
Three types of Linear Filtering has been employed:
- BTN1- Smoothing
- BTN2- Sobel (or Edge Detection)
- BTN3- Sharpening
- BTN0 - Returns the image to no Filter.
Step 9: Changing the Color Space Conversion
The switches change the color space.
Using 3 of the switches SW0-SW3 as binary inputs there are 8 possible selections that correspond to the color-space conversions that are programmed.
- 000- No conversion
- 001- grayscale
- 010- sepia
- 011- color inversion
- 100- BGR (red and blue channels are swapped, but green stays the same)
- 101- red only
- 110- green only
- 111- blue only
A good place to understand color conversions can be found here
Step 10: Troubleshooting
If the feed stops or looks corrupted, the first thing to try is to press the red PS-RST button.
e.g losing the video feed or video corruption
Alternatively you can power on or off the Zybo to do a hard reset.