Nokia 6100 LCD Display - Arduino Playground

Very interesting.. Uhh.. wow.. haha I wish I knew where to even start.. and you're sure you're using the right code?
And it's even displaying upside down.. (unless that's how it's suppose to display)
Yeah, I couldn't get mine to work properly with the 3.3v, everythings connected to 5v for me. And about Thomas, I'm not even 100% sure he's got his setup yet, he hasn't commented about it. :stuck_out_tongue:
Do you have any random brown outs? Where the Arduino resets because somethings drawing too much power.

If you got that far, doesn't really seem like a power supply issue to me. I would give the Nuelectronics Nokia code a try, you may have to change a little bit of code to get it to work.
http://www.nuelectronics.com/download/projects/Nokia_lcd.zip
They're using the 6600, rather than the 6610. I'm not real sure how different the code is, not my best area. (My best area is probably random ranting:D lol)

Hi all, great progress so far. I am also using SparkFun's Nokia lcd with the breakout board. (sku: LCD-08600)
I'm stuck how my pins don't seem to line up with what anybody has posted. I don't have pins labeled BL, SCLK, SDATA, or VCC.
My breakout board has the pins pictured on the site: S1, S2, CS, SCK, DIO, RESET, STAT2, STAT1, STAT0, GND, 3.3V, and VBATT.
Am I missing something?

Well
S1 and S2 = Switch one and Switch two (the two extra buttons)
SCK = SCLK
STAT 0 through 2 = Looks like the pins for a tri-color LED
Not really sure about DIO

But I just searched the Sparkfun forums, try this out guys.

See if this works for you! One person said he had the LCD showing up, upside down.. another person had every color show up as purple. A few slight changes in code looks like it might help.

Best of luck!

http://forum.sparkfun.com/viewtopic.php?t=13409&highlight=nokia+6100

