I'm working on a new design however imported some known working design from a previous project - this is the connector and circuitry for an SSD1309z based OLED. I'm also using the same code as the working example.
My issues are:
1. The display does nothing.
2. I have no VCOM.
3. I see no voltage on the IREF pin (should be around 10V).
I have:
- Tripled check the wiring. I have done this on paper and by physically measuring the signals on pins.
- Made use the FFC connector is working. I scratched off some of the soldermask on the FFC and can get continuity and the signals on the FFC.
- Verified the PSUs, all good.
- Verified the data on the SPI, reset and DC lines is all correct with correct timing, values and connections.
My code is below and schematic attached. The pins are inverted in order but this is just due to the way the display is mounted, they are correct on the PCB.
This is the controller:
https://www.hpinfotech.ro/SSD1309.pdfand this is the display:
https://www.tme.eu/en/details/dep128064s-w/graphical-oled-displays/display-elektronik/dep-128064s-w/Has anyone come across any issues like this before?
Thanks
void ssd_init()
{
// Turn the screen PSU on
ssd_pwr_cont(true);
// Wait for it to settle
ssd_delay_ms(250);
// Reset the screen
ssd_reset();
// Space for the commands
uint8_t cmd[2] = {0};
// Turn the display off
cmd[0] = SSD_CMD_SET_OFF;
ssd_write_cmd(cmd, 1);
// Set the clock
cmd[0] = SSD_CMD_CLK_DIV;
cmd[1] = 0xA0;
ssd_write_cmd(cmd, 2);
// Set multiplexer ratio
cmd[0] = SSD_CMD_MULT_RATIO;
cmd[1] = 0x40;
// ssd_write_cmd(cmd, 2);
// Set start line
cmd[0] = SSD_CMD_START_LINE | 0x00;
ssd_write_cmd(cmd, 1);
// Set page addressing mode
cmd[0] = SSD_CMD_MEM_ADDR_MD;
cmd[1] = 0x00;
ssd_write_cmd(cmd, 2);
// Set segment mapping
cmd[0] = SSD_CMD_SEG_REMAP + 1;
ssd_write_cmd(cmd, 1);
// Set the column mapping
cmd[0] = SSD_CMD_COM_DIR + 8;
ssd_write_cmd(cmd, 1);
// Set the com pins
cmd[0] = SSD_CMD_COM_PIN_HW;
cmd[1] = 0x12;
ssd_write_cmd(cmd, 2);
// Set the contrast
cmd[0] = SSD_CMD_SET_CONTRAST;
cmd[1] = 0xFF;
ssd_write_cmd(cmd, 2);
// Set the pre charge period
cmd[0] = SSD_CMD_PRE_PER;
cmd[1] = 0xD3;
ssd_write_cmd(cmd, 2);
// Set the pre charge period
cmd[0] = SSD_CMD_COMH_DESEL;
cmd[1] = 0x20;
ssd_write_cmd(cmd, 2);
// Set multiplexer ratio
cmd[0] = SSD_CMD_STOP_SCROLL;
ssd_write_cmd(cmd, 1);
// Set the entire display on
cmd[0] = SSD_CMD_DISP_ON;
ssd_write_cmd(cmd, 1);
// Normal display output, no inversions
cmd[0] = SSD_CMD_INVERT;
ssd_write_cmd(cmd, 1);
// Set multiplexer ratio
cmd[0] = SSD_CMD_STOP_SCROLL;
ssd_write_cmd(cmd, 1);
// Set the entire display on
cmd[0] = SSD_CMD_DISP_ON;
ssd_write_cmd(cmd, 1);
}
There are several SPI set-up options. How is your SPI set up? Eg. Data on rising clock/falling clock, MSB/LSB first etc. You have ensured that your SPI setup matches the requirement of the display?
Thanks for the reply but unfortunately, this is all good. It's MSB first and SPI mode 0 which I've verified on the logic analyser. The bus is running at 5MHz which is half the upper limit of the driver.