Altera_Forum
Honored Contributor
10 years agoGPIO output on DE2_115
I have a DE2-115 board and i'm trying to do some basic functions.
I want provide a high/low input using a switch on the board,and read this high/low input as output onto a GPIO pin. i.e. whenever I 'ON' the switch, '1' is supposed to appear at the GPIO pin,and whenever the switch is 'off' the GPIO should provide '0'. This is the corresponding verilog code: module dswitch(SW,CLOCK_50,GPIO); input [17:0]SW; input CLOCK_50; output reg[35:0]GPIO; always @(posedge CLOCK_50) begin GPIO[31:1]= 32'hz; if(SW[0]==1) GPIO[0]=1'b1; else GPIO[0]=1'b0; end endmodule all the pins are assigned correctly using the pin editor. The code compiles fine. But,when i try to read the output from the GPIO[0] pin, on the board, onto a scope,there is no change in activity when the switch is pushed on or off. I am unable to figure out what is wrong. Am I missing something?Is there any thing else that needs to be done or any other connections to be given? Also,what would be a good ground on the fpga board that could be used to connect the ground pin of the scope to? Thanks!