Forum Discussion
Altera_Forum
Honored Contributor
12 years agohi this is an interfacing between lcd and a keypad. am i doing it right? then this will be done in nios II
this is the code generated using qsys plus a code for keypad from tear086 //======================================================= // This code is generated by Terasic System Builder //======================================================= module testingx( //////////// CLOCK ////////// CLOCK_50, CLOCK2_50, CLOCK3_50, //////////// LED ////////// LEDG, LEDR, //////////// KEY ////////// KEY, //////////// EX_IO ////////// EX_IO, //////////// SW ////////// SW, //////////// LCD ////////// LCD_BLON, LCD_DATA, LCD_EN, LCD_ON, LCD_RS, LCD_RW, //////////// GPIO, GPIO connect to GPIO Default ////////// GPIO ); //======================================================= // PARAMETER declarations //======================================================= //======================================================= // PORT declarations //======================================================= //////////// CLOCK ////////// input CLOCK_50; input CLOCK2_50; input CLOCK3_50; //////////// LED ////////// output [8:0] LEDG; output [17:0] LEDR; //////////// KEY ////////// input [3:0] KEY; //////////// EX_IO ////////// inout [6:0] EX_IO; //////////// SW ////////// input [17:0] SW; //////////// LCD ////////// output LCD_BLON; inout [7:0] LCD_DATA; output LCD_EN; output LCD_ON; output LCD_RS; output LCD_RW; //////////// GPIO, GPIO connect to GPIO Default ////////// inout [35:0] GPIO; //======================================================= // REG/WIRE declarations //======================================================= wire keyboard_val; matrixKeyboard_drive ( .i_clk(CLOCK_50), .i_rst_n(1), .row(GPIO[3:0]), // ???? ? .col(GPIO[7:4]), // ???? ? .keyboard_val(keyboard_val) // ??? ); //======================================================= // Structural coding //======================================================= assign LCD_BLON = 1'b1; assign LCD_ON = 1'b1; testingX ( .pio_led_external_connection_export(LEDG), // pio_led_external_connection.export .pio_sw_external_connection_export(SW), // pio_sw_external_connection.export .lcd_0_external_data(LCD_DATA), // lcd_0_external.data .lcd_0_external_E(LCD_EN), // .E .lcd_0_external_RS(LCD_RS), // .RS .lcd_0_external_RW(LCD_RW), // .RW .reset_reset_n(1), // reset.reset_n // pio_in_gpio_external_connection.export .clk_clk(CLOCK_50), // clk.clk .pio_out_gpio_solenoid_external_connection_export(GPIO[15:13]), // pio_out_gpio_solenoid_external_connection.export .pio_out_gpio_buzzer_external_connection_export(GPIO[18:16]) // pio_out_gpio_buzzer_external_connection.export endmodule