Ok, got it working (although I'm having the same issue with garbled output for now). For anybody who has the same board as myself from SparkFun.
Arduino LCD08600
N/A S1 (Pushbutton 1)
N/A S2 (Pushbutton 2)
Pin 3 CS (Chip Select)
Pin 4 SCK (Serial Clock)
Pin 5 DIO (Serial Data)
Pin 6 RESET (Reset)
N/A STAT2 (Green Status LED)
N/A STAT1 (Blue Status LED)
N/A STAT0 (Red Status LED)
Gnd GND (Ground)
3V3 3.3V (Power)
3V3 VBATT (Backlight Power)

Hi everybody.
I haven't said much in the past because I'm on vacation, but now I got a computer in an hour!

The board I have is the Sparkfun board with button and Tri-LED. I haven't got it working either, but I would like to point out that the Sparkfun board DOESN'T have a 5V to 3.3V translator, so every data line needs to be converted to 3.3V!
I haven't had any succes with that yet - but I'm hoping someone else who has the same board as me can figure out how to get it working...

This is the board I have: Color LCD - Breakout Board - LCD-08600 - SparkFun Electronics

Best of luck from Italy (where I am :P)

So I've gotten it to draw solid colors. They're off, I'm not sure what the right hex codes would be, they're just 0-255. RGB should be FF-FF-FF...
Anyway, if you replace the clear function with mine below, although slow, it seems to be progress. I've messed with adding a delay to slow the clock but that didn't make a difference. The resistors I had on hand only allowed me to take the 5v outputs to 2.7v instead of 3.3v. I suppose that could be an issue but I doubt it since I am still displaying something.

void lcd_clear(byte color, byte x1, byte y1, byte x2, byte y2)
{
  for(unsigned int i=y1;i<=y2;i++)
 {
  for(unsigned int j=x1;j<=x2;j++)
  {
    lcd_draw_text(color, color, j, i, " ");
  }
 }
}

Well keep in mind, under powering something can be just as bad as overpowering it.
Not in all cases, but a general rule of thumb I likes to follow.

But I didn't realize it had to be brought down to a 3.3v logic, that's no fun :X
I'm glad I got the easier bit, I paid a few bucks more, but I'm a newb so the plug-and-plug really helped :smiley:

I fixed my divider so I now have 3.27v, no difference. Here is new lcd_clear code that refreshes much faster.
Still have the colors a little off and the text is distorted. But it's progress...

void lcd_clear(byte color, byte x1, byte y1, byte x2, byte y2)
{
  lcd_set_box(x1,y1,x2,y2);
  sendCMD(RAMWR);
  for(unsigned int i = 0; i < (((x2-x1+1)*(y2-y1+1)) / 2); i++)
  {
    sendData((color >> 4) & 0xFF);
    sendData(((color & 0xF) << 4) | ((color >> 8) & 0xF));
    sendData(color & 0xFF);
  }
}

This has made it functional for me. I'm using lcd_clear to manually draw everything and updated my colors as following.

  // Data control
  sendCMD(DATCTL);
  sendData(0x00);
  sendData(0x01);
  sendData(0x02);
// 12-bit color definitions
#define GREEN                  0xE0
#define RED                  0x1C
#define BLUE                  0x03
#define YELLOW                  0xFC
#define TEAL                  0xE3
#define PINK                  0x1F
#define BLACK                  0x00
#define WHITE                  0xFF

The final piece to the puzzle, the fonts are now working. They're larger then before (not a bad thing).

void draw_text_line(byte fcolor, byte bcolor,byte x, byte y,char c)
{
  lcd_set_box(x,y,x,y+15);
  sendCMD(RAMWR);
  for(unsigned int i=0;i<8;i++)
  {
    if (1<<i & c)
    {
      sendData((fcolor >> 4) & 0xFF);
      sendData(((fcolor & 0xF) << 4) | ((fcolor >> 8) & 0xF));
      sendData(fcolor & 0xFF);
    }
    else
    {
      sendData((bcolor >> 4) & 0xFF);
      sendData(((bcolor & 0xF) << 4) | ((bcolor >> 8) & 0xF));
      sendData(bcolor & 0xFF);
    }
  }
}

So to sum up what you need for the SparkFun Nokia 6100 lcd knockoff to work with the arduino is the Gravitech code with my modified lcd_clear, data control, color definitions, and draw_text_line.

It's good to see that you phokur have "refurbished" the code, making it faster.
When I get home I'll update the library with the changes...
In the meanwhile I hope others can get their display working using this code - but I still don't think I can get mine working :frowning:

Please help...

Woot, thanks for the updates Phokur :slight_smile:
I got a couple questions, I've tried looking up some other libraries from other LCD libraries to see how to create a Menu.. with no luck.. I can generally take some code and tweak it to my own.
I experimented (and failed horribly) with using if and trying to use some switch functions, using a potentiometer to highlight text depending on the value.. and a button to start an application of sorts, haha but yeah.. no luck.
If somebody could point me in the right area, maybe some books, videos, anything for my newbness! :smiley:

(I don't understand how the code made the text bigger.. reading all the 0xFFs and << & | throws me off real fast and I get overwhelmed lol:/)

I've done a few changes to the code, it now all shows up in the right colors on my screen, its not perfect yet, but is a start. Still working out the locations of drawing boxes. Feel free to add/change it. Major changes were I changed the colors to word type rather than byte, allowing it to send in full color (reds were absent before in the initial code), I also changed some of the fill sizes, as for some reason, it only filled when i went from 0 to 160 square in my draw window. I've also added a few comments as to what values have an effect in certain commands.

http://freetexthost.com/3o6alqaspk

@CaptainObvious, best place to look is in the example code on the arduino site. If you have any specific questions on how things work, feel free to ask, but IMHO the most fun part about using arduinos is the ability to experiment and find out new things.

Cory

Hi everybody.
Now I'm home again and I've just set up the LCD project using a 74HC4050 for the level conversion and hurray, it showed me that it was alive!

But still, the LCD shows me the same crap as blip's (look at his image)
Does anyone know how to fix that, or atleast what is causing that?

I'm working on and will post a code update here this weekend. I'm using the Sparkfun breakout board. Can anyone tell me if using 9V to VBat will hurt the board or LCD?
Thanks! :-/

I'm not sure, so I won't recommend it!

http://www.spakfun.com/commerce/product_info.php?products_id=569

?LED Backlight - 7V @ 40-50mA (very bright)

Definately don't want to put 9v to the board directly. The board should have DC to DC converter to raise 5 volts to the 7v required to run the backlight. (I believe it'll work with 3.3 volts as well)

But any higher than that you're risking it. You can use a voltage divider to bring it down to 5v if you NEED to use the 9v. (Keep in mind, 9v batteries don't have very much power.. you'll have a dead battery fairly quick, especially with an LCD connected, you'd be better off to use multiple AA batteries, or another supply:D)

Well.. I've been using the LCD for a base station for my RF kits, just to use it for debugging. I went through the whole PDF that explains how to interface it in like, 140 pages.. I tried to steal the Circle code from the example, but it's not working as expected. When I try draw the circle, it just draws a line at the top of the LCD, shrug.

Also on the LCD controller, it shows that there is some EEPROM you can use, how exciting. But anyways, best of luck!

Thanks for the tips! I used a 7805l and powered the screen and arduino fine for a while until the 9v ran out.

I made some optimizations and posted the updated code here: http://www.beigerecords.com/joe/?p=378

Has anyone gotten this thing into 8-bit color mode with the sparkfun breakout board? I tried a handful of things in setup and have only seen 12-bit mode.

Hi again.
Now I found my Nokia LCD one more time, connected it, and tried the code again, but I'm still experiencing the same problems as blip (look at his image)
Does anyone know how to fix that, or at least why it is happening?

