CFAL25664C0-021M-W I2C issue

JFeve

New member
Hello,

I am having an issue with the CFAL256664C0 OLED display. I am using I2C communication. I start by drawing a splash screen with my company's logo. I then clear the screen and then proceed with displaying various data. My intermittent problem occurs with drawing or clearing the splash screen. Occasionally the screen will freeze and communication ceases. I seem to be getting an arbitration error and I don't know why. I took the code for this directly from your sample code. I would appreciate any assistance you can give me.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

CF Kelsey

Administrator
Staff member
Hi,

Thanks for posting. Can you add pictures of your set up and the code where you're seeing the issue?

Here are some things to check:
  • Do you have pull-up resistors on your SDA and SCL lines?
  • Add delays in the function where the crash is happening
 

JFeve

New member
I started with 4.6k resistors and then changed to 2.2k thinking I needed a stronger pullup, but that didn't help.
I have tried adding various delays with no effect on the issue.
I originally tried communicating at 400000bit/s and then lowered it to 100000bit/sec, but that had no effect on the issue.

Here is the function that is running:

void display_logo()
{
unsigned char i, j;

for (i = 0; i < 64; i++)
{
setColAddr(0x00, 0x7F); // Set higher & lower column Address
setRowAddr(i, 0x3f); // Set Row-Address

for (j = 0; j < 128; j++)
{
writeData(Mono_1BPP[i * 128 + j]);
delay_us(500);
}
}
}

Here is the setup code:
void init_lcd(void)
{

delay(500);

CLR_RESET;
delay(500);

SET_RESET;
delay(500);

LCD_POWER_ON;

//*************Begin INIT***************************

writeCommand(0Xfd); //Set Command Lock
writeCommand(0X12); //(12H=Unlock,16H=Lock)

writeCommand(0XAE); //Display OFF(Sleep Mode)

setColAddr(0x00, 0x7f);

setRowAddr(0x00, 0x3f);

writeCommand(0X81); //Set contrast
writeCommand(0x2f);

writeCommand(0XA0); //Set Remap
writeCommand(0XC3);

writeCommand(0Xa1); //Set Display Start Line
writeCommand(0X00);

writeCommand(0Xa2); //Set Display Offset
writeCommand(0X00);

writeCommand(0Xa4); //Normal Display

writeCommand(0Xa8); //Set Multiplex Ratio
writeCommand(0X3f);

writeCommand(0Xab); //Set VDD regulator
writeCommand(0X01); //Regulator Enable

writeCommand(0Xad); //External /Internal IREF Selection
writeCommand(0X8E);

writeCommand(0Xb1); //Set Phase Length
writeCommand(0X22);

writeCommand(0Xb3); //Display clock Divider
writeCommand(0Xa0);

writeCommand(0Xb6); //Set Second precharge Period
writeCommand(0X04);

writeCommand(0Xb9); //Set Linear LUT

writeCommand(0Xbc); //Set pre-charge voltage level
writeCommand(0X10); //0.5*Vcc

writeCommand(0Xbd); //Pre-charge voltage capacitor Selection
writeCommand(0X01);

writeCommand(0Xbe); //Set cOM deselect voltage level
writeCommand(0X07); //0.82*Vcc

clearScreen(); // Clear Screen

delay(250);

writeCommand(0xAF); //Display ON

delay(250);

}

I will grab some scope captures of when the freezing occurs and update in a bit.
 

CF Kelsey

Administrator
Staff member
Are you using an arduino-type microcontroller or something else?

If you're using arduino and the wire library, it sounds like there are some possible issues with ithe wire library that sometimes cause this problem.

We will run a test on this next week to see if we can replicate your problem and provide some guidance.
 

JFeve

New member
I am using the iLLD library for the Infineon Aurix TC397 microcontroller. The code is getting hung up waiting for an acknowledge from the display that it never receives.
 

CF Kelsey

Administrator
Staff member
We have replicated the issue you reported and are looking for a resolution. One work around is that you can bit bang images without waiting for an ack from the display. Hopefully we'll be back to you with a more elegant solution soon.
 

JFeve

New member
We have replicated the issue you reported and are looking for a resolution. One work around is that you can bit bang images without waiting for an ack from the display. Hopefully we'll be back to you with a more elegant solution soon.
Have you made any progress finding a fix for this?
 
Top