1602液晶屏驱动问题求助
时间:10-02
整理:3721RD
点击:
需要再LCD1602上的第二行显示一个字符串,应该是先设置地址,然后把字符串一个一个拷贝应该就可以了吧,但是为什么显示的时候第一行也会显示出数据呢?这是为什么?有没有人能帮帮我。
最终显示结果是
llo,World!
Hello,World!
其中字符串str0的值为Hello,World!
- --set dd ram address
- --upper-4--"C0"
- when st_disp14 =>
- SF_D <= x"C";
- LCD_E <= '1';
- LCD_RS <= '0';
- if(cnt_disp < 1) then
- cnt_disp := cnt_disp + 1;
- Cur_State <= st_disp14;
- else
- cnt_disp := 0;
- Cur_State <= st_disp15;
- LCD_E <= '0';
- end if;
- --lower-4
- when st_disp15 =>
- SF_D <= x"0";
- LCD_E <= '1';
- if(cnt_disp < 1)then
- cnt_disp := cnt_disp + 1;
- Cur_State <= st_disp15;
- else
- cnt_disp := 0;
- Cur_State <= st_disp16;
- LCD_E <= '0';
- cnt_rw := 0;
- end if;
- --Write the first Line
- when st_disp16 =>
- if(cnt_rw < 16)then
- Cur_State <= st_disp17;
- LCD_E <= '1';
- LCD_RS <= '1';
- SF_D <= str0(cnt_rw)(7 downto 4);
- else
- Cur_State <= st_disp26;
- LCD_E <= '0';
- LCD_RS <= '0';
- cnt_rw := 0;
- end if;
- when st_disp17 =>
- LCD_E <= '0';
- Cur_State <= st_disp18;
- when st_disp18 =>
- LCD_E <= '1';
- LCD_RS <= '1';
- SF_D <= str0(cnt_rw)(3 downto 0);
- Cur_State <= st_disp19;
- when st_disp19 =>
- LCD_E <= '0';
- cnt_rw := cnt_rw + 1;
- Cur_State <= st_disp16;
- when st_disp26 =>
- LCD_RS <= '0';
- LCD_E <= '0';
- Cur_State <= st_disp14;
最终显示结果是
llo,World!
Hello,World!
其中字符串str0的值为Hello,World!
ut一下就知道了。
使用LCD1602显示之前有一个初始化的过程,也就是设置LCD1602的显示模式,这个你做过了吗?
谢谢了,问题已解决!是我初始化的时候LCD_E信号忘了复位。