If it weighed more and wasn't wired to my computer I would have thrown it across the room.

Loaded up cougar's mandelbrott demo and got the blue screen of nothingness.

Loaded up the gravitech code with phokur's changes and got a sorta kinda good result. There seem to be bleeding pixels in the middle of the blocks.

with the code below, trying to us the 16bit color interface, I get something more than nothing, but less useful. With a line in the middle that I don't understand at all.

/* Nokia 6100 LCD interface
rev - = basically copy of Gravitech LCD6610 (epson) program

*/

const byte DISON = 0xaf; //Display On, 0 byte
const byte DISOFF = 0xae; //Display Off, 0 byte
const byte DISNOR = 0xa6; //Normal Display, 0 byte
const byte DISINV = 0xa7; //Inverse Display, 0 byte
const byte COMSCN = 0xbb; //Common Scan Direction, 1 byte
const byte DISCTL = 0xca; //Display control, 3 bytes
const byte SLPIN = 0x95; //Sleep in, 0 bytes
const byte SLPOUT = 0x94; //Sleep Out, 0 bytes
const byte PASET = 0x75; //Page Address Set, 2 bytes
const byte CASET = 0x15; //Column Address Set, 2 bytes
const byte DATCTL = 0xbc; //Data Scan Direction, 3 bytes
const byte RGBSET8 = 0xce; // 256 color position set, 20 bytes
const byte RAMWR = 0x5c; //Writing to memory, Data
const byte RAMRD = 0x5d; //Reading from memory, Data
const byte PTLIN = 0xa8; //Partial Display in, 2 Bytes
const byte PTLOUT = 0xa9; //Paritial Display out, 0 byte
const byte RMWIN = 0xe0; //Read and modify Write, 0 bytes
const byte RMWOUT = 0xee; //End (?), 0 bytes
const byte ASCSET = 0xaa; //Area scroll set, 4 bytes
const byte SCSTART = 0xab; //Scroll start set, 1 byte
const byte OSCON = 0xd1; //Interfnal Osciallation On. 0 byte
const byte OSCOFF = 0xd2; //Internal Osciallation Off, 0 byte
const byte PWRCTR = 0x20; //Power Control, 1 byte
const byte VOLCTR = 0x81; //Electronic volume control, 2 bytes
const byte VOLUP = 0xd6; //Inscrement electronic volume control by 1, 0 byte
const byte VOLDOWN = 0xd7; //Decrement electronic volume control by 1, 0 byte
const byte TMPGRD = 0x82; //Temperature gradient set, 14 bytes
const byte EPCTIN = 0xcd; //Control EEPROM, 1 byte
const byte EPCOUT = 0xcc; //Cancel EEPROM Control, 0 byte
const byte EPMWR = 0xfc; //Write into EEPROM, 0 byte
const byte EPMRD = 0xfd; //Read from EEPROM, 0 byte
const byte EPSRRD1 = 0x7c; //Read Register 1, 0 byte
const byte EPSRRD2 = 0x7d; //REad Register 2, 0 byte
const byte NOP = 0x25; //No Operation

//Arduino pins for control of LCD, using all PORTD pins for now
int LCDCS = 3;
int LCDSCK = 4;
int LCDDIO = 5;
int LCDRST = 6;

const byte pmin = 2;
const byte pmax = 131;
const byte cmin = 0;
const byte cmax = 129;


boolean d = true;
int j=1;

#define cbi(reg, bit) (reg&=~(1<<bit))
#define sbi(reg, bit) (reg|= (1<<bit))

#define setCS cbi(PORTD,LCDCS); //Chip select on
#define clearCS sbi(PORTD,LCDCS); //Chip select off
#define clearSCK cbi(PORTD,LCDSCK); //Clock low
#define setSCK sbi(PORTD,LCDSCK); //clock high
#define clearDIO cbi(PORTD,LCDDIO); //data low
#define setDIO sbi(PORTD,LCDDIO); //data high
#define setReset cbi(PORTD,LCDRST); //enable reset
#define clearReset sbi(PORTD,LCDRST); //disable reset

//#define BL0 cbi(PORTD,BL);
//#define BL1 sbi(PORTD,BL);

