Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSD1363 module display error #2298

Open
JamesHahaho opened this issue Nov 18, 2023 · 10 comments
Open

SSD1363 module display error #2298

JamesHahaho opened this issue Nov 18, 2023 · 10 comments

Comments

@JamesHahaho
Copy link

Hello Olikraus,

I tried an SSD1363 module (i2cinterfaced, 256x128). The panel always shows the random pattern.
e98649d600bf8d49ee6e7b6daa2d674

Based on SSD1362 codes, what I have changed in the codes are as follow:

  1. The base init sequence:
    U8X8_CA(0xfd, 0x12), /* unlock /
    //U8X8_C(0xAE), /
    display off */

U8X8_CAA(0xA0, 0x20, 0x00),
U8X8_CA(0xA2, 0x80),
U8X8_CA(0xC1, 0xFF),
U8X8_CA(0xCA, 0x7F),
U8X8_CA(0xAD, 0x90),
U8X8_CA(0xB3, 0x61),

  1. Normal display mode command: from 0xA4 to 0xA6 (according to the datasheet)
    SSD1363.pdf

  2. add the write RAM command in the function u8x8_d_ssd1362_common() before write data.
    u8x8_cad_SendCmd(u8x8, 0x05C);

It seems that the control command could work properly, but the data could not write into the display RAM.

Could you kindly help on the issue?
Thanks!

James

@JamesHahaho
Copy link
Author

I find the significant difference between SSD1362 and SSD1363 .... all the commands are changed...
SSD1363:
image
SSD1362:
image
I will change the codes accordingly.

@olikraus
Copy link
Owner

I think the issue is the missing 0x05c command, which you pointed out in 3.

u8g2/csrc/u8x8_d_ssd1362.c

Lines 190 to 193 in fc31269

u8x8_cad_SendCmd(u8x8, 0x015 ); /* set column address */
u8x8_cad_SendArg(u8x8, x ); /* start */
u8x8_cad_SendArg(u8x8, x+3 ); /* end */
u8x8_cad_SendData(u8x8, 32, u8x8_ssd1362_8to32(u8x8, ptr));

Depending on which constructor your have used, we probably need to send the byte 0x05c as a command byte prior to line 193.
I mean we need to call u8x8_cad_SendCmd(u8x8, 0x05c ); between lines 192 and 193.

@olikraus
Copy link
Owner

Moreover the SSD1363 seems to use a different configuration for the DC flag. It must be high during argument sending, but must be low for SSD1362:

"ssd1362", 32, 8, "u8g2_ll_hvline_vertical_top_lsb", "u8x8_cad_001", "", COM_4WSPI|COM_3WSPI|COM_6800|COM_8080,

The "cad_001" is the specification in u8g2 for this, it means for the SSD1362:
[C]ommand: DC=0
[A]rg: DC = 0
[D]ata: DC = 1

However for the SSD1363 it sould be (according to your datasheet):
[C]ommand: DC=0
[A]rg: DC = 1
[D]ata: DC = 1

All in all the SSD1363 seems to be more similar to the SSD1322, which uses the same CAD layout and also reqires the 0x5c command for data write:

"ssd1322", 30, 16, "u8g2_ll_hvline_vertical_top_lsb", "u8x8_cad_011", "", COM_4WSPI|COM_3WSPI|COM_6800|COM_8080,

I suggest to use an SSD1322 constructor for your display. It is worth a try.

@JamesHahaho
Copy link
Author

Dear Olikraus,
After somedays debug, I have solved the issue.

e2cf21812906d861654cacc9dd706ca

Here are the notes on the main changes:

  1. to meet the requirement of D/C, I copied your U8X_CA series macro as U8X8_CD, and use them in init sequence
  2. still use the u8x8_cad_ssd13xx_fast_i2c() as the CAD, but made changes to function u8x8_d_ssd1363_256x128_common() of case U8X8_MSG_DISPLAY_DRAW_TILE
  3. adjust the 8to32 to match the data sequence to display RAM

the .c/.h file are attached here:
ssd1363.zip

I‘m not very familiar to the structure of U8G2, so the codes are not in u8g2 style... just for your reference.

Thanks for your hints. I'll try to rewrite the codes as your suggestions.
James

@olikraus
Copy link
Owner

Thanks for the code. I will look into that once I have some time for it. I still wonder whether the ssd1322 will work...

@JamesHahaho
Copy link
Author

I tried u8x8_cad_011 .
Due to the origin u8x8_cad_011 dose not contain the code linked to i2c, I constructed a new function u8x8_cad_H011() :

uint8_t u8x8_cad_H011(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{ 
  switch(msg)
  {
    case U8X8_MSG_CAD_SEND_CMD:
    printf("c");
      u8x8_byte_SetDC(u8x8, 0);
      u8x8_byte_SendByte(u8x8, arg_int);
      break;
    case U8X8_MSG_CAD_SEND_ARG:
    printf("a");
      u8x8_byte_SetDC(u8x8, 1);
      u8x8_byte_SendByte(u8x8, arg_int);
      break;
    case U8X8_MSG_CAD_SEND_DATA:
    printf("d");
      u8x8_byte_SetDC(u8x8, 1);
      u8x8_byte_SendBytes(u8x8, arg_int, arg_ptr);
      break;
      /* fall through */
    case U8X8_MSG_CAD_INIT:        /*added codes here*/
          if ( u8x8->i2c_address == 255 )
	      u8x8->i2c_address = 0x078;
        break;
    case U8X8_MSG_CAD_START_TRANSFER:
    case U8X8_MSG_CAD_END_TRANSFER:
      return u8x8->byte_cb(u8x8, msg, arg_int, arg_ptr);
    default:
      return 0;
  }
  return 1;
}

The data transmit on i2c bus looks like :
1
It does not work.

Compare to the worked codes, the transmitted data look like:
2

It seems the command+arg series could not be transmitted in one i2c package.

The logic_analyzer data is attached for your reference. You can use DSView to view them.
logic_analizer_data.zip

@olikraus
Copy link
Owner

The cad_001 / cad011 are indeed only for SPI interface. Maybe i was confused here, but the u8x8_cad_ssd13xx_fast_i2c() should be correct for I2C.

@neuralmax
Copy link

Can you please post the logic_analyzer data for write to RAM sequence? I has been weeks and I still cannot get it to work.

@JamesHahaho
Copy link
Author

la_data.zip
Here I re-attached the logic analyzer data for accessing SDD1363 with I2C.
You may use DSLogic software (https://dreamsourcelab.cn/download/) to open it.

@neuralmax
Copy link

Thank you so much. I managed to run it at last. For now just using the Wire library and sending the codes I copied from your logic analysis files. Although it works its seems very slow, despite that I run I2C at 1HMz clock speed and managed to send whole line in one communication burst I get only about 2 fps and frame tearing. Is it slow like this for you also? Link to video of result I got: https://youtu.be/XztWQ6t6XSM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants