hello everyone,
firstly I apologize for any mistakes in the text, english isn't my 1st language
I have to use a MC21605C6W-SPTLYI-V2 LCD with native I2C interface for a school project
However, despite all my tries it doesn't show any text at all on the LCD. I've been using chatpgt so far (i know, i know....) to try and debug my problems, but it has been unsuccessful so far.
I am using a XIAO ESP32-C6 and the screen is powered externally with a generator. My schematic:
Every pin that needs voltage has 5V except the SCL and SDA pins that get 3.3V due to them coming out of the ESP32.
According to the MC21605C6W-SPTLYI-V2 datasheet (that you can find here), I would need pull-up resistors on SCL and SDA that I haven't put on, which would be frankly annoying since I would need to fabricate another PCB, and I don't really have the time to (project deadline is on the 10th of june)
I've tested if the LCD is connected using an I2C address scanner and i've found that it is connected at the 0x3D address.
I've tried using Adafruit_liquidcrystal library, the U8g2 library, the hd44780 library and the Wire library.
Here is my current code
#include <Wire.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h>
hd44780_I2Cexp lcd;
void setup() {
Serial.begin(115200);
delay(500);
// Initialise wire with the right GPIOs for the ESP
Wire.begin(D4, D5); // SDA = GPIO6 (D4), SCL = GPIO7 (D5)
Serial.println("Scan I2C en cours...");
Wire.beginTransmission(0x3D);
if (Wire.endTransmission() == 0) {
Serial.println("LCD détecté à l'adresse 0x3D"); // lcd detected at the 0x3D address
} else {
Serial.println("Aucun LCD détecté à 0x3D !");// No LCD detected at the 0x3D address
while (1);
}
// Initialize the display
int status = lcd.begin(16, 2);
if (status) {
Serial.print("Erreur d'init LCD : code "); // if any error occurs, sends the error code
Serial.println(status);
while (1);
}
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Hello XIAO C6!");
lcd.setCursor(0, 1);
lcd.print("I2C @ 0x3D");
}
void loop() {
// empty
}
Thanks in advance for any help, don't hesitate to ask me for more details if needed.