12864显示汉字,不出结果
程序我觉得没啥问题,就是不出结果。小弟想做的事12864显示汉字。
CLK 2MHZ
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY bishe1 IS
PORT (
clk : IN std_logic; --全局时钟
reset : IN std_logic; --异步复位
-- LCD12864的接口
lcd_data : OUT std_logic_vector(7 DOWNTO 0); --数据总线
lcd_en : OUT std_logic;
lcd_rs : OUT std_logic; --数据/指令
lcd_rw : OUT std_logic); --读/写
END bishe1;
architecture one of bishe1 is
type statetype is(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10); --定义一个有10个状态的状态机
signal state:statetype;
signal count:integer range 0 to 7; --数据计数器
type datatype1 is array (0 to 11) of std_logic_vector(7 downto 0);
type datatype2 is array (0 to 7) of std_logic_vector(7 downto 0);
type datatype3 is array (0 to 13) of std_logic_vector(7 downto 0);
type datatype4 is array (0 to 15) of std_logic_vector(7 downto 0); --自定义四个数据类型
constant hanzi1:datatype1:=("10110110","10111000","11000111","11101100","11010011","11001010","10110101","11100111",
"10110100","10110011","11010001","10100111");--
constant hanzi2:datatype2:=("11001101","10101000","11010000","11000101","10110100","11110011","11010100","10111010");
--存储通信学院
constant hanzi3:datatype3:=("10100011","10110000","10100011","10111001","10110101","11100111","11010000","11000101",
"11010110","11101100","10111111","10100001","10111110","11111100");--
constant hanzi4:datatype4:=("11010110","10111000","10110101","10111100","11000000","11001100","11001010","10100110",
"10100001","10100011","11001100","10110111","10100111","10110101","10111010","11101010");--
signal rs:std_logic:='0';
signal rw:std_logic:='0';
signal data:std_logic_vector(7 downto 0);
begin
lcd_rw if count=0 then data data rs rs rs rs rs rs rs rs count RS RS RS RS RS RS "10111111" THEN
XPAGE "01111111" THEN
YADDR RS RS RS "10111111" THEN
XPAGE "01111111" THEN
YADDR RS RS RS RS 15 THEN
YADDR RS RS RS 31 THEN
ADDR PRE_STATE<=ST0;
END CASE;
END IF;
ADDRESS<=CONV_STD_LOGIC_VECTOR(ADDR,5);
END PROCESS DATAK;
END BEHAV;
看下这个程序,
学习学习!