UTFT and serial display ITDB02-2.2SP InitLcd with random pixel

Hi all, I'm using the last version of UTFT library for Arduino. I have wired the serial display ITDB02-2.2SP that use the controller HX8340B_S. The library work very fine but a little problem in InitLcd module. When I call InitLcd module the display go in power on and it shown random pixel. It is possible to pre initialize the display memory to black pixel? So the display would start all black.

best regard
Marco

I had the same problem with the 3.2" with controller SSD1289. I solved it by finding some code to turn on and off the display, then doing this:

myGLCD.InitLCD();
myGLCD.lcdOff();
myGLCD.clrScr();
delay(1);
myGLCD.lcdOn();

I know it will probably not help you much...but try to find the turn on/off code for your controller.. :slight_smile:

Here is the code that I used:

void UTFT::lcdOff()
{
	cbi(P_CS, B_CS);
	switch (display_model)
	{
		case PCF8833:
			LCD_Write_COM(0x28);
			break;
		case SSD1289:
			//turn OFF
			LCD_Write_COM_DATA(0x07,0x0000);
			LCD_Write_COM_DATA(0x00,0x0000);
			LCD_Write_COM_DATA(0x10,0x0001);
		
			//only standby mode ON : no visible difference (?)
			//LCD_Write_COM_DATA(0x10,0x0001);
			break;
	}
	sbi(P_CS, B_CS);
}

void UTFT::lcdOn()
{
	cbi(P_CS, B_CS);
	switch (display_model)
	{
		case PCF8833:
			LCD_Write_COM(0x29);
			break;
		case SSD1289:
			//turn ON
			LCD_Write_COM_DATA(0x07,0x0021);
			LCD_Write_COM_DATA(0x00,0x0001);
			LCD_Write_COM_DATA(0x07,0x0023);
			LCD_Write_COM_DATA(0x10,0x0000);
			delay(30); 
			LCD_Write_COM_DATA(0x07,0x0033);
			LCD_Write_COM_DATA(0x11,0x60B0);
			LCD_Write_COM_DATA(0x02,0x0600);
			LCD_Write_COM(0x22);
		
			//only standby mode OFF : no visible difference (?)
			//LCD_Write_COM_DATA(0x10,0x0000);
			break;
	}
	sbi(P_CS, B_CS);
}

Hi, thanks for you reply... I have found that to put lcd in off/on I must send the command 0x28 0x29

so in my sketch..

myGLCD.InitLCD();
myGLCD.lcdOff();
myGLCD.clrScr();
delay(1);
myGLCD.lcdOn();

In the library...

void UTFT::lcdOff()
{
	cbi(P_CS, B_CS);
	switch (display_model)
	{
        case HX8340B_S:
	case PCF8833:
		LCD_Write_COM(0x28);
		break;
	}
	sbi(P_CS, B_CS);
}

void UTFT::lcdOn()
{
	cbi(P_CS, B_CS);
	switch (display_model)
	{
        case HX8340B_S:
	case PCF8833:
		LCD_Write_COM(0x29);
		break;
	}
	sbi(P_CS, B_CS);
}

all works fine but now when LCD start the back light is on ( so the display appears all white) also if LCD is in off state, I can control the back light?

best regards
Marco

Sorry I should have said that..I also have this "problem", to fix it (for SSD1289 anyway) I need to manually wire the backlight to a PWM pin (backlight is 3.3V so I need a resistor between PWM pin and LEDs).

Then you can have a function:

void SetBacklightPercent(byte percent)
{
	if (percent > 100)
		percent = 100;

	else if (percent < 0)
		percent = 0;

	analogWrite(PIN_BACKLIGHT, (byte) round(255.0 * (percent/100.0)));
}

See my topic about it, maybe it can help you: http://arduino.cc/forum/index.php/topic,125856.0.html

I still havent done this "mod" because I don't have a solder iron yet..

I think it's impossible to do with LCD. Thanks anyway for the answer. I will use the technique to put in off and on again when dispaly it' s ready.

best regards

Marco