Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21600 Discussions

Altera DE2-115 buttons

Altera_Forum
Honored Contributor II
2,473 Views

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, 

Tom
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
1,475 Views

 

--- 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., 

 

port ( ... 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, .... );  

 

Make sure to include logic that de-bounces the buttons. 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
1,475 Views

Thank you very much Dave, it works. I have already included the button de-bouncing logic :) 

 

Cheers, 

Tom
0 Kudos
Reply