Forum Discussion
Altera_Forum
Honored Contributor
13 years agoAltera DE2-115 buttons
Hello everyone,
I'm working on a project for a University course and I have to use the Altera DE2-115 board we have in the lab. I tried to program it with a simple circuit doing left-right shift of the leds, when I realized that the buttons, when not pushed, they're sending a "1". I have some experience with Xilinx boards and I thought that by default they may be "pulled-up", so "pulling them down" it would be a good idea. The research I've done on the Internet and in the manuals confused me bit, so I'd like to ask: is it possible to drive the signals from the buttons to zero, or I have to modify my VHDL code? Thank you in advance, Tom2 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- I'm working on a project for a University course and I have to use the Altera DE2-115 board we have in the lab. I tried to program it with a simple circuit doing left-right shift of the leds, when I realized that the buttons, when not pushed, they're sending a "1". I have some experience with Xilinx boards and I thought that by default they may be "pulled-up", so "pulling them down" it would be a good idea. The research I've done on the Internet and in the manuals confused me bit, so I'd like to ask: is it possible to drive the signals from the buttons to zero, or I have to modify my VHDL code? --- Quote End --- You should start by looking at the schematic for the board. You'll find that the push-buttons have a pull-up and when pressed generate a logic low. Basically they are active low signals. If you have a VHDL component that expects button inputs that are active high signals, then you just need inversion logic, eg.,
Make sure to include logic that de-bounces the buttons. Cheers, Daveport ( ... button : in std_logic_vector(3 downto 0); ... ); ... signal button_in : std_logic_vector(3 downto 0); ... button_in <= not button; u1: component_that_uses_active_high_buttons port map ( ... button <= button_in, .... ); - Altera_Forum
Honored Contributor
Thank you very much Dave, it works. I have already included the button de-bouncing logic :)
Cheers, Tom