URL
https://opencores.org/ocsvn/lcd_block/lcd_block/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 8 |
Rev 9 |
Line 10... |
Line 10... |
output lcd_e,
|
output lcd_e,
|
output [3:0] lcd_nibble,
|
output [3:0] lcd_nibble,
|
output lcd_rs,
|
output lcd_rs,
|
output lcd_rw,
|
output lcd_rw,
|
output disable_flash,
|
output disable_flash,
|
output done
|
output reg done
|
);
|
);
|
|
|
// States for FSM that initialize the LCD
|
// States for FSM that initialize the LCD
|
localparam lcd_init_rst = 1;
|
localparam lcd_init_rst = 1;
|
localparam lcd_init_wait = 2;
|
localparam lcd_init_wait = 2;
|
Line 48... |
Line 48... |
reg [19:0] counter_wait_lcd_data;
|
reg [19:0] counter_wait_lcd_data;
|
reg [8:0] counter_wait_strobe_lcd_data, counter_wait_stabilize_lcd_data;
|
reg [8:0] counter_wait_strobe_lcd_data, counter_wait_stabilize_lcd_data;
|
reg [3:0] lcd_data_states, lcd_data_state_next; // Declare two variables of 4 bits to hold the FSM states
|
reg [3:0] lcd_data_states, lcd_data_state_next; // Declare two variables of 4 bits to hold the FSM states
|
reg [3:0] lcd_data_data_out; // FSM output LCD_DATA
|
reg [3:0] lcd_data_data_out; // FSM output LCD_DATA
|
reg lcd_data_e_out; // FSM output LCD_E
|
reg lcd_data_e_out; // FSM output LCD_E
|
reg done;
|
|
|
|
|
|
/*
|
/*
|
Initialize LCD...
|
Initialize LCD...
|
*/
|
*/
|
always @ (posedge clk)
|
always @ (posedge clk)
|
Line 183... |
Line 181... |
assign lcd_rw = 0;
|
assign lcd_rw = 0;
|
|
|
// Will assign the output of the FSM init or the FSM data depending if initialization is already done
|
// Will assign the output of the FSM init or the FSM data depending if initialization is already done
|
assign lcd_e = (!lcd_init_done) ? lcd_init_e_out : lcd_data_e_out;
|
assign lcd_e = (!lcd_init_done) ? lcd_init_e_out : lcd_data_e_out;
|
assign lcd_nibble = (!lcd_init_done) ? lcd_init_data_out : lcd_data_data_out ;
|
assign lcd_nibble = (!lcd_init_done) ? lcd_init_data_out : lcd_data_data_out ;
|
|
assign lcd_rs = rs_in;
|
|
|
/*
|
/*
|
FSM that deals to send data to the LCD (nibble High + nibble Low)
|
FSM that deals to send data to the LCD (nibble High + nibble Low)
|
*/
|
*/
|
always @ (posedge clk)
|
always @ (posedge clk)
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.