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

微波炉可编程逻辑控制系统设计(6)

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

可编程微波炉控制器系统的计

附录二 微波炉控制器系统程序清单

library IEEE;

use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL;

ENTITY seg73 IS

PORT (clk:IN std_logic; ---------- 时钟信号---------12

jiance,yiwei,dizeng,dijian,start,kaimeng:IN STD_LOGIC; ---分别是上电检测,移位,递增,递减,开始,开门-------53,58,57,56,52,39----

rst,xuandang:IN std_logic; ---------------复位,火候选挡----61,55-------

dataout:OUT std_logic_vector(6 DOWNTO 0); --------数码管的段输出---(99-91)-- en:out std_logic_vector(5 DOWNTO 0); ------数码管管脚----(1-6)------ dian:out std_logic;-------数码管的点输出------100------ bell:out std_logic; -----------蜂鸣器--------7----------

Lie:out std_logic_vector(7 downto 0);------点阵列-----------(82-73) hang:out std_logic_vector(7 downto 0); ---------点阵行---------(90-83) red,green,yellow:out std_logic;--72-70-71---彩灯

tishi:out std_logic_vector(3 downto 0));----69-66--彩灯组位置 END seg73;

ARCHITECTURE arch OF seg73 IS

signal clk1,clk2,dingshi,L,P:std_logic;-----------频率1和2,调时信号,绿色指示灯信号,开始信号,绿灯信号----------

signal cnt,cnt1:integer range 0 to 4; -----------用于计时------ signal data4:std_logic_vector(3 downto 0);

signal dataout_xhdl1:std_logic_vector(6 downto 0);-----------数码管段显示------------ signal en_xhdl:std_logic_vector(5 downto 0); --------数码管使能端的信号-----

signal led1,led3,led4,led5,led6,led21,led31,led41,led51,led61: std_logic_vector(3 downto 0); signal t:std_logic_vector(2 downto 0); -----点阵扫描信号传输---- begin

dataout<=dataout_xhdl1; ----------数码管端输出--------

en<=en_xhdl; -------------数码管位输出--------

tishi<=\ -----------只显示北面三盏灯-------------

--***********5000hz分频***********---------- process(clk)

variable cntt : integer range 1 to 500; begin

if(clk'event and clk='1')then if cntt=500 then

25

可编程微波炉控制器系统的计

cntt:=1; clk1<= not clk1; else

cntt:=cntt+1; end if; end if; end process;

---***************1s钟信号 ****************------ process(clk1)

variable cnt : integer range 1 to 25000; begin

if(clk1'event and clk1='1')then if cnt =25000 then

cnt:=1;clk2<= not CLK2; else

cnt:=cnt+1; end if; end if; end process;

--***********************正常时间倒计时设置*************************--- process(clk2,rst,L) begin

IF(rst='0') THEN

led1<=\ led3<=\ led5<=\ cnt1<=0;dingshi<='1';P<='1';

ELSIF(CLK2'EVENT AND CLK2='1') THEN

if (L='0' and kaimeng='0')then ---------------为了控制指示灯和防止用户忘记关门就直接开始工作导致微波伤害人体健康----------

cnt1<=0;---------------为了实现假如用户调节时间的时候不用一定要调节四位,就直接可以按开始按钮,数码管就不会不停止那里闪烁。 case led3 is when\ case led4 is when\ case led5 is

when\ case led6 is when\ led5<=\

26

可编程微波炉控制器系统的计

led4<=\ led3<=\ when others=>led6<=led6-1; end case; when others=> led5<=led5-1; end case;

when others=>led4<=led4-1; end case;

when others=>led3<=led3-1; end case;

elsif xuandang='0' then-----------------火候选挡---------- case led1 is

when \ when others=>led1<=led1+1; end case; end if;

--******************调时******************-- if dingshi='1' THEN if (yiwei='0') THEN if cnt1=4 then cnt1<=0; else

cnt1<=cnt1+1; end if;

elsif (dizeng='0') THEN -----dizeng=0时递增调时

case cnt1 is

when 4=>case led3 is

when\ led3<=\通过移移位按钮控制要调节的数码管, when others=> led3<=led3+1; end case;

when 3=>case led4 is when\ led4<=\ when others=> led4<=led4+1; end case;

when 2=>case led5 is

when\ led5<=\ when others=> led5<=led5+1; end case;

27

可编程微波炉控制器系统的计

when 1=>case led6 is

when\ led6<=\ when others=> led6<=led6+1; end case;

when others => null; end case;

elsif (dijian='0') THEN -----dijian=0时递减调时 case cnt1 is

when 4=>case led3 is

when\ led3<=\ when others=> led3<=led3-1; end case; when 3=>case led4 is

when\ led4<=\ when others=> led4<=led4-1; end case; when 2=>case led5 is

when\ led5<=\ when others=> led5<=led5-1; end case; when 1=>case led6 is

when\ led6<=\ when others=> led6<=led6-1; end case; when others => null; end case; end if; end if; end if;

----------------上电检查--------------------- IF jiance='0' then led1<=\ led3<=\ led5<=\ else led1<=\ led3<=\ led5<=\ end if;

--------------------------------------------------

28

可编程微波炉控制器系统的计

-------------提示语音-----------

if (led6=\then

bell<='1';------------提示时间到了,响声2s---------- green<='1'; led1<=\ else

bell<='0';

end if; END PROCESS;

------***************检查门有没有关好**************-------------- process(kaimeng,CLK2) begin IF(CLK2='1' and kaimeng='1' ) then ---当kaishi为1时 为危险使用----黄灯1s不停闪烁------- yellow<='1'; else

yellow<='0'; end if; end process;

---******************开关按键处理***********-- process(start,P)

variable n:integer range 0 to 1:=0;-----用于锁存---- begin

IF(CLK2'EVENT AND CLK2='1') THEN if (start='0' and n=0) then L<='0'; n:=n+1; red<='1';1 elsif (start='0' and n=1)OR (led6=\and led5=\and led4=\and led3=\ ------当倒计时结束时,红灯能自动灭。 n:=n+1; L<='1'; red<='0'; end if; end if;

29

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库微波炉可编程逻辑控制系统设计(6)在线全文阅读。

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