Forum Discussion
Aria 10 LCD I2C address
- 4 years ago
Hi Yong Chi,
From my findings,
The LCD char display is NHD-0216K3Z-NSW-BBW-V3
Link to the datasheet:
https://www.newhavendisplay.com/specs/NHD-0216K3Z-NSW-BBW-V3.pdf
The slave address is 0x50 by default. It can be changed to different address with CMD 0x62, refer page 7 from the datasheet.
Thanks.
Regards,
Aik Eu
HI Yong Chi,
I think you are getting a display on (0x41) working is a good thing.
You havent set the cursor properly yet because you used 0x4A instead of 0x46 for Cursor home.
Try Set cursor(0x45) or Cursor home(0x46) first. Then Underline cursor on (0x47) to observe any cursor there.
If there is a cursor, you can play with the move cursor left(0x49) or right(0x4A)
If I understand correctly, once there is a cursor, you should able to display Characters after that.
Refer to the Table of Commands in the datasheet. Tryout different commands to see which one is responding and which one is not.
Make your coding short and simple based on which line which works accordingly in sequence.
From there, we can know better on how the LCD char display operates.
Thanks.
Regards,
Aik Eu
Hi,
So we are going off of this sending sequence:
start -> address -> r/w -> ack -> display on -> ack -> clear screen -> ack -> cursor home -> ack -> H -> ack -> and so on...-> ack
-> stop
but our lcd is still not responding. It seems like it's communicating to the address but nothing is displayed.
here is the code:
module HelloWorld (
input wire clk, // Controller clock
input wire rstn, // Controller active low reset
inout wire sda_pin_io, // I2C SDA Pin
output scl_pin_o // I2C SCL Pin
);
reg [7:0] address_n_data_i; // address to write into
wire [7:0] rd_data_o; //wont need if uncommented above
wire [2:0] req_status_o; //wont need if uncommented above
wire io_sda_w;
assign sda_pin_io = io_sda_w;
reg [15:0] count;
wire command_i;
reg strb_i;
reg rst_ni;
reg [7:0] words [0:52];
initial begin
words[0] = 8'hFE; //
words[1] = 8'h41; // display on, needs 100uS
words[2] = 8'hFE; //
words[3] = 8'h51; // clear screen, needs 1.5ms
words[4] = 8'hFE;
words[5] = 8'h46; // set cursor to home, needs 1.5ms
words[6] = 8'h48; // H takes 3ms
words[7] = 8'h65; // e
words[8] = 8'h6c; // l
words[9] = 8'h6c; // l
words[10] = 8'h6f; // o
words[11] = 8'h20; // space
words[12] = 8'h57; // W
words[13] = 8'h6f; // o
words[14] = 8'h72; // r
words[15] = 8'h6c; // l
words[16] = 8'h64; // d
words[17] = 8'h21; // !
words[18] = 8'h20; // space
end
i2c_master lcd(
.address_n_data_i(address_n_data_i), // Address and Data
.command_i(command_i), // Command indicate read/write)
.strb_i(strb_i), // Qualifier which will Latch inputs
.clk_i(clk), // Controller clock
.rst_ni(rst_ni), // Controller active low reset
.sda_pin_io(io_sda_w), // I2C SDA Pin*
.scl_pin_o(scl_pin_o), // I2C SCL Pin
.rd_data_o(rd_data_o), // Output data on reads
.req_status_o(req_status_o)
);
parameter [17:0] max_count = 177; //15+(18*9)
always @(negedge clk)
begin
if(rstn ==0)
begin
count <= 0;
rst_ni <= 0;
end
else
begin
count <= (count == max_count)? max_count : count +1;
rst_ni <= 1;
end
end
assign command_i = 0;
always@(*)
begin
if (count == 0 || count == max_count) strb_i = 0;
if (count == 4) begin address_n_data_i = 8'h28; strb_i = 1; end
if (count > 14 && (count%9 == 6))
//case(count%9)
address_n_data_i = words[(count/9) -1];//8'b1011_1000; // function set
//endcase
end
endmodule
Could you point out what we are doing wrong? I've also attached the i2c_master.v we are using along with the top.v and the clk_divder.v...
wave forms onTB seem okay, but nothing is displayed when .sof is run on the aria x board
Thanks,
Yong