|

楼主 |
发表于 2003-9-2 11:23:45
|
显示全部楼层
epm3128atqfp100-10 i/o口使用请教!
[这个贴子最后由zhoujj在 2003/09/02 11:29am 第 1 次编辑]
vhdl
我是这样用的
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
Entity cv30nogb is
Port(dotclk,vgahsi,vgavsi:in std_logic;
vgadin:in std_logic_vector(1 downto 0);
sysres:in std_logic;
-- triin: in std_logic;
wru,rdu,wrl,rdl ut std_logic;-- vram
rdatau:inout std_logic_vector(7 downto 0); -- vram data upper
rdatal:inout std_logic_vector(7 downto 0); -- vram data lower
vaddrs ut std_logic_vector(14 downto 0); -- vram address
s,cp1,cp2 ut std_logic;
lcddu0,lcddu1,lcddu2,lcddu3:out std_logic;
lcddl0,lcddl1,lcddl2,lcddl3:out std_logic);
End cv30nogb;
Architecture jamesrtl of cv30nogb is
--component tri_state
-- port(indata,enable:in std_logic;
-- outdata: out std_logic);
--end component;
COMPONENT OPNDRN
PORT (a_in : IN STD_LOGIC;
a_out: OUT STD_LOGIC);
END COMPONENT;
signal vgadinca:std_logic;-- video data combin 1, for move to lcd
-- signal vgadincd:std_logic_vector(2 downto 0);
-- signal vgadincb:std_logic;-- video data combin 2, for write to vram
signal vdata_a:std_logic_vector(7 downto 0);-- video data shift register a
-- signal vdata_b:std_logic_vector(7 downto 0);-- video data shift register b
signal dinbit_c:std_logic_vector(2 downto 0); -- video data shift bit counter
signal cur_datamv_a:std_logic_vector(7 downto 0);-- backup a of move in register
-- signal cur_datamv_b:std_logic_vector(7 downto 0);-- backup b of move in register
signal cur_databu:std_logic_vector(7 downto 0);-- backup of read form vram
signal hcounter:std_logic_vector(8 downto 0);-- 9 bit hang counter 0~511
signal curr_page:std_logic;-- 0/1 present write upper/lower page
signal vaddrs_ofs:std_logic_vector(6 downto 0);-- coulum offset counter of every scan line
signal lcds_temp:std_logic;
-- signal vscan_c:std_logic;-- 1 bit frame counter
signal vgadclk:std_logic;
signal delay_c:std_logic_vector(3 downto 0);-- delay counter
signal vgahs:std_logic;
signal vgavs:std_logic;
signal cp1m : std_logic;
signal cp2m : std_logic;
signal lcddu_v,lcddl_v: std_logic_vector(3 downto 0);
--signal sm : std_logic;
--signal lcddu_v: std_logic_vector(3 downto 0);
--signal lcddl_v: std_logic_vector(3 downto 0);
signal sm : std_logic;
signal cpt1,cpt2 :std_logic;
signal vgadincat:std_logic;
--signal triin:std_logic;
--for U1,U2:tri_state use entity work.tri_state(rtl);
Begin
cp1m<= vgahsi ;
u1: opndrn port map(cp1m,cp1);--这个可以正常得到5v输出
lcddl0,1,2,3和lcddu0,1,2,3是经过比较复杂的变换后输出的
u4:opndrn port map(lcddl_v(0),lcddl0);
u5:opndrn port map(lcddl_v(1),lcddl1);
u6:opndrn port map(lcddl_v(2),lcddl2);
u7:opndrn port map(lcddl_v(3),lcddl3);
u8:opndrn port map(lcddu_v(0),lcddu0);
u9:opndrn port map(lcddu_v(1),lcddu1);
u10:opndrn port map(lcddu_v(2),lcddu2);
u11:opndrn port map(lcddu_v(3),lcddu3);--这几路信号都不正常,示波器上显示的是很多尖刺,有5v的,3v左右的,还有2v左右的,于是我的液晶屏上看到的画面不全
就是这样的问题啊,希望你能帮忙
按道理应该都是5v的信号才对啊,
编译工具:muxpluse 10.0
|
|