久久ER99热精品一区二区-久久精品99国产精品日本-久久精品免费一区二区三区-久久综合九色综合欧美狠狠

新聞中心

EEPW首頁 > 嵌入式系統 > 設計應用 > 基于NIOS II嵌入式處理器實現LCD的控制

基于NIOS II嵌入式處理器實現LCD的控制

作者: 時間:2011-11-07 來源:網絡 收藏

ENTITY _interface IS
PORT(
reset :IN std_logic;
lcd_clk :IN std_logic;
Wrdata :IN std_logic_vector(17 downto 0);
hsync :OUT std_logic;
vsync :OUT std_logic;
enable :OUT std_logic;
lcd_R/L :OUT std_logic;
lcd_U/D :OUT std_logic;
sel_VGA_QVGA :OUT std_logic;
RGB :OUT std_logic_vector(17 downto 0);
end_of_picture :OUT std_logic);
END _interface;
ARCHITECTURE trans OF _interface IS
process(lcd_clk) begin
if(rising_edge(lcd_clk)) then
if(hcnt400) then
hcnt=hcnt+1;
else
hcnt=(others=>0);
end if;
end if;
end process;--行計數器模塊
process(lcd_clk) begin
if(rising_edge(lcd_clk)) then
if(hcnt=320) then
if(vcnt262) then
vcnt= vcnt+1;
else
vcnt=(others=>0);
end if;
end if;
end if;
end process;--場計數器模塊
process(lcd_clk) begin
if(rising_edge(lcd_clk)) then
if((hcnt>= 320+20+20 ) and (hcnt320+20+20+40)) then
hs=0;
else
hs=1;
end if;
end if;
end process;--產生水平同步脈沖
process(vcnt)begin
if((vcnt>=240+6+6)and(vcnt240+6+6+10)) then
VS=0;
else
vs=1;
end if;
end process;--產生場同步脈沖
process(lcd_clk) begin
if(rising_edge(lcd_clk)) then
if(hcnt320 and vcnt240)and(hcnt>20 and vcnt>6) then
en=1;
else
en=0;
end if;
end if;
end process;--產生顯示使能信號
process(led_clk)begin
if(rising_edge(lcd_clk))then
if(hcnt320 and vcnt240)then
RGB=Wdata;
else
RGB=(others=>0);
end if;
end if;
end process;--像素輸出及消隱
process(lcd_clk)begin
if(rising_edge(lcd_clk))then
if((vcnt=320+1)and(hcnt=0))then
end_of_picture=1;
else
end_of_picture=0;
end if;
end if;
end process;--一幀傳輸完畢
END ARCHITECTURE trans;

  3 DMA流程及實驗結論

  3.1 DMA傳輸方式下的程序流程

  利用該方案LCD的顯示已在某面陣CCD采集系統中得到驗證。在實際的系統中,該部分主要所采集的面陣CCD圖像傳感器圖像數據的動態顯示。在實際的采集系統中選用了2個DMA,一個用于圖像數據的采集,一個用于采集后圖像的再現。在文中僅介紹了顯示DMA傳輸控制方式下的相應模塊。實際系統中,圖像數據從面陣CCD圖像傳感器以DMA控制方式將圖像數據采集到SDRAM,所采集后的圖像數據從SDRAM到LCD顯示。實際系統中的DMA控制流程如圖3。

本文引用地址:http://cqxgywz.com/article/150072.htm


  3.2實驗結論

  根據圖3所采集到的面陣CCD的圖像數據保存在SDRAM中,按一定比例抽取的圖像數據在SDRAM中合成18位的RGB圖像信號,而后在 以及顯示DMA的控制下,將一幀完整的圖像顯示在LCD上,實際控制的顯示結果如圖4。

  4 結束語

  利用 作為FPGA控制LCD的解決方案,能較容易地圖像數據的DMA傳輸與控制,系統中可根據實際需求有選擇的定制相應模塊,使系統具有較強的靈活性。同時由于采用“軟”硬件實現LCD的控制,調試過程中通過不斷更改“軟件”就可達到改進硬件功能的目的。

linux操作系統文章專題:linux操作系統詳解(linux不再難懂)

上一頁 1 2 下一頁

評論


相關推薦

技術專區

關閉