VGA 时 序 分析 Vertical timing information 垂 直 扫 描 时 序 根 据 上 面 的 水 平 和 垂 直 扫 描 时 序 可 以 分 析 显 示 800x600 模 式 , FPGA 系 统 时 钟 采 用 Spartan-3E Starter Kit 板 上 的 50MHz的 有 源 晶 振 。为了显 示 器显 示 效果好, 采 用 刷新频率为 72Hz。 以 下以 系 统 时 钟 频率为 50MHz, 显 示 器显 示 800x600 模 式 为例分 析 水 平 扫 描 和 垂 直 扫 描 时 序 :系 统 时 钟 周期为1/50MHz=20ns 水 平 扫 描 Horizonal(Line) A 水 平 ( 行 ) 周 期 为 1040 个 像 素 (Pix), 时 间 为 1040x20ns=20.8us; B 同 步 脉 冲 为 120 像 素 ( Pix) ; C 后 沿 为 61 个 像 素 (Pix); D 有 效 时 间 为 806 个 像 素 (Pix); E 前 沿 为 53 个 像 素 。 /////////////////////////////////////水 平 扫描参数的设定/////////////////////////////////////////////////// parameter LinePeriod =12'd1040; parameter H_SyncPulse=10'd120; parameter H_BackPorch=10'd61; parameter H_ActivePix=10'd806; ///////////////////////////////////////水 平 扫描计数/////////////////////////////////////////////////////// always @ (posedge clk or negedge rst_n) if(!rst_n) x_cnt <= 1; else if(x_cnt == LinePeriod) x_cnt <= 1; else x_cnt <= x_cnt+ 1; ///////////////////////////////////水 平 扫描信号 hsync 产生/////////////////////////////////////////////////////// always @ (posedge clk or negedge rst_n) if(!rst_n) hsync_r <= 1'b1; else if(x_cnt == 1) hsync_r <= 1'b0; //产生 hsync 信号 else if(x_cnt == H_SyncPulse) hsync_r <= 1'b1; 垂直扫描 Vertical(Frame) O 垂直扫描周 期 为 666 个 行 扫描, 时 间 为 666x1040x20ns=13853us; P 同 步 脉 冲 为 6 个 行 扫描, 时 间 为 6x1040x20ns=125us; Q 后 沿 为 21 个 行 扫描, 时 间 为 21x1040x20ns=436us; R 有 效 时 间 为 604 个 行 扫描, 时 间 为 604x1040x20ns=12563us; S 前 沿 为 35 个 行 扫 描...