In previous video series entries ( Video Series 19, Video Series 20 and Video Series 21), we have seen how to generate a video output on the HDMI connector of a Zynq®-7000 SoC ZC702 Evaluation Kit. The ZC702 board uses an ADV7511 HDMI transmitter for the Video interface, but not all solutions use an external device.
For example, on a PYNQ™-Z2 board (link to Pynq-z2 product page), the HDMI connector is directly connected to the Zynq serial I/Os (note that this is also different from the solution on the ZCU102/ZCU104 or ZCU106 boards which use Gigabit Transceivers). The same steps could be applied to other boards such as the Digilent Arty Z7, Arty A7 or Zybo Z7.
In this entry in the Video Series, we will show how to create a small design to generate a pattern on the HDMI output of the Pynq-Z2 board.
About the PYNQ-Z2
The PYNQ-Z2 is a low cost board based on Xilinx Zynq SoC, designed to support the PYNQ (Python Productivity for Zynq) framework and embedded systems development.
Tutorial – DVI output using TMDS I/Os on a PYNQ-Z2 board
Note: This tutorial is intended to be used only with Vivado Design Suite 2018.1 and only with the PYNQ-Z2 board.
Extract the folder and copy the content to Xilinx\Vivado\2018.1\data\boards
Open Vivado 2018.1
Create a new project
In the Default Part window, you should see the pynq-z2 in the list. Select the PYNQ-Z2 board for the project
In Vivado, create a new block design (Select Flow > Create Block Design).
In the Block Design (BD), add the ZYNQ7 Processing System IP.
At the top of the BD click on Run Block Automation
Make sure that Apply Board Preset is enabled and click OK
Add a Video Test Pattern Generator (TPG) IP
At the top of the BD, click on Run Connection Automation
Double click on the ZYNQ7 processing system IP to configure it. In the Clock Configuration section, under PL Fabric Clocks, enable FCLK_CLK1 and set its clock frequency to 40MHz.
Close the ZYNQ7 processing system IP configuration GUI by clicking OK
Add a Video Timing Controller (VTC) IP and double click on it to open its configuration GUI
In the Detection/Generation Tab select Include AXI4-Lite Interface and deselect Enable Detection
In the Default/Constant tab, set the video mode to 800x600p
Connect the clk input from the VTC to the FLCK_CLK1 output of the Zynq PS IP
Add an AXI4-Stream to Video Out IP to the BD and double click on the IP to configure it. Change the clock mode to Independent
In the Tcl console, source the script tcl from the tutorial folder (XVES_0023/src/tcl)
This script will connect all of the IPs properly for this design.
Now, we have nearly built the same design as in the Video Series 21 which was on the ZC702 board. On the ZC702 board, the HDMI interface was done using the external ADV7511 HDMI Transmitter. On the PYNQ-Z2 we need to take care of the video interface inside the Programmable Logic (PL). We can do this using a free IP from Digilent called the rgb2dvi, which will generate DVI signals that we can use on the HDMI output connector of the PYNQ-Z2 board.
Download and unzip the Vivado-library from the Digilent git repository (Select Clone or Download > Download ZIP):
Extract the folder and add the XDC file to the project (File > Add Sources > Add or Create constraints)
Double click on the XDC file in the source window to open it in the text editor. Find the lines corresponding to the HDMI TX and uncomment the following lines (by removing the “#” symbol at the start of the line):
Run Synthesis and Implementation, and Generate the bitstream
Export the hardware to SDK, including the bitstream (File > Export > Export Hardware)
Create the Software Application
Launch SDK from Vivado (File > Launch SDK)
In SDK, create a new application project (File > New application project) and select the Hello World template
Open the helloworld.c file in the SDK text editor
Edit the file as follows (refer to Entry 21 of the Video Seriesfor more detail on the code)
#include "xv_tpg.h"XV_tpg tpg_inst;
/* TPG Initialization */
Status = XV_tpg_Initialize(&tpg_inst, XPAR_V_TPG_0_DEVICE_ID);
xil_printf("TPG configuration failed\r\n");
// Set Resolution to 800x600
// Set Color Space to RGB
//Set pattern to color bar
//Start the TPG
/* End of TPG code*/
Save the file
Connect the Pynq-Z2 to your computer using a micro USB cable and set the boot mode jumper to JTAG. Connect the PYNQ-Z2 to a HDMI monitor using the HDMI Out connector. Power on the PYNQ-Z2 board
Open a UART terminal and configure it for the correct COM port for the PYNQ-Z2