I've recently bought this LCD:
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!