Pages: [1]   Go Down
Author Topic: Question on Serial LCD  (Read 724 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 127
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!!!!
Logged

London
Offline Offline
Sr. Member
****
Karma: 1
Posts: 330
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Gordon
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://en.wikipedia.org/wiki/HD44780_Character_LCD

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 127
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!!!

Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 354
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well there is an LCD library you should be able to use:
http://arduino.cc/en/Reference/LiquidCrystal?from=Tutorial.LCDLibrary

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:
http://moderndevice.com/LCD.shtml

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
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 147
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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...

Code:
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.
« Last Edit: January 22, 2009, 06:44:27 am by skumlerud » Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 147
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 127
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks guys,

I got its sorted with your help!!!!   smiley
Logged

Pages: [1]   Go Up
Jump to: