九江学院
课 程 设 计
课 程 EDA技术课程设计
题 目 洗衣机控制器
院 系 电子信息学院
专业班级 电子信息工程技术
学生姓名 张翁生
学生学号 37
指导教师 高玉宝
一、设计要求与原理
设计一个洗衣机控制器,要求洗衣机有正转、反转、暂停三种状态。设定洗衣机的工作时间,要洗衣机在工作时间内完成:定时启动undefined正转20秒undefined暂停10秒undefined反转20秒undefined暂停10秒undefined定时未到回到“正转20秒undefined暂停10秒undefined……”,定时到则停止,同时发出提示音。
基本要求:
1、设计一个电子定时器,控制洗衣机作如下运转:定时启动undefined正转20秒undefined暂停10秒undefined反转20秒undefined暂停10秒undefined定时未到回到“正转20秒undefined暂停10秒undefined……”,定时到则停止;
2、若定时到,则停机发出音响信号;
3、用两个数码管显示洗涤的预置时间(分钟数),按倒计时方式对洗涤过程作计时显示,直到时间到停机;洗涤过程由“开始”信号开始;
4、三只LED灯表示“正转”、“反转”、“暂停”三个状态。
二、洗衣机的工作过程
首先用电路控制三只LED显示洗衣机正转、反转、暂停三种状态。然后用电子定时器控制洗衣机设定的工作时间,以及正传和反转运行时间的控制。同时用两个数码管显示洗涤的预置时间(按分钟计数),按倒计时方式对洗涤过程作计时显示,直到时间到停机;洗涤过程由“开始”信号开始;最后定时到则停止,同时用蜂鸣器发出提示音。通过各种开关组成控制电路,使洗衣机实现程序运转。 直至结束为止。
三、各模块图
洗衣机控制电路由定时输入模块,电机输出模块,电机时间控制模块,数字显示电路,倒计时模块以及报警器模块组成。
图一
四、各模块的VHDL代码与仿真结果
1、输入定时模块,
此模块是为了实现希望让洗衣机工作多少个分钟,有两个数码管显示工作时间,所以可以不同要求输入要洗衣的时间,可以输入1~59分钟不等时间,人性化控制,与实际的洗衣机工作是一样的。程序如下:
library IEEE;
四级作文真题范文
u IEEE.STD_LOGIC_1164.ALL;
u IEEE.STD_LOGIC_ARITH.ALL;
u IEEE.STD_LOGIC_UNSIGNED.ALL;
entity shuru is
Port ( shu : in std_logic;
hshu: in std_logic;
din : in std_logic;
dout:out std_logic_vector(3 downto 0);
dout1:out std_logic_vector(3 downto 0));
end shuru;
architecture Behavioral of shuru is
signal count: std_logic_vector(3 downto 0);
signal count1: std_logic_vector(3 downto 0);
begin
process(shu,hshu,din)
begin
dout<=count;
dout1<=count1;
if din='0' then
dout<="1111";dout1<="1111";
elsif rising_edge(shu) then
if count="1001" then
count<="0000";
el
count<=count+1;
end if;
end if;
三角梅的诗句
if rising_edge(hshu) then
if count1="0110" then
count1<="0000";
el
count1<=count1+1;
end if;
end if;
end process;
end Behavioral;
仿真波形如下
2、产生1HZ频率的信号
此程序是将学校试验箱上提供的48MHZ的信号分频成1HZ频率的信号,这样可以一秒进行计数,程序很简单,如下:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
entity fp48M is
port(clk_48MHZ: in std_logic;
clk_1HZ: out std_logic大功率手电筒
);
姚明资产end fp48M;
architecture behav of fp48M is
signal clk_1HZ_r: std_logic;
signal count : std_logic_vector(24 downto 0);
begin
process (clk_48MHZ)
begin
if clk_48MHZ'event and clk_48MHZ='1' then
if count="1011011100011010111111111"then
count<=(others=>'0');
clk_1HZ_r<=not clk_1HZ_r;
el count<=count+1;
同学新年祝福语 clk_1HZ<=clk_1HZ_r;
end if;
end if;
end process;
end behav;
3、提供定时脉冲模块
此模块提供1分钟产生一个高电平和5秒产生一个高电平,这两个脉冲为后面的循环和控制60秒减一分钟有很多的作用,起到后面的链接作用,同时可以根据自己来设置各状态工作时间,这可以和后面的循环控制一起来控制,程序如:
library IEEE;圆的面积题
u IEEE.STD_LOGIC_1164.ALL;
u IEEE.STD_LOGIC_ARITH.ALL;
u IEEE.STD_LOGIC_UNSIGNED.ALL;
entity washmachine is
Port ( clk : in std_logic;
我的世界如何骑马
c :out std_logic;
d :out std_logic);
end washmachine;
architecture miao20 of washmachine is
signal count: std_logic_vector(2 downto 0);
signal shi: integer range 0 to 60;
begin
process(clk)
begin
if rising_edge(clk) then
if shi=60 then
shi<=0;c<='1';
el shi<=shi+1;c<='0';
end if;
if count="100" then
count<="000";
d<='1';
el
count<=count+1;
d<='0';
end if;
end if;
end process;
end miao20;
仿真波形如下:
4、循环控制模块
此模块是为了实现能够控制洗衣机正转、反转、暂停的功能,同时也可以和前一模块一起控制各个状态的工作时间。
library IEEE;
u IEEE.STD_LOGIC_1164.ALL;
u IEEE.STD_LOGIC_ARITH.ALL;
u IEEE.STD_LOGIC_UNSIGNED.ALL;
entity dianji is
望海潮注音 Port (
cc :in std_logic;
deng : out std_logic_vector(2 downto 0));
end dianji;
architecture di of dianji is