ZYNQ最大的特点就是外部接口丰富,在ZEDBOARD上除了常用的UART,USB,VGA接口,网口外,最引人注目的就是HDMI接口了。图中很清楚了给出了ZEDBOARD上的各种接口。
从图中可以看出HDMI接口是与ZYNQ的PL逻辑部分相连的。所以,如果要让HDMI接口工作的话,我们必须对PL逻辑部分进行配置。下面我们开始来看看如何使用zedboard的HDMI接口。
首先,在PlanAhead中建立工程,所有选项和建立HELLOWORLD工程一样。建立完PlanAhead工程后,选择ADD SOURCES->Add or Create Embedded Sources打开XPS工具。这时候会弹出一个对话框问我们是否使用BSB向导来完成工程,
一般情况下,我们使用默认选项就可以了,但在这里,我为了省事,直接选用XILINX做好了的HDMI库(在WWW.ZEDBOARD.org网站上就有),于是我们就在Peripheral Repository Search path 这一栏里选择HDMI库的路径。一路NEXT直到Base System Builder窗口,如下图所示
在这步列出了默认情况下系统支持的硬件及IO接口,在我们这个项目中由于不需要SW和LED,所以我们需要把右边的东西全部删除。
在建立完项目之后,紧接着就是配置系统的PS外设了,由于我们需要使用IIC对外部进行配置,所以在这里我们选择打开IIC0,完成后结果如下图所示:
到此,基本完成了对于PS部分外围端口的配置了。下面就是对PL部分配置,XILINX给我们提供了很多可以使用的IP核。在这个例子中我们需要使用的IP核为AXI IIC Interface和fmc_imageon_hdmi_in。在XPS的IP CATALOG中分别双击这两个IP核导入到工程中。此时可以看到BUS INTERFACE栏下有4个项,其中两个就是我们刚才添加的AXI IIC Interface和fmc_imageon_hdmi_in。
紧接着就是要对这几个新增加的IP核分配时钟和输入输出引脚了,内部连接如下图所示:
外部与具体IO连接主要有约束文件来完成。整个约束文件的内容如下图所示:
NET "fmc_imageon_iic_0_Reset_pin" LOC = "N20"; # I2C_MUX_RST# - FMC1-D9 (LA01_n_CC)
NET "fmc_imageon_iic_0_Sda_pin" LOC = "K21"; # I2C_MUX_SDA - FMC1-G19 (LA16_n)
NET "fmc_imageon_iic_0_Scl_pin" LOC = "J20"; # I2C_MUX_SCL - FMC1-G18 (LA16_p)
# HDMI input
NET "fmc_imageon_hdmi_in_0_io_hdmii_spdif_pin" LOC = "A19"; # HDMII_SPDIF - FMC1-H29 (LA24_n)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[0]" LOC = "A22"; # HDMII_CBCR0 - FMC1-H38 (LA32_n)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[1]" LOC = "A21"; # HDMII_CBCR1 - FMC1-H37 (LA32_p)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[2]" LOC = "B22"; # HDMII_CBCR2 - FMC1-G37 (LA33_n)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[3]" LOC = "B21"; # HDMII_CBCR3 - FMC1-G36 (LA33_p)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[4]" LOC = "B15"; # HDMII_CBCR4 - FMC1-H35 (LA30_n)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[5]" LOC = "C15"; # HDMII_CBCR5 - FMC1-H34 (LA30_p)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[6]" LOC = "B17"; # HDMII_CBCR6 - FMC1-G34 (LA31_n)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[7]" LOC = "B16"; # HDMII_CBCR7 - FMC1-G33 (LA31_p)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[8]" LOC = "A17"; # HDMII_Y0 - FMC1-H32 (LA28_n)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[9]" LOC = "A16"; # HDMII_Y1 - FMC1-H31 (LA28_p)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[10]" LOC = "C18"; # HDMII_Y2 - FMC1-G31 (LA29_n)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[11]" LOC = "D21"; # HDMII_Y3 - FMC1-C27 (LA27_n)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[12]" LOC = "E18"; # HDMII_Y4 - FMC1-D27 (LA26_n)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[13]" LOC = "C17"; # HDMII_Y5 - FMC1-G30 (LA29_p)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[14]" LOC = "E21"; # HDMII_Y6 - FMC1-C26 (LA27_p)
NET "fmc_imageon_hdmi_in_0_io_hdmii_video_pin[15]" LOC = "F18"; # HDMII_Y7 - FMC1-D26 (LA26_p)
NET "fmc_imageon_hdmi_in_0_clk_pin" LOC = "D18"; # HDMII_LLC - FMC1-G2 (CLK1_M2C_p)
NET fmc_imageon_hdmi_in_0_clk_pin TNM_NET = hdmii_clk;
TIMESPEC TS_hdmii_clk = PERIOD hdmii_clk 148500 kHz; |