Hi, We are trying to figure out a way to send some display characters to the LCD and cannot find the I2C address in the manual. Could someone tell us how to find it? Thanks!
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.
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