Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional functionality: I2C converter for displays with parallel bus (T6963, LC7981, SBN1661, SED1520) #2191

Closed
xygax opened this issue Jun 3, 2023 · 27 comments
Assignees
Milestone

Comments

@xygax
Copy link

xygax commented Jun 3, 2023

A lot of the GFX displays have an 8 bit bus and 3/4 control lines. It would be useful if with a small amount of logic the port definition could contain I2C for T6963 for instance and then you can use these older LCD's in the same way as the newer OLEDs utilizing the same library

So an idea for the interface is in the attached V1.02 is the current circuit

GFXSCHEMATIC_V1.02_ PAGE1.pdf
hub.com/olikraus/u8g2/files/11641668/SCHEMATIC1._.PAGE1.pdf)

@olikraus
Copy link
Owner

olikraus commented Jun 3, 2023

Nice idea :-)

VCC = 5V, correct? What is VBL?

@olikraus olikraus changed the title Additional functionality Additional functionality: I2C converter for displays with parallel bus Jun 3, 2023
@olikraus
Copy link
Owner

olikraus commented Jun 3, 2023

One general point: I do not think, that there will be a generic constructor for this solution, instead I think this could be implemented via the C low level interface functions.

@xygax
Copy link
Author

xygax commented Jun 3, 2023

VBL is a separate backlight supply otherwise 5V

@olikraus
Copy link
Owner

olikraus commented Jun 24, 2023

https://raw.githubusercontent.com/wiki/olikraus/u8g2/img/i2c_to_parallel_lcd_board_1024.png

PCF8574A 0x3E Control

Bit Signal
0 C/D
1 R/W
2 E
3 E2
4 /CS
5 /RD
6 /RESET
7 LED Control

PCF8574A 0x3F Data

Bit Signal
0-7 DB0-DB7

Purpose of this issue is to add support for the above board.

Testing could be done with the T6969 board, which should fit into J4:
https://github.com/olikraus/u8g2/wiki/gallery#16-jul-2016-t6963-240x128-lcd

Other displays from my lab might require an adapter:

https://github.com/olikraus/u8g2/wiki/gallery#31-dec-2016-lc7981-160x80

https://github.com/olikraus/u8g2/wiki/gallery#11-aug-2017-sed1520-122x32-lcd

olikraus added a commit that referenced this issue Jun 25, 2023
olikraus added a commit that referenced this issue Jun 25, 2023
@olikraus
Copy link
Owner

The setup for the I2C GFX board differs from standard setup:

U8G2 u8g2;              // create a plain U8g2 object
void setup(void) {
  u8g2_Setup_t6963_240x128_1(u8g2.getU8g2(), U8G2_R0, u8x8_byte_i2c_lcd_board, u8x8_gpio_and_delay_i2c_lcd_board);
  u8g2.begin();  
}

The setup requires the C API for the displays from here: https://github.com/olikraus/u8g2/wiki/u8g2setupc

Additionally two special callback function are required, they are listed here:

uint8_t u8x8_gpio_and_delay_i2c_lcd_board(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, U8X8_UNUSED void *arg_ptr)

and
uint8_t u8x8_byte_i2c_lcd_board(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)

@olikraus olikraus added this to the 2.35 milestone Jun 25, 2023
@olikraus olikraus changed the title Additional functionality: I2C converter for displays with parallel bus Additional functionality: I2C converter for displays with parallel bus (T6963, LC7981, SBN1661, SED1520) Jun 25, 2023
olikraus added a commit that referenced this issue Jul 3, 2023
@olikraus
Copy link
Owner

olikraus commented Jul 6, 2023

ToDo:

  • SED1520 Example
  • SED1520 Test Board
  • T6963 128x128 constructor / setup procedure

olikraus added a commit that referenced this issue Jul 9, 2023
@olikraus
Copy link
Owner

olikraus commented Jul 9, 2023

The setup procedure is: u8g2_Setup_t6963_128x128_1
Not yet tested...

@xygax : Code is in repo only at the moment. Let me know, whether you need a beta release.

@xygax
Copy link
Author

xygax commented Jul 9, 2023 via email

@olikraus
Copy link
Owner

olikraus commented Jul 9, 2023

I have a sed1520 here, but it has a different pinout. No problem to get it connected, but I need some more time.

olikraus added a commit that referenced this issue Jul 16, 2023
@olikraus
Copy link
Owner

PXL_20230716_095442455~2

Added support for the SED1520. In the above picture, backlight is not enabled and also the protection foil is still attached to the display, so the contrast is little bit poor.

Support is described in I2CLCDBoard.ino example.

// u8g2_Setup_t6963_240x128_2(u8g2.getU8g2(), U8G2_R0, u8x8_byte_i2c_lcd_gfx_board_t6963_8080, u8x8_gpio_and_delay_i2c_lcd_gfx_board);
u8g2_Setup_sed1520_122x32_2(u8g2.getU8g2(), U8G2_R0, u8x8_byte_i2c_lcd_gfx_board_sed1520_6800, u8x8_gpio_and_delay_i2c_lcd_gfx_board);

@olikraus
Copy link
Owner

ToDo:

  • Support for ST7920: Adapter required, new byte procedure required
  • Support for KS0108: Adapter required, new byte procedure required
  • u8g2_Setup_t6963_128x128_2 doesn't compile, why? Code required
  • u8g2_Setup_lc7981_240x128_2 compiles, but doesn't work. Problem here is, that I don't know whether the LC7981 driver works.

@olikraus olikraus self-assigned this Jul 23, 2023
@olikraus
Copy link
Owner

