|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
需要再LCD1602上的第二行显示一个字符串,应该是先设置地址,然后把字符串一个一个拷贝应该就可以了吧,但是为什么显示的时候第一行也会显示出数据呢???这是为什么??有没有人能帮帮我。。。。
- --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! |
|