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

基于FPGA的红外线型学习遥控器(2)

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

4设计成果展示

硬件完整电路图片以及操作视频

(视频在文件夹里)

5总结

通过本次设计一个实用的万能遥控器,我们对课题设计的完整流程有了深入的认识,包括项目的选择、资料的收集、元件购买、PCB板的绘制投板、模块程序设计以及报账流程等,最主要的是因为我们的设计程序在网上的相关资料很少,所以我们是自己根据要实现的功能尝试着自己写程序,自己调试,受益匪浅,不仅很好地巩固和理解了课堂理论知识,更为以后做项目参加比赛等积累了很好的经验。同时,4人小组的合作也很成功,经过这次设计懂得了团队协作和正确分工的重要性!

6

6元件清单

名称 贴片电阻 贴片电容 S9013三极管 IR5308C-C-45 HL-A838 排针1*3

数量 150 100 20 20 20 30 单价/元 0.15 0.24 1.85 1.85 3.7 1.85 总计/元 22.5 24 37 37 74 55.5 250 附录

去抖动程序 LIBRARY ieee;

USE ieee.std_logic_1164.all; USE ieee.std_logic_unsigned.all; ENTITY hw_qd IS

PORT(clk : IN STD_LOGIC ; kin : IN STD_LOGIC ; kout : OUT STD_LOGIC); END ENTITY;

7

ARCHITECTURE behav OF hw_qd IS SIGNAL kh,kl:std_logic_vector(3 downto 0); BEGIN

PROCESS(kin, clk) BEGIN

if rising_edge(clk) then if (kin='0') then kl<=kl+1; else kl<=\if; end if; END PROCESS ; PROCESS(kin, clk) BEGIN

if rising_edge(clk) then if (kin='1') then kh<=kh+1; else kh<=\if; end if; END PROCESS ; PROCESS(clk,kh,kl) BEGIN

if rising_edge(clk) then if (kh>\then kout<='1'; elsif (kl>\then kout<='0'; end if; end if; END PROCESS ; END behav;

红外接收程序

library ieee;

use ieee.std_logic_1164.all; entity hw_InfraredPort is port(CLK:in std_logic;--50MHz RST:in std_logic; IRIN:in std_logic; RD:in std_logic; CS:in std_logic; led:out std_logic;

DATA:out std_logic_vector(31 downto 0)); end entity hw_InfraredPort;

architecture one of hw_InfraredPort is type state is(s0,s1,s2,s3,s4); signal sta:state;

signal vData:std_logic_vector(31 downto 0); signal clk_1m:std_logic; --1MHz begin

8

process(CLK)

variable clk_counter:integer range 0 to 25; begin

if(CLK'event and CLK='1')then clk_counter:=clk_counter+1; if(clk_counter=25)then clk_counter:=0; clk_1m<=not clk_1m; end if; end if; end process; process(RST,CLK)

variable step:integer range 0 to 32; variable counter:integer range 0 to 10000; begin

if(RST='0')then sta<=s0;

vData<=X\led<='0';

elsif(clk_1m'event and clk_1m='1')then case sta is when s0=>led<='0'; counter:=0; if(IRIN='0')then sta<=s1; end if;

when s1=>led<='0'; if(IRIN='0')then counter:=counter+1;

elsif(counter>3200)then --time(9ms) > 3.2ms sta<=s2; counter:=0; else sta<=s0; end if;

when s2=>led<='0'; if(IRIN='1')then counter:=counter+1;

if(counter>8000)then --time(4.5ms) > 8ms,back to begin sta<=s0; end if;

elsif(counter<8000)then --time(4.5ms) < 8ms,continue

9

sta<=s3; counter:=0; step:=0; else sta<=s0; end if;

when s3=>led<='1'; if(IRIN='0')then counter:=counter+1;

elsif(counter<1600)then --time(0.56ms)<1.6ms,continue sta<=s4; counter:=0; else sta<=s0; end if;

when s4=>led<='1'; if(IRIN='1')then counter:=counter+1;

if(counter>3200)then --time(1.12ms)>3.2ms,back to begin sta<=s0; DATA<=vData; end if; else

if(counter>800)then --time>0.8ms,get the data 1 vData(step)<='1'; else

vData(step)<='0'; --time<0.8ms,get the data 0 end if; step:=step+1; sta<=s3; counter:=0; end if; end case; end if; end process;

end architecture one; 存储写入程序:

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity hw_address is port(clk:in std_logic;

10

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库基于FPGA的红外线型学习遥控器(2)在线全文阅读。

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