You are currently viewing Slide switch and Push Button interfacing with Cyclone3 FPGA Development Kit

Slide switch and Push Button interfacing with Cyclone3 FPGA Development Kit

Spread the love

Slide switch and Push Button interfacing with Cyclone3 FPGA Development Kit

Slide switch 

Slide switches are most common used in electronic circuits for digital input of ON/OFF states. They allow control over current flow in a circuit. You’ll usually find slide switches in SPDT or DPDT configurations. 

Push Buttons 

Push-button switches are the classic momentary switch. Typically these switches have a really nice, tactile feedback when you press them. 

Schematic to interface Slide Switch and Push Button with Cyclone3 FPGA Development Kit

Schematic_to_interface_Slide_Switch_and_Push_Button_with_Spartan3e_FPGA_Development_Kit
Schematic_to_interface_Slide_Switch_and_Push_Button_with_Spartan3e_FPGA_Development_Kit

 Slide Switch and Push Button Placement in Cyclone3 FPGA Development Kit

Slide_Switch_and_Push_Button_Placement_in_Cyclone3_FPGA_Development_Kit
Slide_Switch_and_Push_Button_Placement_in_Cyclone3_FPGA_Development_Kit

Interfacing Slide Switch and Push Button with Cyclone3 FPGA Development Kit

Push Button interface is straight forward. One end of Push Button connected to FPGA and another end connected to ground. Slide switch interface to FPGA is Pulled High by default at open end and another end is connected to ground which act as OFF State.

VHDL Code for Slide Switch Interfacing with Cyclone3 FPGA Development Kit

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL;

 

entity sw_led is

    Port ( sw : in  STD_LOGIC_VECTOR (15 downto 0);

           led : out  STD_LOGIC_VECTOR (15 downto 0));

end sw_led;

 

architecture Behavioral of sw_led is

 

begin

led<=sw;

 

end Behavioral
NET "led[0]" LOC = P36;

NET "led[1]" LOC = P37;

NET "led[2]" LOC = P39;

NET "led[3]" LOC = P40;

NET "led[4]" LOC = P42;

NET "led[5]" LOC = P43;

NET "led[6]" LOC = P44;

NET "led[7]" LOC = P45;

NET "led[8]" LOC = P62;

NET "led[9]" LOC = P63;

NET "led[10]" LOC = P64;

NET "led[11]" LOC = P65;

NET "led[12]" LOC = P67;

NET "led[13]" LOC = P68;

NET "led[14]" LOC = P71;

NET "led[15]" LOC = P72;

NET "sw[0]" LOC = P46;

NET "sw[1]" LOC = P48;

NET "sw[2]" LOC = P50;

NET "sw[3]" LOC = P51;

NET "sw[4]" LOC = P52;

NET "sw[5]" LOC = P57;

NET "sw[6]" LOC = P58;

NET "sw[7]" LOC = P61;

NET "sw[8]" LOC = P74;

NET "sw[9]" LOC = P76;

NET "sw[10]" LOC = P77;

NET "sw[11]" LOC = P78;

NET "sw[12]" LOC = P79;

NET "sw[13]" LOC = P80;

NET "sw[14]" LOC = P81;

NET "sw[15]" LOC = P85;

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.