void lcdData(byte _b){
  setSCK
  clearCS
  setCS
  
  clearSCK
  setDIO
  setSCK
  writeToLCD(_b);
}
void lcdCmd(byte _b){
  setSCK
  clearCS
  setCS
  
  clearSCK
  clearDIO
  setSCK
  
  writeToLCD(_b);
 
}
void writeToLCD(byte _b){

  clearSCK
  if((_b&B10000000)!=0){setDIO} else {clearDIO}
  setSCK
  clearSCK
  if((_b&B01000000)!=0){setDIO} else {clearDIO}
  setSCK
  clearSCK
  if((_b&B00100000)!=0){setDIO} else {clearDIO}
  setSCK
  clearSCK
  if((_b&B00010000)!=0){setDIO} else {clearDIO}
  setSCK
  clearSCK
  if((_b&B00001000)!=0){setDIO} else {clearDIO}
  setSCK
  clearSCK
  if((_b&B00000100)!=0){setDIO} else {clearDIO}
  setSCK
  clearSCK
  if((_b&B00000010)!=0){setDIO} else {clearDIO}
  setSCK
  clearSCK
  if((_b&B00000001)!=0){setDIO} else {clearDIO}
  setSCK
  
  clearCS
  
}
void setBox(byte c1,byte c2,byte p1,byte p2){
  
  lcdCmd(CASET);
  lcdData(c1);
  lcdData(c2);
  lcdCmd(PASET);
  lcdData(p1);
  lcdData(p2);
  
}

void fillBox(byte color, byte c1, byte c2, byte p1, byte p2)
{
  uint16_t total_bytes1;
  uint16_t total_bytes2;
  uint16_t total_bytes;

  setBox(c1, c2, p1, p2);

  lcdCmd(RAMWR);
  total_bytes1 = (c2 - c1 + 1); 
  total_bytes2 = (p2 - p1 + 1);
  total_bytes = total_bytes1 * total_bytes2;
  for (unsigned int i = 0; i < total_bytes; i++){
    lcdData(color);
    lcdData(color);
  }
}

void fillScreen(byte color){
  fillBox(color,cmin, cmax,pmin,pmax);
}

//LCD Initialize------------------------------------
void lcdInit(){
  setReset
  delay(10);
  clearReset
  
  clearCS
  setDIO
  setSCK
    
  lcdCmd(DISCTL); //Display Control ---------------------------------
  lcdData(0x0A);  //CL dividing ratio
  lcdData(0x20);  //130 line display
  lcdData(0x11);  //no inversely highlighted lines
  lcdData(0x01);  //dispersion
    
  lcdCmd(COMSCN); //Com Scan ----------------------------------------
  lcdData(0x01);
    
  lcdCmd(OSCON);  //Oscillator On -----------------------------------
    
  lcdCmd(SLPOUT); //Sleep Out ---------------------------------------
  
  lcdCmd(VOLCTR); //Voltage Control----------------------------------
  lcdData(0x20);
  lcdData(3);
  
  //Temperature Gradient
//  lcdCmd(TMPGRD);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
//  lcdData(0);
  
  //Power Control -----------------------------------
  lcdCmd(PWRCTR);
  lcdData(0x0f);
  
  delay(100);
  
  //Invert Display-----------------------------------
  lcdCmd(DISINV);
  
  //Clear Partial disply data------------------------
  lcdCmd(PTLOUT);
  
  //Autoscroll clearing (I hope)
  lcdCmd(ASCSET);
  lcdData(00);
  lcdData(32);
  lcdData(32);
  lcdData(3);
  
  //Data Scan Direction------------------------------
  lcdCmd(DATCTL);
  lcdData(0x00);
  lcdData(0x00);
  lcdData(0x04); //1 = 8 bit, 2 = 12 bit, 3=12 of 16 bit
  lcdData(0);
  
  //RGB Mapping--------------------------------------
//  lcdCmd(RGBSET8);
//    lcdData(0x00);
//    lcdData(0x02);
//    lcdData(0x04);
//    lcdData(0x06);
//    lcdData(0x08);
//    lcdData(0x0A);
//    lcdData(0x0C);
//    lcdData(0x0F);
//    lcdData(0x00);      // 000 GREEN
//    lcdData(0x02);      // 001  
//    lcdData(0x04);      // 010
//    lcdData(0x06);      // 011
//    lcdData(0x08);      // 100
//    lcdData(0x0a);      // 101
//    lcdData(0x0c);      // 110
//    lcdData(0x0f);      // 111
//    lcdData(0x00);      //  00 BLUE
//    lcdData(0x06);      //  01
//    lcdData(0x09);      //  10
//    lcdData(0x0f);      //  11
  


  lcdCmd(NOP);

  delay(100);

  lcdCmd(NOP);
  fillScreen(0x0F);
  lcdCmd(DISON);
}


void setup(){
  DDRD |= B01111100;   // Set SPI pins as output 
  PORTD |= B01111100;  // Set SPI pins HIGH
  
  delay(500);
  
  pinMode(8,INPUT);
  pinMode(9,INPUT);

  
  lcdInit();
  //Make some shit happen
  
  lcdCmd(RAMWR);

  d = false;
}


void loop(){
  d = false;
  byte C = 0xFF;
  int dC=30;
  digitalWrite(11,LOW);
  delay(250);
  fillScreen(C);
  if(C > dC){
    C-=dC;
  }else{
    C=0;
  }
  
}