I have a nokia 1202 monochromatic LCD.It seems that the protocol used for interfacing that LCD is 9 bit SPI interface.I heard only 8 bit SPI interface.How can I interface that LCD using Arduino UNO?.I also attached the LCD drivers datasheet.Help me to find solution for interfacing 9 bit LCD using Arduino UNO.I also need help on programming the arduino for that 9 bit SPI protocol.
Your display controller supports three interface modes: I2C, 4-line SPI and 3-line SPI. It is the last one that is a 9 bit protocol. Why can't you use the 4-line, 8-bit SPI mode?
I also noticed the same in that data sheet.But the pinout of the actual LCD doesn't have separate pin for I2C. I'll attach the pinout config. of the LCD for your reference.
Hi olikraus
I like to know briefly about the direct port manipulation.Can you please explain me? I like to start with basic and like to advance level.I am beginner to the LCD.
I see. I have a similar problem with another display and a fixed interface mode.
Bit bashing is the most straightforward way. You are just trying to reproduce the timing diagram in the datasheet. The actual timing isn't usually a problem when bit bashing because it is slow. You can make it more efficient by directly writing to the port instead of using digitalWrite().
Here is plain, although somewhat clumsy, example:
#define CS_PIN 4
#define SCK_PIN 5
#define DATA_PIN 6
writeToLCD(byte value, bool command)
{
 digitalWrite(CS_PIN, LOW); // enable chip select
 if (command) // first bit is command (0) / data (1)
  digitalWrite(DATA_PIN, LOW);
 else
  digitalWrite(DATA_PIN, HIGH);
 digitalWrite(SCK_PIN, HIGH); // rising edge clocks the data in
 digitalWrite(SCK_PIN, LOW);
 for (int i=0; i<8; i++) { // for each of the 8 data bits, D7 is first
  if ((value & 0x80) == 0)
   digitalWrite(DATA_PIN, LOW);
  else
   digitalWrite(DATA_PIN, HIGH);
  digitalWrite(SCK_PIN, HIGH); // clock the data in
  digitalWrite(SCK_PIN, LOW);
  value = value << 1; // shift next data bit into position
 }
 digitalWrite(CS_PIN, HIGH);     // disable chip select
}
Oliver's code looks very nice. It is probably the optimal approach.
I have a little doubt in your coding.Can you please explain me the iteration part of the program.I can't able to understand the looping part of the program.And moreover how can I able to print a word or a number in the LCD using the program you suggested me.Can you please give me a brief explanation
That was just a piece of code to write one byte, either command or data, to the display. The diagram from the datasheet (below) is what the code seeks to do.
CS on top, SCK in middle, DATA on bottom
To print characters requires multiple bytes. Furthermore you must send a sequence of commands to initialize the display or position the cursor.
You can probably find libraries for this controller and display on the internet. As a first attempt, google "STE2007 github" or maybe "nokia 1202 github". You will probably find some code, hopefully some that works. Then you may need to modify it to do 9-bit instead of 8-bit. Or if you're lucky someone has already done it for 9-bits.
Or maybe u8glib supports this display in 8-bit SPI?
You can notice that it doesn't supports 8 bit SPI,because in the pin configuration of LCD ,you will find only three pins for communication viz. MOSI,SCK(clock),CS.I think it wont supports 8 bit spi,since we need 4 pin for 8 bit spi according to the datasheet.But in our case,it seems that 8 bit is not possible.
I found a header file from github for nokia 1202 .the link is
I found something useful from that site.
I understood how can we able to write numerical and alphabets.Can we able to draw some graphics like sine wave or exponential wave to the LCD?.In what way we can make it possible?
I think you need a library that has graphics functions. You can write your own, pay someone to write one, convince someone to write one for free, buy one or find a free one. Based on your questions I would suggest that you try the last option first.
Can you suggest me some pages which offers header file for STE2007? I also have another doubt.Can we able to use a 16 bit SPI color LCD screen using 8 bit Arduino UNO?. Is it possible? I think parallel interfacing of 16 bit LCD is not possible to drive using a 8 bit Arduino UNO. Is it possible to interface 16 bit Serial interface using UNO?
Serial means one bit at a time so 16 bits total is no problem. You actually could use an Uno to drive a 16-bit parallel interface. The Uno has 20 I/O pins, enough for 16 data bits and a few control lines.
Sorry, I don't have familiarity with any software for this controller.
Can you suggest me some pages which offers header file for STE2007? I also have another doubt.Can we able to use a 16 bit SPI color LCD screen using 8 bit Arduino UNO?. Is it possible? I think parallel interfacing of 16 bit LCD is not possible to drive using a 8 bit Arduino UNO. Is it possible to interface 16 bit Serial interface using UNO?
As long as the display has a serial interface, 16 bit color depth or even 18 or 24 bit color depth are no problem.
My other library "ucglib" has focus on true color LCDs and OLEDs with SPI support.