The T6963 128x128 works as expected.
The ST7920 is now added to the example code https://github.com/olikraus/u8g2/blob/master/sys/arduino/u8g2_page_buffer/I2CLCDBoard/I2CLCDBoard.ino

See also images below.

The ST7920 display must be connected to J3.
Backlight needs to be added additionally. The 10 Ohm Resistor will limited the current, otherwise the Uno may not start up as expected (so it might be required to use another power source for the ST7920 backlight).

Pin ST7920 J3 Note
1 GND VSS (GND)
2 VCC VCC
3 V0 V0
4 RS C/D
5 R/W R/W 0: write mode
6 E E
7 DB0 DB0
8 DB1
9 DB2
10 DB3
11 DB4
12 DB5
13 DB6
14 DB7 DB7
15 PSB CS PSB=1 --> parallel bus mode
16 NC /Reset
17 RST VBL
18 VOUT LED
19 BL A
20 BL K

https://raw.githubusercontent.com/wiki/olikraus/u8g2/img/st7920_128x64_i2c_back.jpg

https://raw.githubusercontent.com/wiki/olikraus/u8g2/img/st7920_128x64_i2c_front.jpg

Due to light conditions, this white on blue display appears as blue on blue.

olikraus added a commit that referenced this issue Aug 14, 2023
@olikraus
Copy link
Owner

olikraus commented Aug 28, 2023

Here is another display: LC7981240x128 with the following pinout:

Pin ST7920 J3 Note
1 GND VSS (GND)
2 VCC VCC
3 V0 V0
4 RS C/D
5 R/W R/W 0: write mode
6 E E
7 DB0 DB0
8 DB1
9 DB2
10 DB3
11 DB4
12 DB5
13 DB6
14 DB7 DB7
15 /CS CS
16 /RST Reset
17 LED+ VBL
18 LED- LED

This display can be added to J3 of the I2C GFX converter.

@olikraus
Copy link
Owner

Support has been added to u8g2 for this LC7981 240x128 display, however the power consumption is huge and also the Arduino Uno might be too slow.
For the pictures below the backlight LED is disabled and the I2C GFX board is modified to generate a more negative contrast voltage (1K replaced by 820 ohm)

https://raw.githubusercontent.com/wiki/olikraus/u8g2/img/lc7981_240x128_front.jpg

https://raw.githubusercontent.com/wiki/olikraus/u8g2/img/lc7981_240x128_back.jpg

olikraus added a commit that referenced this issue Aug 28, 2023
@olikraus
Copy link
Owner

@olikraus
Copy link
Owner

olikraus commented Nov 8, 2023

@xygax
Copy link
Author

xygax commented Mar 2, 2024

Oli..
Did the KS0108 get added to the I2C module i have a 192 x 64 first 16 pins are identical to JP3 there is a couple of extra CS lines and a switched positive for the back light so the CS 2,3 are connected to 0V and the backlight to the positive supply atm

192x64 pinout

@olikraus
Copy link
Owner

olikraus commented Mar 3, 2024 via email

@olikraus
Copy link
Owner

olikraus commented Mar 3, 2024

Adding support for the 192x64 KS0108 should be doable, but precondition would be a way to control CS2 and CS3

@xygax
Copy link
Author

xygax commented Mar 3, 2024 via email

@olikraus
Copy link
Owner

olikraus commented Mar 3, 2024

ok, so for the KS0108, the mapping would be:

Control Signal List for I2C Port Expander @0x3e:
Bit 0: C/D
Bit 1: R/W
Bit 2: E
Bit 3: E2
Bit 4: /CS
Bit 5: /RD
Bit 6: /Reset
Bit 7: LED

Expander KS0108
Bit 0: C/D KS0108 RS
Bit 1: R/W KS0108 R/W
Bit 2: E KS0108 E
Bit 3: E2 KS0108 CS2
Bit 4: /CS KS0108 CS1
Bit 5: /RD KS0108 CS3
Bit 6: /Reset KS0108 /Reset
Bit 7: LED

?

@xygax
Copy link
Author

xygax commented Mar 3, 2024 via email

@xygax
Copy link
Author

xygax commented Mar 3, 2024 via email

olikraus added a commit that referenced this issue Mar 13, 2024
@olikraus
Copy link
Owner

I have updated the example .ino for the KS0108: https://github.com/olikraus/u8g2/blob/master/sys/arduino/u8g2_page_buffer/I2CLCDBoard/I2CLCDBoard.ino

You can just use that file or get the latest lib from here:

You can download the latest U8g2 beta release from here: https://github.com/olikraus/U8g2_Arduino/archive/master.zip
Arduino IDE:

  1. Remove the existing U8g2_Arduino library (https://stackoverflow.com/questions/16752806/how-do-i-remove-a-library-from-the-arduino-environment)
  2. Install the U8g2_Arduino Zip file via Arduino IDE, add zip library menu (https://www.arduino.cc/en/Guide/Libraries).

PlatformIO:
platformio.ini (https://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-deps) should include

lib_deps =
  u8g2=https://github.com/olikraus/U8g2_Arduino/archive/master.zip

@xygax
Copy link
Author

xygax commented Mar 15, 2024

KS0108 (LCM19264A-1) hardware connection added J7 on V1.01 of the adaptor
image

@xygax
Copy link
Author

xygax commented Mar 15, 2024

V1.01 i2c converter module ( manufacturing screenshot). The best mounting method is to fit the connector to the rear of the adaptor board and it then sits behind the dispaly where its not seen
image

@olikraus
Copy link
Owner

I will close this ticket to finish the current milestone. Feel free to add new comments here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants