完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
嗨,大家好,
我使用斯巴达3E入门套件来设计特定的作品, 并且iam使用板上的滑动开关(SW0)来启用顺序电路(FSM),我遇到了开关弹跳问题, 任何人都可以给我一个用于开关去抖动的VHDL代码吗? 我没有从ISE语言模板中的代码中受益,因为它提供一次性脉冲,但我的要求是开关保持高达ON,并保持低至OFF。 请帮忙吗? 以上来自于谷歌翻译 以下为原文
|
|
相关推荐
2个回答
|
|
啊真正的硬件的乐趣啊。
我见过的一个不错的依据是 http://www.ganssle.com/debouncing.pdf 电路方面,你有时钟吗? 你可以制作分频器,并不频繁地将开关采样到移位寄存器中。 然后注册,如果你得到所有'1'然后去一个,如果所有'0'变为零,否则保持相同 以上来自于谷歌翻译 以下为原文 Ah the fun of real hardware. A nice referance I have seen is http://www.ganssle.com/debouncing.pdf Circuit wise, do you have a clock ? can you make a divider, and sample the switch infrequently into a shift register. Then have register that, if you get all '1' then go one, if all '0' go zero, else stay same |
|
|
|
实体Dbouncing是
通用 ( NO_OF_BITS:自然:= 4 ); 港口 ( 时钟:在Std_Logic; reset:在Std_Logic中; D_IN:在Std_Logic中; D_OUT:Out Std_Logic; Q_OUT:Out Std_Logic ); 结束Dbouncing; 建筑行为Dbouncing是 信号Q:Std_Logic:='0'; 信号D:Std_Logic:='0'; 常数ALL_1:Std_Logic_Vector((NO_OF_BITS-1)downto 0):=(其他=>'1'); 常数ALL_0:Std_Logic_Vector((NO_OF_BITS-1)downto 0):=(其他=>'0'); SIGNAL S:Std_Logic_Vector((NO_OF_BITS-1)downto 0):=(其他=>'0'); 开始 D'0'); 问:我正在提供一个基本模型。 现在您可以根据您的要求进行更改。 山塔努 Shantanu Sarkarhttp://www.linkedin.com/pub/shantanu-sarkar/0/33a/335 以上来自于谷歌翻译 以下为原文 entity Dbouncing isGeneric(NO_OF_BITS : Natural := 4);Port(clock : In Std_Logic;reset : In Std_Logic;D_IN : In Std_Logic;D_OUT : Out Std_Logic;Q_OUT : Out Std_Logic);end Dbouncing;architecture Behavioral of Dbouncing isSignal Q : Std_Logic := '0';Signal D : Std_Logic := '0';Constant ALL_1 : Std_Logic_Vector((NO_OF_BITS-1) downto 0) := (others => '1');Constant ALL_0 : Std_Logic_Vector((NO_OF_BITS-1) downto 0) := (others => '0');SIGNAL S : Std_Logic_Vector((NO_OF_BITS-1) downto 0) := (others => '0');beginD <= D_In;process(clock, reset, D)beginif (reset = '1') thenS <= (others => '0');Q <= '0';elseif (Rising_Edge(clock)) then------------------------------------S(0) <= D;for n in 1 to (NO_OF_BITS-1) loopS(n) <= S(n-1);end loop;------------------------------------If(S = ALL_0) thenQ <= '0';ElsIf (S = ALL_1) thenQ <= '1';ElseQ <= Q;End If;------------------------------------end if;end if;end process;Q_OUT <= Q;D_OUT <= D;end Behavioral; I am providing a basic model. Now you can change it according to your requirement. Shantanu Shantanu Sarkar http://www.linkedin.com/pub/shantanu-sarkar/0/33a/335 |
|
|
|
只有小组成员才能发言,加入小组>>
2500 浏览 7 评论
2871 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2330 浏览 9 评论
3424 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2512 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
2453浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
660浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
521浏览 1评论
801浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-2-24 18:47 , Processed in 1.201545 second(s), Total 79, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191