有关FPGA驱动过LCD的不解

[复制链接]
 楼主| lgm888 发表于 2011-11-24 15:42 | 显示全部楼层 |阅读模式
有没有人用FPGA驱动过LCD???xilinx s 3E  系列的板子。可以给个历程。最后能给详解。谢谢啦。。
GoldSunMonkey 发表于 2011-11-24 19:13 | 显示全部楼层
这个我没有
GoldSunMonkey 发表于 2011-11-24 19:14 | 显示全部楼层
友情帮顶
Backkom80 发表于 2011-11-24 19:50 | 显示全部楼层
查你要控制的LCD屏的接口时序,按那个时序操作就可以了.
GoldSunMonkey 发表于 2011-11-24 19:52 | 显示全部楼层
fu10 发表于 2011-11-24 20:56 | 显示全部楼层
呵呵.....以为天上掉馅饼了;P
mr.king 发表于 2011-11-25 10:13 | 显示全部楼层
做过,你吧TFT资料和与XC3S的原理图传来,不知道你的显存是哪种片子,我看下是否方便改,我把以前的改下,包括ucf文件,然后给你发个bit.当然如果能改,你吧板子给我试验更好
fu10 发表于 2011-11-25 11:17 | 显示全部楼层
真掉馅饼了......
mr.king 发表于 2011-11-25 11:54 | 显示全部楼层
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date:    10:50:25 04/01/2010
-- Design Name:
-- Module Name:    contorl - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity contorl is
    Port (         fifordclk,sramrd,sramwr : out  STD_LOGIC;
                   rdfifodata : in  STD_LOGIC_VECTOR (15 downto 0);
                  test : buffer  STD_LOGIC;
                   vsync,hsync : out  STD_LOGIC;
                   dtmg : buffer  STD_LOGIC;
                                                fiforden:out STD_LOGIC;                   
                   tftout : out  STD_LOGIC_VECTOR (15 downto 0);
                   ramaddrout : out  STD_LOGIC_VECTOR (18 downto 0);
                   clk30m,clk60m0,clk60m90,reset : in  STD_LOGIC;
end contorl;

architecture Behavioral of contorl is
signal hcount:integer range 0 to 2047;
signal vcount,sramcontrolcount:integer range 0 to 1023;
signal rdaddr:integer range 0 to 480000;
signal displayen,rden,wren:STD_LOGIC;
signal readaddr:STD_LOGIC_VECTOR (17 downto 0);
signal colordata:STD_LOGIC_VECTOR (15 downto 0);

begin
        --颜色输出,行同步,场同步输出
        dotout:process(clk30m,reset)
        variable dtmgbuf,dtmgenable: std_logic;
        begin
                if reset='0' then
                        hcount<=0;
                        vcount<=0;
                        dtmgbuf:='0';
                        hsync<='1';
                        vsync<='1';
                        fiforden<='0';
                elsif rising_edge(clk30m) then
                        hcount<=hcount+1;
                        end if;
                        if hcount<128 then
                                hsync<='0';
                        else
                                hsync<='1';
                                if hcount>214 then
                                        fiforden<='1';
                                end if;       
                                if hcount>215 then
                                        if (hount mod 1)=0 then
                                                tftout<=rdfifodata(7 downto 0);
                                        else
                                                tftout<=rdfifodata(15 downto 7);
                                        end if;
                                        dtmgbuf:='1';
                                        if hcount>1015 then
                                                fiforden<='0';
                                                dtmgbuf:='0';
                                        end if;
                                end if;
                                if hcount=1055 then
                                        hcount<=0;
                                        vcount<=vcount+1;
                                end if;
                        end if;       
                        if vcount<2 then
                                vsync<='0';
                        else
                                vsync<='1';
                                if vcount>33 then
                                        displayen<='1';
                                        dtmgenable:='1';
                                        if vcount>513 then
                                                dtmgenable:='0';
                                                displayen<='0';
                                                if vcount=525 then
                                                        vsync<='0';
                                                        vcount<=0;
                                                end if;
                                        end if;
                                end if;       
                        end if;               
                        dtmg<=dtmgbuf and dtmgenable;
                end if;       
        end process dotout;
       
        --SRAM读入disfifo控制
        disfifocontrol:process(clk60m0,reset)
        begin
                if reset='0' then
                        hcount2=0;
                elsif faling_edge(clk60m0) then                --负沿控制fifowren防止与clk60m0竞争,clk60m正沿作为fifo写时钟
                        hcount2<=hcount2+1;
                        if hcount2<400 then
                                fifowren<='1';
                        else
                                fifowren<='0';
                        end if;                               
                end if;
        end if;
        end process disfifocontrol;
       
        --SRAM读地址控制
        sramaddrcontrol:process(clk60m90,reset)
        begin
                if reset='0' then
                        sramoe<='1';
                        ramaddrout="000000000000000000";
                        rdaddr<=1;
                        rden<='1';
                elsif rising_edge(clk60m90) then                                       
                        if hcount2<400 then                                                                                                                 --这段时间内数据从SRAM读入FIFO
                                rden<='1';
                                ramaddrout=conv_std_logic_vector(rdaddr,18);       
                                rdaddr=rdaddr+1;
                        end if;
                        if         rdaddr>384000 then
                                rdaddr<=0;
                        else                                                                                                                                                                                --这段时间内留给FIFO写入SRAM
                                rden<='0';
                                null;                        --代码待加
                       
                        end if;
                end if;               
        end process sramaddrcontrol;
       
       
end Behavioral;

begin
        process(h0,v0,x,y,clk,rst)
        begin
                if rst='0' then
                        addrorg<=conv_integer(v0)*800+conv_integer(h0);
                        xoffset<=0;
                        yoffset<=0;
                        addrtemp<=addrorg;
                        endflag<='0';
                elsif rising_edge(clk) then
                        if not(yoffset=y) then
                                if xoffset<(x-1) then
                                        xoffset<=xoffset+1;
                                        addrtemp<=addrtemp+1;
                                else
                                        xoffset<=0;
                                        addrtemp<=addrorg+800*(yoffset+1);
                                        yoffset<=yoffset+1;
                                end if;
                        else
                                endflag<='1';
                        end if;
                        addr<=CONV_STD_LOGIC_VECTOR(addrtemp,19);
                end if;
        end process;

end Behavioral;
fu10 发表于 2011-11-25 17:03 | 显示全部楼层
顶LS的哥们....:lol
AutoESL 发表于 2011-11-25 17:34 | 显示全部楼层
真掉馅饼了......
fu10 发表于 2011-11-25 11:17
:lol
AutoESL 发表于 2011-11-25 17:35 | 显示全部楼层
其实这个东西看起来比较高深,真做过的就知道要想简单的显示,点亮显示器,很容易
网上到处都是例子
AutoESL 发表于 2011-11-25 17:36 | 显示全部楼层
弄清楚行同步,场同步,前沿,后沿,之类的东西,弄一个计数器就可以控制了
AutoESL 发表于 2011-11-25 17:38 | 显示全部楼层
最简单的有个XUP V2板子上面那个自带的TFT例子,看懂就知道怎么修改了,那个支持640x480的分辨率,改成其他的很容易
GoldSunMonkey 发表于 2011-11-25 18:11 | 显示全部楼层
最简单的有个XUP V2板子上面那个自带的TFT例子,看懂就知道怎么修改了,那个支持640x480的分辨率,改成其他的很容易
AutoESL 发表于 2011-11-25 17:38

嘿嘿,我不知道哪有,否则我可以传一个
GoldSunMonkey 发表于 2011-11-25 18:11 | 显示全部楼层
弄清楚行同步,场同步,前沿,后沿,之类的东西,弄一个计数器就可以控制了
AutoESL 发表于 2011-11-25 17:36

存一个RAM,然后按照格式读。
GoldSunMonkey 发表于 2011-11-25 18:12 | 显示全部楼层
:lol
AutoESL 发表于 2011-11-25 17:34

是呀是呀
GoldSunMonkey 发表于 2011-11-25 18:12 | 显示全部楼层
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date:    10:50:25 04/01/2010
-- Design Name:
-- Module Name:    contorl -  ...
mr.king 发表于 2011-11-25 11:54

V5~
GoldSunMonkey 发表于 2011-11-25 18:12 | 显示全部楼层
GoldSunMonkey 发表于 2011-12-21 11:42 | 显示全部楼层
怎么了?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

123

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部

5

主题

123

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部