LVG1021/VLGEM1021 - KS0074 SPI LCD can't get to work with my Arduino UNO :/

Hello together,
Since last week I am proud owner of an Genuino/Arduino UNO :slight_smile:

After recycling some electronic parts from old gear, I've found a LCD Display which was used in an old Siemens phone. After some research I've got the following information for that Display:

  • Same as HB24208 and HB24209
  • HD44780 compatible
  • uses a KS0074 controller (in serial mode => SPI)
  • uses SPI for communication (which is pretty cool as not much wires are needed to run the LCD)
  • SPI LSBFIRST
  • max 1MHz
  • Power Supplay 2,7V - 5,5V

Pinout:
1 - not used
2 - not used
3 - MOSI
4 - GND
5 - CLK
6 - GND
7 - MISO
8 - VCC
9 - SS/CS
10 - Contrast

I would love to use that LCD in some Projects. But I am not able to get fired it up :confused: After some days without success I hope to get some input/help from you guys :slight_smile:

The LCD is coneccted as followed with my Genuino/Arduino Uno:

LCD Pin 3 - MOSI <=== Arduino Pin 11
LCD Pin 5 - CLK <=== Arduino Pin 13
LCD Pin 9 SS/CS <=== Arduino Pin 10

LCD Pin 4/6 - GND <=== Arduino GND
LCD Pin 8 - VCC <=== Arduino +5V
LCD Pin 10 <=== 10K - Potentiometer - 5V

and I am using the following code:

#include <SPI.h>

const int cs=10;

SPISettings spiLCD(SPI_CLOCK_DIV16,LSBFIRST,SPI_MODE0); //1MHz

void setup() {
  //SPI.setBitOrder(LSBFIRST);
  //SPI.setClockDivider(SPI_CLOCK_DIV16); //1Mhz
  
  pinMode(cs,OUTPUT);
  digitalWrite(cs,HIGH);

  delay(22); //Wait 22-ms for LCD

  SPI.begin();  
  
  SPI.beginTransaction(spiLCD);  
  digitalWrite(cs,LOW);
  
  SPI.transfer(B00011111); //0x1F MSB 0001 1111 LSB - StartByte 
  delay(50);
  /*SPI.transfer(0x03); //8bit-2line => Function-Set MSB 0011 1000 LSB
  SPI.transfer(0x04);  
  delayMicroseconds(40);
  */

  //SPI.transfer(B00001000); //Function Set 8-bit 2-lines
  //SPI.transfer(B00000011);   
  delay(50);

  SPI.transfer(B00001111); //0x0F - MSB 0000 1111 LSB Display-on, cursor-on, blink on => Display Control 
  SPI.transfer(B00000000);   
  delay(50);


  SPI.transfer(B00000001); //0x01 - MSB 0000 0001 LSB Clear Display 
  SPI.transfer(B00000000); 
  delay(2000);

  SPI.transfer(B00001111); //0x5F - MSB 0101 1111 LSB Entry Mode Set 0000 0110
  SPI.transfer(B00000101); 
  
  //SPI.transfer(B00000110); //0x07 - MSB 0000 0110 LSB Entry Mode Set 
  //SPI.transfer(B00000000);
  //Initalization end
  delay(50);
  
  SPI.transfer(B00000010); //0x42 - MSB 0100 0010 LSB Write ASCII B
  SPI.transfer(B00000100);
  delay(1);
  
  digitalWrite(cs,HIGH);
  SPI.endTransaction();
  
}

void loop() {   
  
}

Thank you in advance I appreciate any feedback given :slight_smile:

Hello!

I am also wondering if this could work. Any succes anyone?

Can you provide a link to a datasheet? I've looked around quite a bit and can't seem to find one.
--- bill

Should be KS0074 or similar. Datasheet

I saw that datasheet when I did searches. For some reason it crashes the linux pdf viewer and doesn't work on Firefox either. I could view it using chrome.

I've seen several LCD chips that use spi and i2c that transfer data and control signals very similar.
Even though they seem to use the same start byte, they all seem to transfer the low level bits/bytes across the interface just a bit differently.

From that datasheet, the spi bytes you are sending seem correct for the given commands you are trying to send.
It would be nice to look at the spi signals using a logic analyzer to see if they are really going out the way that is expected.

It could be that the initialization sequence is not quite correct.

What isn't clear in the datasheet if i2c mode only is controlled in 4 bit mode on the LCD or whether the actual LCD interface is 8 bit even though the low and high nibble are being sent separately.
If it is really using 4 bit mode, then initialization sequence is more extensive.
I'm assuming that the LCD is controlled in 8 bit mode.

Another few things you could try is

  • slow the spi transfer rate down
  • send the start byte each time in case there is a sync issue

You can always tweak things later once things start to work.

It may be overkill depending on what you really want/need but
you could go an alternate direction and write an i/o class for my hd44780 library.
An i/o class is just the low level code to push the data/cmds to the LCD.
All the hd44780 code and user API resides above in a common class.
You could look at some of the other i/o classes to get an example.
The i/o class for the Nortake VFD serial/spi based devices is similar to what you would need.
You can install the library with the IDE library manager. (don't use a zip file)
Here is a link to the github page: https://github.com/duinoWitchery/hd44780

--- bill

--- bill