能不能用字符串显示的方式来进行?比如
reg [1:8*10] message;
initial
begin
message="zheng";
end
但我发现这种定义在 write_lcd_data(message[?])时会报错,怎么调用?
下面这段是显示“zheng”这个字符串,用了这么多行才显示出来,
/以下为第二列显示
state_17:begin
if(wcom_lcd_flag==0)
begin
write_lcd_com(8'h80+8'h40+8'd0);//第二行第一个开始显示
state_group<=state_17;
end
else
begin
wcom_lcd_flag=0;
state_group<=state_18;
end
end
state_18:
begin
if(wdata_lcd_flag==0)
begin
write_lcd_data(8'h5a);//显示Z
state_group<=state_18;
end
else
begin
wdata_lcd_flag<=0;
state_group<=state_19;
end
end
state_19:
begin
if(wcom_lcd_flag==0)
begin
write_lcd_com(8'h80+8'h40+8'd1);//第二行第二个开始显示
state_group<=state_19;
end
else
begin
wcom_lcd_flag=0;
state_group<=state_20;
end
end
state_20:
begin
if(wdata_lcd_flag==0)
begin
write_lcd_data(8'h68);//显示h
state_group<=state_20;
end
else
begin
wdata_lcd_flag<=0;
state_group<=state_21;
end
end
state_21:
begin
if(wcom_lcd_flag==0)
begin
write_lcd_com(8'h80+8'h40+8'd2);//第二行第三个开始显示
state_group<=state_21;
end
else
begin
wcom_lcd_flag=0;
state_group<=state_22;
end
end
state_22:
begin
if(wdata_lcd_flag==0)
begin
write_lcd_data(8'h65);//显示e
state_group<=state_22;
end
else
begin
wdata_lcd_flag<=0;
state_group<=state_23;
end
end
state_23:
begin
if(wcom_lcd_flag==0)
begin
write_lcd_com(8'h80+8'h40+8'd3);//第二行第四个开始显示
state_group<=state_23;
end
else
begin
wcom_lcd_flag=0;
state_group<=state_24;
end
end
state_24:
begin
if(wdata_lcd_flag==0)
begin
write_lcd_data(8'h6e);//显示n
state_group<=state_24;
end
else
begin
wdata_lcd_flag<=0;
state_group<=state_25;
end
end
state_25:
begin
if(wcom_lcd_flag==0)
begin
write_lcd_com(8'h80+8'h40+8'd4);//第二行第五个开始显示
state_group<=state_25;
end
else
begin
wcom_lcd_flag=0;
state_group<=state_26;
end
end
state_26:
begin
if(wdata_lcd_flag==0)
begin
write_lcd_data(8'h67);//显示g
state_group<=state_26;
end
else
begin
wdata_lcd_flag<=0;
state_group<=state_27;
end
end