Pin | Name | Function | |
1 | GND | Ground - wire GND to it | |
2 | VDD | 5V - Powers the LCD, wire the 5V red VDD to it | |
3 | Vo | 1V - Contrast, The LCD needs exactly 1V on this pin so characters are visible | |
4 | RS | High: When RS is high the LCD expects
data to come over the data pins Low: When RS is low the LCD expects one of the hard-encoded commands to come over the data pins | |
5 | R/W | High: When R/W is high the LCD can be
read from Low: When R/W is low the LCD can be written to | |
6 | E | This is the Enable, it executes command/data is passed to the LCD on the negative edge of E | |
7 | DB0 | Data Bus 0, this is one bit of data | |
8 | DB1 | Data Bus 1, this is one bit of data | |
9 | DB2 | Data Bus 2, this is one bit of data | |
10 | DB3 | Data Bus 3, this is one bit of data | |
11 | DB4 | Data Bus 4, this is one bit of data | |
12 | DB5 | Data Bus 5, this is one bit of data | |
13 | DB6 | Data Bus 6, this is one bit of data | |
14 | DB7 | Data Bus 7, this data bit also acts as an output for the LCD. When R/W is high and RS is low, the LCD will output a high signal if the LCD is busy and low signal if the LCD is not busy. |
|
|
Order | Operation | RS | DB[7:0] |
1 | Clear Display | 0 | 0000 0001 |
2 | Function Set | 0 | 0011 0011 |
3 | Display On | 0 | 0000 1100 |
4 | Entry Mode Set | 0 | 0000 0110 |
5+ | Write Character | 1 | ???? ???? |
module case_state_example (CLK, Next, Reset, Fib_Out);
input CLK, Next, Reset; output reg [4:0] Fib_Out; reg [2:0] state; intial state=0; always @(posedge CLK) begin if (Reset) state = 0; else case (state) 0: if (Next) state = 1; 1: if (Next) state = 2; 2: if (Next) state = 3; 3: if (Next) state = 4; 4: if (Next) state = 5; 5: if (Next) state = 6; 6: if (Next) state = 7; 7: if (Next) state = 0; endcase end always @(state) begin case (state) 0: Fib_Out = 1; 1: Fib_Out = 1; 2: Fib_Out = 2; 3: Fib_Out = 3; 4: Fib_Out = 5; 5: Fib_Out = 8; 6: Fib_Out = 13; 7: Fib_Out = 21; endcase end endmodule |
module tri_state_example (Select, Data, DataBus);
input Select; input [7:0] Data; output [7:0] DataBus; assign DataBus = (Select) ? Data : 8'zzzzzzzz; endmodule |