Question on Serial LCD

Could somebody please tell me if this display can be used in serial communication with an arduino?:

http://www.futurlec.com/LED/BLUELCD16x2BL.shtml

If not can it be used on the 4bit system??

Sorry for being such a newb!!!!

Its not serial, but should be fine with 4 or 8 bit interface method.

Gordon

I just got my 2x16 LCD working with my Arduino. it's not the same one, but it looks pretty much exactly like the one you have there, with the same pinouts and everything. Somebody correct me if I'm wrong, but it seems like most of the parallel displays out there follow this same type of connection, either 4 or 8-bit parallel data with RS, R/W and E lines and power connections.

I'd say you're probably safe. make sure you pick up some male headers so you can connect this to a breadboard easily.

~Rick

The "standard" LCD interface is really just the interface of a particular LCD driver chip, the HD44780:

That chip is so widely used in LCD modules that they nearly all have the same pinout, signals and command set.

Thanks guys,

Got it all working but now im trying to find out how to write data to all four lines as all i can find is code and info on 2 line displays!!!

The HD44780 does not "know" how many lines are on the display! If you move the cursor to character cell 20, that's the first character cell of the second row. Character 40: first cell of third row; character 60: first cell of fourth row. The HD44780 only has 80 character cells, no matter what size LCD is connected.

Now, I don't know if the code in the Arduino library does anything cleverer than that and re-maps the display at all!

well there is an LCD library you should be able to use:

if you want to communicate via serial, you'll need a converter of sorts where you output certain serial commands which are decoded to LCD code.

Modern Device has a cheap kit for this purpose:

if you already have a few resistors and a voltage regulator you could just buy and LCD controller chips form phanderson.com . its the same chip the Modern Device LCD board is based on

The HD44780 does not "know" how many lines are on the display! If you move the cursor to character cell 20, that's the first character cell of the second row. Character 40: first cell of third row; character 60: first cell of fourth row. The HD44780 only has 80 character cells, no matter what size LCD is connected.

This is not quite correct. The first row starts at offset 0, that's true. But the second (third for four-line displays) row starts at offset 64! On four-line displays row two starts at offset 20, and row four starts at 84. I'm sure there's a good reason for doing it like this...

The code for positioning the cursor would be something like...

void gotoxy(int x, int y)
{
  int offset[] = {0, 64, 20, 84};
  commandwrite(0x80 | (offset[y] + x));
}

IIRC this is how it's done in LiquidCrystal.

Yep. The actual code in liquidCrystal looks slightly different but the logic is exactly as skumlerud points out.

void LiquidCrystal::setCursor(int col, int row)
{
  int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
  command(0x80 | (col + row_offsets[row]));
}

Modern Device has a cheap kit for this purpose:

ByVac has a similar solution, but for I2C. The chip doesn't require any external components except a potmeter for contrast adjustment. I have one and it works fine, but I had to learn a bit about I2C to use it.

The advantage of using I2C is that the serial port is free, which makes things easier when developing. The disadvantage is that the Wire-library (needed for I2C) is big, it use around 2400 bytes of flash.

Thanks guys,

I got its sorted with your help!!!! :slight_smile: