FPGA实现HDMI输出

FPGA实现HDMI输出

对应的视频讲解

FPGA实现HDMI输出

FPGA实现HDMI输出有两种方式

  • 采用专门的HDMI芯片
  • 使用RTL完成TMDS编码

受限于FPGA本身时钟频率的限制,使用RTL完成TMDS编码的方式是很难完成高帧率的HDMI输出的,比如1080P@60Hz的像素时钟为148.5MHz,那么进行TMDS编码的5倍像素时钟就是742.5MHz,这么高的时钟频率对FPGA来说是一个很大的挑战。此外对于2K,4K这样的分辨率来说对时钟频率的要求就更高了,所以说使用RTL完成TMDS编码直接输出HDMI信号的方式比较适用于低分辨率的场景。

使用专门芯片的方式就比较简单了,主要就是配置该芯片的各种寄存器接口,这个DEMO里面使用的是RIGUKE的7100开发板,他这个开发板上面板载了一个HDMI IN和HDMI OUT的接口,其中HDMI OUT接口采用ADV7511芯片,最高支持1080P@60Hz的输出。

要完成一个HDMI的输出,只需要首先配置adv7511这个芯片,我们就直接采用PS端的c代码来配置这个芯片,代码如下:

c 复制代码
void adv7511_init(XIicPs *IicInstance) ;

int main(void)
{

	i2c_init(&ps_i2c1, XPAR_PS7_I2C_1_DEVICE_ID,100000);

	adv7511_init(&ps_i2c1) ;

	while(1);

	return 0;
}
c 复制代码
u8 adv7511_init_data[][2] =
{
		{0x41, 0x00},
		{0x98, 0x03},
		{0x9a, 0xe0},
		{0x9c, 0x30},
		{0x9d, 0x61},
		{0xa2, 0xa4},
		{0xa3, 0xa4},
		{0xe0, 0xd0},
		{0x55, 0x12},
		{0xf9, 0x00},
		{0x15, 0x00},
		{0xd0, 0x3c},
		{0xaf, 0x04},
		{0x4c, 0x04},
		{0x40, 0x00},
		{0xd6, 0xc0},
		{0xff, 0xff}
};


void adv7511_init(XIicPs *IicInstance)
{
	for(int i=0;;i++)
	{
		if((adv7511_init_data[i][0] == 0xff) && (adv7511_init_data[i][1] == 0xff))
		{
			break;
		}
		i2c_reg8_write(IicInstance, 0x72>>1, (unsigned char)adv7511_init_data[i][0], (unsigned char)adv7511_init_data[i][1]);
	}
}

在PL端首先例化了一个ZYNQ核

产生了一个彩条和纯色的切换的例子

彩条的代码如下:

verilog 复制代码
//color_bar
always @(posedge clk ) begin
    if(rst == 1'b1)begin
        color_bar_cnt <= 9'd0;
    end
    else begin
        if(s_video_de == 1'b1)begin
            if(color_bar_cnt == 9'd319)begin
                color_bar_cnt <= 9'd0;
            end
            else begin
                color_bar_cnt <= color_bar_cnt + 9'd1;
            end
        end
    end
end

always @(posedge clk ) begin
    if(rst == 1'b1)begin
        color_bar <= {8'd255, 8'd0, 8'd0};
    end
    else begin
        if(s_video_de == 1'b1)begin
            if(color_bar_cnt == 9'd319)begin
                color_bar <= {color_bar[15:8], color_bar[7:0], color_bar[23:16]};
            end 
        end
    end
end

彩条和纯色的切换代码如下:

verilog 复制代码
always @(posedge clk ) begin
    if(rst == 1'b1)begin
        ss_video_data <= 24'd0;
    end
    else begin
        case (select)
            2'd0: begin
                ss_video_data <= {8'd255, 8'd0, 8'd0};
            end 
            2'd1: begin
                ss_video_data <= {8'd0, 8'd255, 8'd0};
            end 
            2'd2: begin
                ss_video_data <= {8'd0, 8'd0, 8'd255};
            end 
            2'd3: begin
                ss_video_data <= color_bar;
            end 
            default: begin
                ss_video_data <= 24'd0;
            end
        endcase
    end
end

最后实现的效果如下:

FPGA_HDMI

对应的视频讲解

FPGA实现HDMI输出

相关推荐
FPGA小徐3 小时前
FPGA 时钟频率计算与单位换算
fpga开发
h×33 小时前
FPGA视频4分屏项目 - 系统架构详细讲解
fpga开发·音视频
秋93 小时前
硬件工程师全岗位薪资全景解析(2026版):IC设计·嵌入式·板级硬件·FPGA·晶圆制造
fpga开发·制造
博览鸿蒙3 小时前
FPGA 工程师到底有哪些方向?每个岗位都在干什么?一篇给你讲清楚
fpga开发
xiaojiaohuazi14 小时前
国产安陆EG4S20 FPGA实现千兆以太网TCP/IP:AD7606C 8通道1 MSPS采集、SDRAM缓存与Python上位机
tcp/ip·缓存·fpga开发
尤老师FPGA14 小时前
HDMI数据的接收发送实验(二十四)
fpga开发
MDYFPGA14 小时前
明德扬 Kintex-7 FPGA核心板及多接口扩展底板介绍
fpga开发·fpga
I'm a winner15 小时前
【源码】一文读懂 TDOA 无源时差定位原理
fpga开发
FPGA小迷弟15 小时前
FPGA复位策略深度解析:异步复位、同步释放与设计最佳实践
fpga开发·fpga
MDYFPGA15 小时前
Arria 10 10AX027 核心板适合哪些高速数据处理项目
fpga开发·fpga