I2C 1602 LCD display for WC8

SET RAM20 0x80 # address first line, first byte
CALLSUB LCD_CMD
SET RAM20 0x30 # data byte ascii code for 0
CALLSUB LCD_DATA


This first line is to set the address where to write.  0x80 is a command to tell LCD that this is address. The address for the first row is 0, for second row is 0x40, then position in each row is from 0 to F.  Say you want to write to the 2nd row of last byte, you can use address 0x80 OR 0x40 OR 0xF = 0xCF
 
If you position the cursor to a location already, you can write few bytes, the cursor will automatically advance to next byte location till the end of line.  To clear the line, just write over 16 spaces ASCII code.
 
If you want to clear all display everywhere, send a command 0x01 using LCD_CMD will clear everything on LCD.
 
If you are using a 4x20 LCD display, then address maybe different(check with LCD vendor). Other commands are the same.
 
Hi, I have tried the code but can not see any "0" in the lcd diplay.
I'm running V03.02.18d4.  have checked the pins and they are correct terminated on the 8 pins on the board.
My display has the16x2 layout. According to different displays the I2C adress can be 0x20~0x27.
Can this be a problem?
 
Hi Lars,
 
Did you paste the code from post 13?
Did you changed the I2C board default I2C address by soldering any thing to it?
The I2C address in the code from post 13  assumes no solder on A0, A1, and A2.
Also, there is no other I2C devices on the I2C bus.
 
After running the code, does LCD change anything at all?
 
Yes code is from post 13.
No, I have not soldered anything to it.
The I2C card has no soldering points for A0, A1 or A2.
No other devices is connected.
The board is labeled:
QC1602A
V2.0
After running the code the LCD doesn't change anything.
 
BTW, I have a new LCD card on order that has the soldering points. I will try that one asap as I get it...
 
So the I2C LCD you tested with is not the item listed in post #1?
If they use same I2C chip, it probably will still work, but you need to make sure its I2C address is same.
 
Do you see LCD after power on lighting up one row?  That is the indication LCD being self initialized. 
If you can provide the schematics of the I2C board being used, we could help you find out I2C address.
 
The board is one a friend had for an ardouino project. Since it's not 100% similar to the one in post #1 I have ordered a new one some weeks ago. (China)
The board is not lightning up one row. So, I guess it's an adress problem.
Anyhow, I will get the new one soon? so I will just wait until I get my own card.
 
Did you connect the power GND and Vcc?  Those are NOT on the 8 pin header
Does not matter I2C address, even not connecting SCL and SDA pins, LCD should power on, self initialized with one row lighting up.  Otherwise, it is defective.
 
Yes I only have the  SCL and SDA pins active. No powerup. It may be defective, Anyhow I will get a new one quite soon.
 
The LCD must be powered up by 5V power, it will not do anything if not powering up.   You can use external 5V power supply, please make sure ground is connected to WC8 ground.  The I2C adapter board is also powered from 5V Vcc.
 
LCD panel should light up with one row in display highlighted after powering up.  Then commands will change that to two line display from PLC code.
 
If LCD did not light up and display one line highlighted, that is a defective LCD.  Some I2C adapter has a jumper for disconnecting LCD backlight power. If your board has such a jumper, make sure the jumper is on.
 
Hi, just got the new board. Now the display shows "0" in row 1 first digit.
Cursor is blinking in digit 2.
So, a new board fixed the problem!
 
Back
Top