Making ST7302 working

I've recently bought this LCD:

https://it.aliexpress.com/item/1005003654720684.html?spm=a2g0o.order_list.order_list_main.17.3b1f3696Ozo8sl&gatewayAdapt=glo2ita

It's 2.13 based on LCD ST7302 Drive IC with a resolution of 122*250 .

I'm using NANO ESP32 that works at 3v3.

Connection were made in this way:

#define _PIN_RST_ 6
#define _PIN_DC_ 5
#define _PIN_CS_ 10
#define _PIN_SCK_ 13
#define _PIN_MOSI_ 11
#define _PIN_MISO_ 12 // unconnected

On the display board there's: GND,VCC,SCL,SDA,RES,DC,CS

As advised on "ST7302-for-arduino" library: GitHub - zhcong/ST7302-for-arduino: LCD screen ST7302 for arduino
This pins are connected to SPI , seems SCL and SDA names of I2C but as stated from datasheet it works with SPI.

Actually I've checked:

  • Connections, all goes from stated pins to relative display boards pins
  • Active communication, I've checked by oscilloscope SCL SDA RES DC and CS pins, all working (toggling). SCL sends some clk and SDA some data.

This is example code from library modified with ESP32 NANO pinout:

#include <ST7302SPI.h>

#define _PIN_RST_ 6 //RES giallo
#define _PIN_DC_ 5 // Orange
#define _PIN_CS_ 10 // gray
#define _PIN_SCK_ 13 //scl marrone
#define _PIN_MOSI_ 11 //sda blue
#define _PIN_MISO_ 12

uint8_t font[]={0x06, 0x00, 0x00, 0x18, 0x07, 0x80, 0x00, 0x3c, 0x03, 0x87, 0xff, 0xfe, 0x03, 0xc0, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x21, 0x80, 0x70, 0x00, 0x71, 0xff, 0xf8, 0x7f, 0xf9, 0xc0, 0x78, 0x00, 0xf9, 0xc0, 0x70, 0x00, 0xf1, 0xc0, 0x70, 0x01, 0xe1, 0xc0, 0x70, 0x01, 0xe1, 0xc0, 0x70, 0x03, 0xc1, 0xff, 0xf0, 0x03, 0x81, 0xc0, 0x70, 0x07, 0xc0, 0x00, 0x10, 0x0f, 0xe6, 0x00, 0x38, 0x0f, 0xf7, 0xff, 0xfe, 0x1f, 0xbf, 0x0e, 0x3c, 0x37, 0xbf, 0x0e, 0x3c, 0x47, 0x87, 0x0e, 0x3c, 0x07, 0x87, 0x0e, 0x3c, 0x07, 0x87, 0xff, 0xfc, 0x07, 0x87, 0x0e, 0x3c, 0x07, 0x87, 0x0e, 0x3c, 0x07, 0x87, 0x0e, 0x3c, 0x07, 0x87, 0x0e, 0x3c, 0x07, 0x87, 0x0e, 0x3c, 0x07, 0x87, 0xff, 0xfc, 0x07, 0x87, 0x00, 0x3c, 0x07, 0x07, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

ST7302SPI st7302spi(_PIN_SCK_, _PIN_MISO_, _PIN_MOSI_, _PIN_RST_, _PIN_DC_, _PIN_CS_, 250, 122);

void setup() {
  st7302spi.begin();
  // inversion screen
  st7302spi.inversion_on();
  //draw point
  st7302spi.point(10,10,1);
  // draw ascii
  char str1[] = "hello world.";
  st7302spi. text(1, 20, str1, strlen(str1));

  st7302spi.set_memory(0, 40, 32, 32, font, 128);

  st7302spi.flush_buffer();
}

void loop() {
}

Can't find out why is not working.

  • Maybe wasn't this library tested with this module or isn't working with newer Arduino's boards?
  • Is my display board faulty?
  • Am I missing something?

Unfortunately I didn't found another library for this driver/display. Mostly are for raspberry or Espruino.

Hoping in your help!

Try checking your LCD panel connection. Disconnect it and then Connect the LCD display to the Arduino again:

  • Connect the VCC pin of the LCD display to the 3.3V pin on the Arduino.

  • Connect the GND pin of the LCD display to the GND pin on the Arduino.

  • Connect the SDA pin of the LCD display to the SDA (A4) pin on the Arduino.

  • Connect the SCL pin of the LCD display to the SCL (A5) pin on the Arduino.

  • If your LCD display has a backlight, connect the positive (+) pin of the backlight to a 3.3-Volt pin on the Arduino and the negative (-) pin to a Grounding pin on the Arduino.

Hi @1noahb1 ,

are you sure with the 5V? The specification at AliExpress says 3.3V ...

image

Maybe that's wrong ... ?!?

Oh, my bad. I'm used to working with 5V displays that I didn't check the specs. I've edited the original reply to suit 3.3V.

I am not sure whether it applies to this display or not.

There seems to be a similar display ffrom Waveshare

https://www.amazon.de/Waveshare-Resolution-Electronic-Controller-Raspberry/dp/B07J3FHJVP/

that (is told) to have onboard voltage regulators so that it can work with 3.3V or 5V respectively...

I would just use 3.3V to be sure not to fry it...

Hi @Singed1 ,

maybe you have a look a the Waveshare documentation as it looks similiar to your display (make sure it is ... before applying anything written there :wink: ):

https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT_Manual#Parameters

However this part about the "Operating voltage" does not make really sense:

image

It works with 3.3 or 5V but requires 5V for power supply and signals?? So what are the 3.3V good for?

Sigh ....

Jeez, what were the manufacturers thinking...
Maybe just use 5V??? I have no idea...

1 Like

Unfortunately description of the seller is a mess.

Actually this is an LCD without light and not an epaper as stated by the seller. Should work at 3v3 as specifics of ST7302.

Can't find any useful info about it or a proven working code.

Your code works fine if the connections were made in the right way. I used an esp32 feather v2 and the same display ... There is another library (OneBitDisplay). When I used that library I was not able to initialize the display.

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