Overview
Starting from my first EBAZ4205 project on August '22 I tried to get the maximum processing power from the EBAZ4205 board, using its high speed I/O, the dual core CPU and the huge number of different IP's blocks to configure the PL (Programmable Logic).
In the 32 MHz Spectrum and SDR in an FPGA, barely completed on December '22, I managed to build a complete solution, nowadays achievable only with very much more expensive boards, but during that development I understood that the Zynq-7010 CPUs had the chance to supply an autonomous graphic interface, instead of using an external PC with some sort of graphics (in that case PyQt5).
Therefore, having the target to connect any kind of video monitor to the EBAZ4205 I examined the several options, choosing the following one.
HDMI without HW converter
Features
- It's digital
- you can use any HDMI display / TV
- It doesn't use any external device (except the HDMI display of course)
- the Zynq pins are directly connected to the HDMI port
- For the HW implementation, I got inspiration from the Digilent ZYBO schematic at page 5 and Digilent ZYBO Reference at page 21
- For the SW I started from:
- Digilent HDMI demo having also the HDMI input side that is useless to me
- Video Series 23: Generate a video output on Pynq-Z2 HDMI out which outputs a test pattern to the HDMI out
Development Environment
In this hackaday project I'll describe the Vivado Project and the HDMI wirings while the Petalinux and Vitis projects are described in my associated EBAZ4205_HDMI Github Repository.
If you don't feel like to build the Vivado project and the software (Linux Kernel, Root File System and programs) now, you can simply use my ready made SD card, insert it into the EBAZ4205 and go! See Description and Getting Started here.
HDMI interface
Before going to the schematic, you must understand a few things about HDMI. For a complete description see Wikipedia HDMI.
The main facts to me:
- HDMI = DVI (Digital Visual Interface) + DDC (Display Data Channel ) + CEC (Consumer Electronics Control) + HPD (Hot Plug Detector)
- DVI carries Audio and Video on a TMDS (Transition Minimized Differential Signaling) electrical interface
- HDMI transfers Video and Audio in one direction only from a Source (PC, Video Camera, ...) to a Sink (Video Display, Video Recorder, ...)
- The Video signal is carried by:
- 3 TMD(ifferential)S lines (Red Green and Blue)
- 1 TMD(ifferential)S line for the Clock
- Usually both the Source and the Sink have a female connector and therefore the most common HDMI cable is male to male.
- It is not a gender problem but for the HDMI the concepts of "male" and "female" are not completely clear and therefore you need a picture not to have doubts! In fact you can see that the HDMI male, despite being a male, has an internal receptacle inside whilethe HDMI female, despite being a female, has an inner protuberance.
In this picture you can also see how to build a cheap HDMI Female wiring, simply connecting a male with a double female. A double male cable costs about 2 Euros and a double female 1.5 Euros while a cable with a female costs 10 Euros and it is very uncommon as well!
HDMI Wirings
I started from the Digilent ZYBO schematic (at page 5) showing the wirings for an HDMI IN/OUT directly connected to the Zynq-7010 pins.
Two aspects:
- On ZYBO the HDMI Type A female connector serves both In and Out (of course not at the same time) while I wanted EBAZ4205 were always a "Source".
- Besides, I don't need the DDC channel and the CEC at the moment.
- I also got rid of 49.9 Ohm resistors, useful only as a line termination on the HDMI Sink side
Therefore I simplified the schematic in this way:
This table shows a few important things.
- The TMD(ifferential)S lines are ... "differential" i.e. when, for instance, D1P is at 3.3V D1N is at 0 and viceversa.
- The couple of differential lines is implemented by the special "Pin Type" TMDS33 that can be assigned to some Zynq-7010 pins. In fact you note that for instance:
- the C20 pin has name "IO_L1P_T0_AD0P_35" (please note the P)
- while B20 pin has name "IO_L1N_T0_AD0N_35" (please note the N)
- Therefore assigning the type TMDS33 to C20 and B20, you obtain that Zynq-7010 will use them as a whole differential line. See also the .xdc file in the Github Repository where you see:
set_property -dict { PACKAGE_PIN B20 IOSTANDARD TMDS_33 } [get_ports {TMDS_Data_n_0[0]}]; # DATA1_8 IO_L1N_T0_AD0N_35 set_property -dict { PACKAGE_PIN C20 IOSTANDARD TMDS_33 } [get_ports {TMDS_Data_p_0[0]}]; # DATA1_9 IO_L1P_T0_AD0P_35
The +5V and HotPlugDetect lines need further details.
- The Source has +5V line connected to ... +5V:
- permanently in the simplest solution
- by a software command in case the Source needs to command a virtual unplug/plug
- Therefore when the cable between Source and Sink is connected or the software command "plug" is issued:
- the Sink senses the +5V line and understands that a Source is connected
- the Sink answers setting the HPD line to +3.3V to signal to the Source that a Sink is connected
- the Sink sends a few data (supported resolutions, ....) to the Source via the DDC channel
- the Source senses the HPD line and starts sending Video/Audio
- Viceversa when the cable between Source and Sink is disconnected or the software command unplug" is issued by the Source:
- the Sink senses the +5V line going to zero and understands that a Source is not available anymore
- the Sink answers setting the HPD line to 0 V to signal to the Source (if connected) that the Sink understood the disconnection
- the Sink blanks the screen if any
- the Source receives HPD to 0 V as an unplug confirmation
A very reliable HDMI wirings
Using an HDMI cable directly connected to a 20 pin EBAZ socket as in the following picture, you can obtain all these resolutions (and probably many others not implemented in my sw "colorbars") with a 2 meters HDMI cable connected to a standard TV or HDMI monitor.
1 - 640x480@60Hz2 - 800x600@60Hz
3 - 1280x720@60Hz
4 - 1280x720@50Hz
5 - 1280x1024@60Hz
6 - 1920x1080@60Hz
7 - 1920x1080@30Hz
8 - 1920x1080@25Hz
pixel frequency up to 148 MHz (option 6)