:: IST3020 LCD driver JLX19264 (-329) starter code

this page is to provide starter code for IST3020 LCD engine
items like JLX19264-329
http://www.jlxlcd.cn/html/zh-detail-309.html
a rather large view width
a step up in size will the the 130mm wide category, the dpi will go from approx 62 to 48.
these are cheap on taobao, about USD7 shipped.
the trick to starting the LCD engine appears to be on page 50 of the IST3020 pdf.
https://www.displayfuture.com/Display/datasheet/controller/IST3020.pdf

ie : to put the engine to sleep first. then continue with whatever else initialization. this step is not inside the sample code of the JLX pdf. w/o this instruction to the engine, the LCD does not start to display pixels

this routine runs a test by drawing random pixels line by line

// LCD --------> MCU (pro mini 3.3v)

// 05 LED BL --> 4 LB
// 06 GND
// 07 V+
//
// 08 A0/RS ---> 5 RS
// 09 RESET ---> 6 RT
// 10 CS ------> 7 CS
// 11/D7 SDA --> 8 DD
// 12/D6 SCK --> 13 DC
// 13 D5 ------> GND
// 14 D4 ------> GND
// 15 D3 ------> GND
// 16 D2 ------> GND
// 17 D1 ------> GND
// 18 D0 ------> GND
// 19 E  ------> GND
// 20 RW ------> GND

#define LB 4
#define RS 5
#define RT 6
#define CS 7
#define DD 8
#define DC 13

void LTC(byte cmd)    //send cmd
{
int i,j;
digitalWrite(CS, LOW);
digitalWrite(RS, LOW);
  for(int i=0;i<8;i++)
  {
  digitalWrite(DC, LOW);
  if(cmd&0x80) {digitalWrite(DD, HIGH);}
  else {digitalWrite(DD, LOW);}
  delayMicroseconds(1);
  digitalWrite(DC, HIGH);
  cmd=cmd<<=1;
  }
digitalWrite(CS, HIGH);
digitalWrite(DC, LOW);
}

void LTD(byte cmd)    //send data
{
int i,j;
digitalWrite(DC, LOW);
digitalWrite(CS, LOW);
digitalWrite(RS, HIGH);
  for(int i=0;i<8;i++)
  {
  digitalWrite(DC, LOW);
  if(cmd&0x80)  {digitalWrite(DD, HIGH);}
  else {digitalWrite(DD, LOW);}
  delayMicroseconds(1);
  digitalWrite(DC, HIGH);
  cmd=cmd<<=1;
  }
digitalWrite(CS, HIGH);
digitalWrite(DC, LOW);
}

void INIT_LCD()

digitalWrite(CS, HIGH);
digitalWrite(CS, LOW);
digitalWrite(RT, HIGH); delay(50);
digitalWrite(RT, LOW); delay(50);
digitalWrite(RT, HIGH); delay(50);
LTC(B10101001); delay(50); //sleep <---
LTC(B10101011); delay(50); // osc on
LTC(B00101100); delay(50); // VC on
LTC(B00101110); delay(50); // VR on
LTC(B00101111); delay(50); // VF on
LTC(B10100001); //  S1-132 fwd
LTC(B11000000); //  COM fwd
LTC(B10100010); delay(50); //  bias set
LTC(B00100011); //  vreg
LTC(B10000001); //  vref on
LTC(B00000110); //  contrast
LTC(B01000000);  // line zero
LTC(B10110000);  // page zero
LTC(B10101111);  // disp ON

}

void LADD(byte PG,byte CL)

PG = 0xb0|PG;
LTC(PG);
LTC((0x10|(CL>>4)));
LTC((0x0f&CL));
//Serial.println("");
//Serial.print(PG);Serial.print(" x ");Serial.print(CL);Serial.print("   ");Serial.flush();
}

void CLS()
{
Serial.println("");
int i,j;
for(int i=0;i<8;i++) 
{
//Serial.print("line ");
//Serial.println(i);
//Serial.flush();
LADD(i,1); 
for(int j=0;j<224;j++) 
{
int R = random(0,255);
LTD(R);
delay(2);
}
}
}

void CLB()
{
Serial.println("clean");
int i,j;
for(int i=0;i<8;i++) 
{
LADD(i,1); 
for(int j=0;j<224;j++) 

LTD(B00000000);
delay (0);
}
}
}

void setup()
{
  Serial.begin(57600, SERIAL_8E2);
  pinMode(LB, OUTPUT);
  pinMode(RS, OUTPUT);
  pinMode(RT, OUTPUT);
  pinMode(CS, OUTPUT);
  pinMode(DD, OUTPUT);
  pinMode(DC, OUTPUT);
  INIT_LCD();
 
}

void loop()
{
CLB();
while (1)
{

CLS();

}

exit(0);
}

Comments

Popular Posts