Forum Discussion
Altera_Forum
Honored Contributor
16 years agoIt seems like buttons are just for reading. I put the module definition below. Am I right ? Any other idea ?
In the module, I chose "input ports only" and did not specify any input options. Maybe it comes from my pin assignment, I only added the following assignments in my tcl : set_location_assignment PIN_F1 -to button[0] set_location_assignment PIN_F2 -to button[1] set_location_assignment PIN_A10 -to button[2] set_location_assignment PIN_B10 -to button[3] I let the I/O standard to 2.5V and the current strength to 8mA. May it come from this ? Thanks, Myriam Here is my module : module button_pio ( // inputs: address, clk, in_port, reset_n, // outputs: readdata ) ; output [ 3: 0] readdata; input [ 1: 0] address; input clk; input [ 3: 0] in_port; input reset_n; wire clk_en; wire [ 3: 0] data_in; wire [ 3: 0] read_mux_out; reg [ 3: 0] readdata; assign clk_en = 1; //s1, which is an e_avalon_slave assign read_mux_out = {4 {(address == 0)}} & data_in; always @(posedge clk or negedge reset_n) begin if (reset_n == 0) readdata <= 0; else if (clk_en) readdata <= read_mux_out; end assign data_in = in_port; endmodule