GLCD (128x64) With i2c module in Arduino Mega

Hello, i have a Graphic LCD (128x64) with a i2c attached to it and i want to use it with my Arduino Mega, but i'm not able to make it work.

LCD: https://www.ebay.com/itm/194916956338?hash=item2d61f4b8b2:g:XCsAAOSwEV5fsjvd

i2c Module: IIC/I2C/TWI/SPI Serial Interface Board Module Port for Arduino 1602LCD | eBay

Connections:

Module Arduino
GND-----------------GND
VCC------------------5V
SDA------------------SDA
SCL-------------------SCL

Im using this example: LCD I2C Arduino UNO pantalla 128x64 display - HeTPro-Tutoriales

But only show random characters at random places.

Can you maybe show a photo of your results?

Your GLCD looks like a KS0108 style of controller. e.g. pins 15, 16 are marked CS1, CS2

The HJ12864ZW display used in your tutorial is a ST7920 style. e.g. with pin 15 marked PSB and pin16 NC.

If you want to run a KS0108 with an I2C adapter you need a 20-pin adapter like https://www.ebay.com/itm/234025473747
or
https://www.ebay.co.uk/itm/323301629851

Quite honestly, I would buy a ST7920 GLCD in the first place. And run as SPI (PSB pin = 0V).
ST7920 displays are fairly cheap. And there is absolutely NO point in running ST7920 with a 4-bit Parallel Adapter like your tutorial.

Your KS0108 will work fine as 8-bit parallel (its only native mode)
But it uses lots of GPIO pins.

David.

Thanks for the answers. I'm not currently at home but I will upload some photos when I arrive.

I think I also have an ST7920 sitting somwhere in my house (I have to look for it). But let me check if I understand fine: There is no way of using the KS0108 (or the ST7920) with the i2c adapter that I have.

ST7920 can use 8-bit parallel, 4-bit parallel, SPI.
KS0108 can only use 8-bit parallel
HD44780 (typical 16x2 LCD) can use 8-bit parallel, 4-bit parallel

The typical PCF8574 I2C backpack used with 16x2 LCD modules bit-bangs 4-bit parallel. e.g. 4 data pins + 3 control pins + backlight pin.

The MCP23017 I2C backpack (in my links) can drive up to 16 bit-bashed pins. e.g. 8 data pins + 6 control pins + backlight pin

There is no way of using the KS0108 with the i2c adapter that you have.

You can use the ST7920 with the i2c adapter that you have.
It is fairly pointless since you can use ST7920 as an SPI device. i.e. not many pins.
Yes, you save pins with I2C backpack at the expense of ST7920 execution speed.

David.

I see, thanks for the explanation.
And if I want to use the I2C backpack with the ST7920 is there any library or easy to understand example?

Sorry for being so annoying.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.