Hi everyone!
I'm a first-time poster and a total newbie when it comes to Arduino programming, so I really appreciate any help or advice you can offer.
I'm working on a project using an ESP32-C3 DevKit connected to a ROHM BU97950AFUV Low Duty LCD Segment Driver to control a custom-designed LCD segment display. I’ve managed to turn all the segments ON and OFF using the All Pixel Control (APCTL) command, but I’m stuck trying to light up individual segments.
Here’s a quick overview of what I’ve tried:
What’s Working:
- I2C communication works.
- I can toggle all pixels using
lcd_all_pixels_on()andlcd_all_pixels_off().
What’s Not Working:
- Sending custom segment data via DDRAM (
renderSegments()function) doesn’t light up any specific segments. - I suspect I’m either not writing to the DDRAM correctly or not issuing the correct address/command sequence.
Hardware:
- ESP32-C3 DevKit
- BU97950AFUV LCD Segment Driver
- Custom LCD with SEG/COM mapping (verified)
Datasheet:
BU97950AFUV PDF – ROHM Semiconductor
Code Summary
Here's what I’m doing in setup():
void initLCD() {
Wire.begin(SDA_PIN, SCL_PIN);
lcd_set_display_off();
lcd_set_display_mode(0x00);
lcd_set_display_control(0x02);
lcd_set_contrast(0x00);
lcd_set_display_on();
}
And here’s the renderSegments() function:
void renderSegments() {
Serial.println("Trying to render segments...");
Wire.beginTransmission(LCD_SLAVE_ADDRESS);
Wire.write(CMD_ICSET | 0x05); // Display ON
Wire.write(CMD_DISCTL | 0x02); // Duty: 1/4
Wire.write(CMD_EVRSET | 0x00); // Contrast
Wire.write(0x00); // Set DDRAM address (SEG0)
for (int i = 0; i < 35; i++) {
Wire.write(0x55); // Just trying a test pattern
}
Wire.endTransmission();
}
Command Definitions
uint8_t CMD_ADSET = 0x00;
uint8_t CMD_EVRSET = 0xC0;
uint8_t CMD_DISCTL = 0xE0;
uint8_t CMD_ICSET = 0xF0;
uint8_t CMD_APCTL = 0xF8;
uint8_t CMD_MODESET = 0xFC;
Questions:
- Am I correctly setting the DDRAM address and sending segment data?
- Is there a particular sequence or timing needed before writing to DDRAM?
I’ve been banging my head against this for days now, so any pointers—whether it's a code fix, a working example, or something I might have missed in the datasheet—would be massively appreciated ![]()
Thanks in advance!