usb 发表于 2010-6-26 21:39:29

还有一个办法,将键值输入连续采样4级(移位寄存),当前3级为0最后一级为1时让翻转器翻转,即就是松键时翻转<br>
这样稳定可靠,2句话搞定,楼主可以试试.采样移位寄存越长越 不容易出错.<br>
&nbsp; &nbsp; sampling_reg&lt;=key &amp; sampling_reg(3 downto 0);<br>
&nbsp; &nbsp; if(sampling_reg="0001")then--松键输入'0'<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;led&lt;=not led;<br>
&nbsp; &nbsp; end if;

CHANG 发表于 2010-6-26 22:35:43

我把你们的方法都去试验一下<br>
谢谢各位了

CHA 发表于 2010-6-27 00:32:23

Verilog HDL&nbsp;&nbsp;中有说可以上拉<br>
&nbsp;&nbsp;楼主考虑下?

Sunlife 发表于 2015-6-25 10:45:19

既然是按键,又生成一个锁存器,检测按键没有消抖电路
页: 1 2 [3]
查看完整版本: CPLD的LED的设置IO口输出不行?