已阅读5页,还剩11页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
西安文理学院物理与机械电子工程学院课程设计报告专业班级 10级电子信息工程2班 课 程 CPLD/FPGA技术及应用 题 目 微波炉控制器的设计 学 号 08101100219 姓 名 李斌 同 组 人 王景 成 绩 2013年6月一、设计目的(1)熟练掌握EDA工具软件QuartusII的使用;(2)熟练用VHDL硬件描述语言描述数字电路;(3)学会使用VHDL进行大规模集成电路设计;(4)学会用CPLDFPGA使用系统硬件验证电路设计的正确性;(5)初步掌握EDA技术并具备一定的可编程逻辑芯片的开发能力。二、系统总体设计 (1)设计要求 设计一个微波炉控制器,要求能控制烹调的开关,并显示烹调状态(如启停、暂停) 。同时,能设置烹调时间,并显示烹调所剩时间(假设最大烹调时间为59分59秒)。 (2)设计原理及思路: 现在设计一个微波炉控制器。其外部接口如图1 所示。通过该控制器再配以4 个七段数码二极管完成微波炉的定时及信息显示。 微波炉控制器外部接口符号图上图中的各信号的功能及要求如下:CLK 1是时钟脉冲输入。 CLK 2是置数时钟扫描脉冲输入。RES为复位信号。高电平有效,用于芯片的复位功能。TEST 为测试信号。高电平有效,用于测试4个七段数码二极管工作是否正常。able是烹调时间设置控制信号。高电平有效。START 是烹调开始的控制信号。高电平有效。SEGOUT是数码管段选。SELOUT是数码管位选。LIGHT是加热指示灯。该微波炉控制器的具体功能要求如下: 微波炉控制器的总体设计方案:根据该微波炉控制器的功能设计要求,本系统可由以下4个模块组成:状态控制器first;数据输出控制器;烹调计时器jianjishu;其内部组成原理如图2所示。图2 系统原理框图三、详细设计1、功能描述(1) 状态控制器的功能是控制微波炉工作过程中的状态转换,并发出有关控制信息。输入信号为CLK1、CLK2、TEST、START、RES、ABLE ,输出信号为SEGOUT、SELOUT、LIGHT信号。控制器根据输入信号和自身当时所处的状态完成状态的转换和输出相应的控制信号。用于测试的数据“5959”以显示驱动信息数据。light 指示烹饪正在进行之中,并提示计时器进行减计数。(2) 显示译码器VIEW的功能就是负责将各种显示信息的BCD 转换成七段数码管显示的驱动信息编码。需要译码的信息有:数字0-9。2、 设计描述(1)、状态控制器的设计 状态控制器的功能是控制微波炉工作过程中的状态转换,并发出有关控制信息。因此我们可用一个状态机来实现它。控制器的输入、输出端口如图3 所示:图3 KZQ 的输入输出端口图(2)、计数装载器的设计计数模块的输入、输出端口如图4 所示。根据其应完成的逻辑功能,它本质上就是一个三选一数据选择器。本设计采用一个进程来完成。但由于三个被选择的数据只有一个来自输入端口。因此另两个被选择的数据则通过在进程的说明部分定义两个常数来产生。由于用于显示“5959”的常数ALL-8 需分解成4 个8 分别经过四个47 译码器译码后才是真正的显示驱动信息编码。因此该常数应是4 个分段的是4 位BCD 码。故应设为“0101100101011001”。 同理,显示“0000”的常数DONE 可设为“000000000000000”。图4 计数器的输入输出端口图(3)、位选,段选显示译码器的设计 本显示译码器YMQ47 不但要对数字0-9 进行显示译码其译码对照表如表1 所示。译码器的输入、输出端口如图7 所示。表1 YMQ47 的译码对照表显示的数字或字母BCD 编码七段显示驱动编码(g-a)000000111111100010000110200101011011300111001111401001100110501011101101601101111101701110000111810001111111910011101111 段选、位选的端口图3、 源程序(1) 状态控制器的分频源程序 library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity fenpin is port(clk:in std_logic; outclk,screen:out std_logic);end;architecture first of fenpin is signal Q1,Q2:std_logic; begin one:process(clk) variable count1:integer range 0 to 1002; begin Q11000 then Q1=1;count1:=0; elsif clkevent and clk=1 then count1:=count1+1; end if; end process;two:process(clk)variable count2:integer range 0 to 500;begin if clkevent and clk=1 then if count2250 then Q2=1;count2:=count2+1;else Q2499 then count2:=0;end if; end process;outclk=Q1;screen=Q2;end; (2) 控制端口的VHDL 源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity first isport(clk,able,res,test:in std_logic; o1,o2,o3,o4,o5:out std_logic_vector(3 downto 0);end;architecture two of first issignal q1,q2,q3,q4,q5:std_logic_vector(3 downto 0);beginprocess(able)beginif ableevent and able=1 then if q54 then q5=q5+1; else q5=0000; end if;end if;end process; process(clk,res,test,q4)beginif res=0 then q1=0000;q2=0000;q3=0000;q4=0000; -复位键elsif test=0 then q1=1001;q2=0101;q3=1001;q4 if q19 then q1=q1+1;else q1 if q25 then q2=q2+1;else q2 if q39 then q3=q3+1;else q3 if q45 then q4=q4+1;else q4null;end case;end if;end process;o1=q1;o2=q2;o3=q3;o4=q4;o5=q5; -在VIEW模块中选择闪烁位end;(3) 烹调计时器的VHDL 源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jianjishu isport(clks,start,res,test:in std_logic; in1,in2,in3,in4:in std_logic_vector(3 downto 0); light:out std_logic; out1,out2,out3,out4:out std_logic_vector(3 downto 0);end;architecture one of jianjishu issignal q1,q2,q3,q4:std_logic_vector(3 downto 0);beginprocess(start,clks,res,test,q4) variable a:std_logic_vector(1 downto 0); begin if res=0 or test=0 then q1=0000;q2=0000;q3=0000;q4=0000; -对信号都清零设置 elsif q4=(in4-15) or start=0 then a:=00;light=0; -当q4=15或start=0时不进行减计数,同时LED不亮 elsif start=1 then a:=11;lightif clksevent and clks=1 then if (in1-q1)=0 then q1=(in1-9);q2=q2+1;else q1=q1+1;end if; -q1开始为0,当q1=in1时,对q1赋值为(in1-9),为负数,if (in2-q2)=0 and (in1-q1)=0 then q3=q3+1;q2=(in2-9);q1=(in1-9);end if; -当输出out1=0和out2=0时进位减1,同时out1=9,out2=5;if (in3-q3)=0 and (in2-q2)=0 and (in1-q1)=0 then q4=q4+1;q3=(in3-9);q2=(in2-9);q1=(in1-9);end if;if (in4-q4)=0 and (in3-q3)=0 and (in2-q2)=0 and (in1-q1)=0 thenq4=(in4-0);q3=(in3-0);q2=(in2-0);q1null;end case;end if;end process;out1=(in1-q1);out2=(in2-q2);out3=(in3-q3);out4=(in4-q4);end;(4) 显示译码器段选位选的VHDL程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity choice isport(clk:std_logic; f1,f2,f3,f4:in std_logic_vector(3 downto 0); o1:out std_logic_vector(1 downto 0); o2:out std_logic_vector(3 downto 0);end;architecture one of choice issignal q:std_logic_vector(1 downto 0);beginprocess(clk)beginif clkevent and clk=1 then q o2 o2 o2 o2 null;end case;end process;o1=q; -位选信号end;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity view isport(screen:in std_logic; f1:in std_logic_vector(1 downto 0); f2,able:in std_logic_vector(3 downto 0); segout:out std_logic_vector(7 downto 0); selout:out std_logic_vector(2 downto 0);end;architecture one of view issignal seg:std_logic_vector(6 downto 0);signal sel:std_logic_vector(2 downto 0);beginselout=sel;segout(6 downto 0)=seg;sel=000 when f1=0 else 001 when f1=1 else 010 when f1=2 else 011 when f1=3 else 000;segout(7)=1 when f1=2 else 0; -在第三个数码管输出小数点process(f2,able,sel)beginif (able=0001 and sel=000) or (able=0010 and sel=001) or (able=0011 and sel=010) or (able=0100 and sel=011) thenif screen=1 then seg seg seg seg seg seg seg seg seg seg seg seg seg seg seg seg segnull;end case; -有输出end if; -实现闪烁elsecase f2 iswhen 0000 = seg seg seg seg seg seg seg seg seg seg seg seg seg seg seg segnull;end case; -在没选中的位正常输出end if;end process;End;(5) 、分频模块的VHDL程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity fenpin is port(clk:in std_logic; outclk,screen:out std_logic);end;architecture first of fenpin is signal Q1,Q2:std_logic; begin one:process(clk) variable count1:integer range 0 to 1002; begin Q11000 then Q1=1;count1:=0; elsif clkevent and clk=1 then count1:=count1+1; end if; end process;two:process(clk)variable count2:integer range 0 to 500;begin if clkevent and clk=1 then if count2250 then Q2=1;count2:=count2+1;else Q2499 then count2:=0;end if; end process;outclk=Q1;screen=Q2;end; 四、仿真分析1、 时序仿真输入控制端口:计时模块:五、设计中遇到的问题及解决方法本次设计的最大问题是数码管动态扫描。由于实践能力及知识储备等问题,我们在实验中就数码管动态扫描出现了很多分歧,由于不知道该如何动态扫描,我们查阅了很多很多的资料,通过不断的搜集资料,学习相关知识,编写源程序,并最终达到统一。尤其是在分频那一块,由于每个人的思路不一样,出现很多的分频方法,这期间出现了很多的奇思妙想,但由于时间问题,不可能一一验证,最终我们只选取一种简单的分频方法。在实验的过程中,由于VHDL的编程与以前学习的C语言编程方法不一样,很多时候会把VHDL当成C语言的编程方法来编程,出现了很多的问题。最终导
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 健康投稿内容指南
- 官兵心理思想调查分析报告(3篇)
- 转变教育思想大讨论总结报告2026(3篇)
- 安全性评价:夯实安全基础的系统方法与实践
- 2026区区行业市场供需分析及投资评估规划分析研究报告
- 乳胶漆有毒物质对室内空气的影响及健康防护对策
- 2026中国新型锂离子电池研发行业市场现状供需分析及投资评估规划分析研究报告
- 2026生物农业产业发展现状竞争评估投资前景咨询规划分析研究报告
- 2026汽车零部件行业技术攻坚探讨及市场供应链管理创新与投资方向报告
- 2026人工智能行业市场格局与投资前景研究报告
- 【新教材】人教版(2024)九年级上学期物理(13-17章)必背知识清单
- 2026乐山市市中区国有企业第二批社会招聘6人考试模拟试题及答案详解
- 2026年周口市国有污水处理厂社会公开招聘19人笔试模拟试题及答案详解
- 小学一年级数学《分一分》跨学科主题式教学设计
- 镇江润扬交通工程有限责任公司招聘笔试题库2026
- 江苏《城镇供水水表安装及维护技术规程》
- 剖宫产术的护理配合
- 第15讲 开学综合摸底检测试卷及答案-2026年秋三升四小学数学(人教版新教材适配)
- 2026年江苏省事业单位公开招聘考试真题与答案
- 净水厂调试 运营方案
- 2026年初中历史中国近现代史专题讲座
评论
0/150
提交评论