77范文网 - 专业文章范例文档资料分享平台

基于FPGA的数字电压表设计(4)

来源:网络收集 时间:2019-04-09 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

elsif cnt<5000 then clk_500hz<='0'; else cnt:=0;clk_500hz<='0';

end if;

end if;

end process;

process(clk,dw1) begin

if clk'event and clk='1' then case dw1 is

when 1=>x1<=d;x2<=k;---1 档

when 2=>x1<=k;x2<=d;---10 档

when others=>x1<=\

end case;

end if;

end process;

process(clk,v1,v2,v3,v4,v5) begin

if clk'event and clk='1' then case v1 is when 0=>xv1<=\

when 1=>xv1<=\ when 2=>xv1<=\ when 3=>xv1<=\ when 4=>xv1<=\ when 5=>xv1<=\ when 6=>xv1<=\ when 7=>xv1<=\ when 8=>xv1<=\ when 9=>xv1<=\

when others=>xv1<=\

end case;

case v2 is when 0=>xv2<=\

when 1=>xv2<=\ when 2=>xv2<=\ when 3=>xv2<=\ when 4=>xv2<=\ when 5=>xv2<=\ when 6=>xv2<=\ when 7=>xv2<=\

when 8=>xv2<=\

16

when 9=>xv2<=\

when others=>xv2<=\

end case; case v3 is when 0=>xv3<=\

when 1=>xv3<=\ when 2=>xv3<=\ when 3=>xv3<=\ when 4=>xv3<=\ when 5=>xv3<=\ when 6=>xv3<=\ when 7=>xv3<=\ when 8=>xv3<=\ when 9=>xv3<=\

when others=>xv3<=\

end case;

case v4 is when 0=>xv4<=\

when 1=>xv4<=\ when 2=>xv4<=\ when 3=>xv4<=\ when 4=>xv4<=\ when 5=>xv4<=\ when 6=>xv4<=\ when 7=>xv4<=\ when 8=>xv4<=\ when 9=>xv4<=\

when others=>xv4<=\

end case;

case v5 is when 0=>xv5<=\

when 1=>xv5<=\ when 2=>xv5<=\ when 3=>xv5<=\ when 4=>xv5<=\ when 5=>xv5<=\ when 6=>xv5<=\ when 7=>xv5<=\ when 8=>xv5<=\ when 9=>xv5<=\

when others=>xv5<=\

17

end case; end if; end process;

process(clk,reset) begin if reset='0'then dataram<=((\ (\

(\

elsif rising_edge(clk)then

dataram(0)<=v; dataram(1)<=g; dataram(2)<=xv1; dataram(3)<=x1; dataram(4)<=xv2; dataram(5)<=x2; dataram(6)<=xv3; dataram(7)<=xv4; dataram(8)<=xv5;

dataram(9)<=dw;

end if;

end process;

process(clk_500hz,reset,dataram) variable cntt,cnt2:integer; begin if reset='0'then current_state<=set_dlnf;

cntt:=0;cnt2:=0;

elsif rising_edge(clk_500hz)then case current_state is when set_dlnf=> lcden<='0'; lcdda<='0'; lcdrw<='0';

lcddata<=\功能设置 cntt:=cntt+1;

if cntt>delay and cntt<=delay*2 then

lcden<='1';

else

18

lcden<='0'; end if;

if cntt=delay*3 then

current_state<=clear_lcd; cntt:=0;

end if;

when clear_lcd=> lcden<='0';

lcdda<='0'; lcdrw<='0';

lcddata<=\清屏

cntt:=cntt+1;

lcden<='1';

else

lcden<='0'; end if;

if cntt=delay*3 then

current_state<=set_cursor; cntt:=0;

end if;

lcden<='0'; lcdda<='0'; lcdrw<='0';

lcddata<=\输入方式设置

cntt:=cntt+1;

lcden<='1';

else

lcden<='0'; end if;

if cntt=delay*3 then current_state<=set_dcb; cntt:=0;

end if;

lcden<='0'; lcdda<='0'; lcdrw<='0';

lcddata<=\---显示开关控制

cntt:=cntt+1;

if cntt>delay and cntt<=delay*2 then

lcden<='1';

19

if cntt>delay and cntt<=delay*2 then

when set_cursor=>

if cntt>delay and cntt<=delay*2 then

when set_dcb=>

else lcden<='0'; end if;

if cntt=delay*3 then

current_state<=set_location; cntt:=0; end if;

when set_location=>

lcden<='0'; lcdda<='0'; lcdrw<='0';

lcddata<=\ ---DDRAM1设置

cntt:=cntt+1;

if cntt>delay and cntt<=delay*2 then lcden<='1';

else

lcden<='0';

end if;

if cntt=delay*3 then

current_state<=write_data; cntt:=0; end if;

when write_data=>

lcden<='0'; lcdda<='1'; lcdrw<='0'; if cnt2<=9 then

lcddata<=dataram(cnt2); ---写数据

cntt:=cntt+1;

if cntt>delay and cntt<=delay*2 then lcden<='1';

else lcden<='0'; end if;

if cntt=delay*3 then

current_state<=write_data; cntt:=0;

cnt2:=cnt2+1;

end if;

else cnt2:=0;

current_state<=set_cursor;

20

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库基于FPGA的数字电压表设计(4)在线全文阅读。

基于FPGA的数字电压表设计(4).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/582791.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: