Difficult parallel  LCD problem

Hello all I am so close to getting this LCD working but I just cannot get it to display anything. I think it is just a matter of a few bits being misplace but I am absolutely stumped here and need some expert adivce.

The LCD (VL-FS-MDLS20464D-04 ) located http://www.varitronix.com/Product/character/VL-FS-MDLS20464D-41.pdf

This uses a KS0066UP Processor (datasheet KS0066U Datasheet(PDF) - Samsung semiconductor)
has several bits I am possibly screwing something up.

If you look on the pin list for the VL-FS LCD there are three signals RS, RW, and E
"E" is the enable bit and I have just tied it to high (5V) RS and RW if you look at the processor data sheet have different values depending on the operation. I am listing my code to display a 75 in ASCII which is a capitol "H" I believe. The sequence just is not working and I cannot for the life of me figure out why,

Here is my code

//pin connected to RCK
int latchPin = 8;
//pin connected to sck
int clockPin = 12;
// pin connected to ser
int dataPin = 11;
int RW = 10;
int RS = 9;



void setup()
{
  // set all pins to output so you can control shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(RW, OUTPUT);
  pinMode(RS, OUTPUT);
}
void loop()
{
  //initialization
  delay(100);
  //Function set
  digitalWrite(RW, LOW); 
  digitalWrite(RS, LOW);
  int numtodisp = 48;
  shifty(numtodisp);
  //display off
  numtodisp = 8;
  shifty(numtodisp);
  //display on
  numtodisp = 15;
  shifty(numtodisp);
  //Entry Mode Select
  numtodisp = 6;
  shifty(numtodisp);
  
  //Display Mode
  digitalWrite(RW, LOW); 
  digitalWrite(RS, HIGH);
  numtodisp = 75;
  shifty(numtodisp);
  delay(500);
  
}

void shifty(int funct)
{
  
  //your sending bits
  digitalWrite(latchPin, LOW);
  //shiftout the bits
  shiftOut(dataPin, clockPin, MSBFIRST, funct);
  //Take latch pin high so led's will light up
  digitalWrite(latchPin, HIGH);
  //Pause
  delay(2);
}

Its basic and its using the 74HC595 in the Arduino Shiftout example wire the same way except for two more digital out pins assigned to RS and RW.

On the KS0066UP data sheet page 26 the setup for the LCD display. This is basically what I am doing and it plain won't work. I really could use a helping had from some seriously smart individuals on this one how to get something to pop up on this display

Thanks so much

Bill

So in your setup are you using a 74HC595?

Based on the timing diagrams, it would suggest E can't just be tied high. It latches in the data once it is valid.

Have a look at page 19 of your datasheet. You truly cannot just leave E high. It is an integral part of the communication mechanism to the LCD.

--
The Quick Shield: breakout all 28 pins to quick-connect terminals

Hello all I am so close to getting this LCD working ...

I'm not too sure about this.

It is hard to troubleshoot your program when you express the LCD commands in decimal. Those commands are bitmapped, meaning that each bit is significant but the 'number' that the bits represent is not. This means that the most appropriate radix is binary, with hex as an alternate.

For starters:
Are you using 8 data bits or 4 data bits? A link to the specific circuit that you are using would help.

It appears that your LCD initialization does not follow the recommendations given in most datasheets. I don't see where you specified that this is a multi-line display. You seem to have left out some required delays. You might want to follow the LCD Initialization link at http://web.alfredstate.edu/weimandn to find out what has to be done.

You must only do the initialization once, so that part belongs in setup(), not in loop().

Don

Thank you all for the reply. The Enable bit is tied high in the program and I will look at fixing it.
The shift out command ouputs numbers and the number patterns in AsCII are what I was using to get the proper codes. It seemed to work when I had LED's light up before I attached the LCD.

What would suggest I use for code to get each individual bit to light up if not shiftout()?

I do not understand the E bit at all what should I do with it if not enable the LCD screen 24-7?

Thanks

Oh and this is an 8 bit system. I am not using the 4 bit type

Thanks

What would suggest I use for code to get each individual bit to light up if not shiftout()?

Do you have the 8 databits of the LCD connected to a 74LS595? Or are they connected to the Arduino's I/O pins? For the rest of my post I am going to assume you used a shift register since that is how you wrote your code.

I do not understand the E bit at all what should I do with it if not enable the LCD screen 24-7?

The enable bit is a latch signal. It is not a signal that turns the LCD on or off.

Page 10 of the LCD's datasheet shows the timing relationship of all your signals.

So in your code you need to:

  1. put E (Enable or Latch) LOW
  2. Set RS as necessary
  3. Set R/W as necessary
  4. (In your case, apparently, shift out the data bits to your 74LS595 as necessary.)
  5. Put E HIGH

The shift out command ouputs numbers and the number patterns in AsCII are what I was using to get the proper codes

Then if you go to Page 26 of the controller's datasheet, you can see the sequence necessary to startup your display. Make sure you put in the delays shown in that flow chart.

So for example, the first command you send is shown as
RS = 0
R/W = 0
DB7 = 0
DB6 = 0
DB5 = 1
DB4 = 1
DB3 = N (0 for one line, 1 for two line)
DB2 = F (0 for display off, 1 for display on)
DB1 = x (don't care)
DB0 = x (don't care)

For the sake of an example let's say you want to use it as a 2-line display, with the display on, and we treat "don't cares" as 0. In this case DB7-DB0 = 0011 1100 in binary which is 0x3C in Hex.

That means you need to:

  1. Put E HIGH
  2. Set RS to LOW
  3. Set R/W to LOW
  4. Shift-Out 0x3C
  5. Put E LOW
    .... wait 39us, do the next, repeat.

After you properly initialize the LCD, then you are ready to start sending write command to display data.

That means you need to:

  1. Put E HIGH
  2. Set RS to LOW
  3. Set R/W to LOW
  4. Shift-Out 0x3C
  5. Put E LOW
    .... wait 39us, do the next, repeat.

The way I read the timing diagram you must set the RS and R/W levels at least tSU1 before making E high. This would put your step 1 after steps 2 and 3.

The data can be set up before dealing with RS and R/W but I believe that most programmers do it here (step 4) as you recommend.

You must make sure that E has been high for at least tW and that the data has been stable for at least tSU2 before making E low. The data transfer is triggered by this negative transition of E.

The final delay is needed after making E low in order to make sure the data transfer has time to complete. This is shown as tH1 and tH2 on his timing diagram.

Don