CPLD Debounce CoolRunner 2, HELP désespérément besoin

B

bigurf

Guest
HI
J'ai un CoolRunner 2 pension développement.La division de l'horloge a été facile, j'ai maintenant l'horloge 90Hz, mais les boutons darn juste ne sera pas sans rebond.J'ai le code VHDL pour éviter les rebonds un FPGA MAX, et le code a un sens, 4 Registre décalage de bits.Il compile mais juste ne marchera pas.J'ai besoin d'une aide pour éviter les rebonds mes boutons en VHDL pour ce CPLD.Si quelqu'un pourrait s'il vous plaît me dire comment faire

Merci.

 
Hope this helps
Code:IEEE bibliothèque;

IEEE.STD_LOGIC_1164.all UTILISATION;

IEEE.STD_LOGIC_ARITH.all UTILISATION;

IEEE.STD_LOGIC_UNSIGNED.all UTILISATION;- Debounce Bouton: Filtres à rebondir interrupteur mécanique pour environ 40ms.

debounce ENTITY est

PB PORT (, clock_100Hz: IN STD_LOGIC;

pb_debounced: OUT STD_LOGIC);

FIN debounce;ARCHITECTURE DE debounce IS

SIGNAL SHIFT_PB: STD_LOGIC_VECTOR (3 DOWNTO 0);

BEGIN- Horloge Debounce devrait être d'environ 10 ms ou 100 Hz

PROCESSUS

BEGIN

WAIT UNTIL (clock_100Hz'EVENT) ET (clock_100Hz = '1 ');

- Utiliser un registre à décalage pour filtrer rebond contact de commutation

SHIFT_PB (2 DOWNTO 0) <SHIFT_PB = (3 DOWNTO 1);

SHIFT_PB (3) <= PAS PB;

SI SHIFT_PB (3 DOWNTO 0) = "0000" THEN

<PB_DEBOUNCED = '0 ';

ELSE

<PB_DEBOUNCED = '1 ';

END IF;

Terminer le processus;

Mettre fin à une;

 

Welcome to EDABoard.com

Sponsor

Back
Top