NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Connect a different LCD

March 30, 2011
by lnino
lnino's Avatar

Hi at all.

I bought a smaller and colored lcd and now I want to wire it correctly with MCU on the breadboard.

In the datasheet of the HD44780 I was not able to figure out what each port stands for. In the nerdkits guide some ports have been named, but not all.

So I am not sure how I can connect my new lcd correctly, without destroying it. :-)

Maybe somebody can help me to solve this challenge.

Here is the datasheet of the new display I want to connect: LCD Datasheet

Thanks for helping.

March 30, 2011
by 6ofhalfdozen
6ofhalfdozen's Avatar

Hi Inino,

It is easiest to wire up another HD44780 LCD to the NK using the same pins as used in the NK. From the datasheet you have, it looks like the pinouts are very close to the ones used on the NK LCD, but will take some programming of the LCD.

So From what I read on the datasheet and NK guide(P27 says put what/where, P28 explains the why's.. P27 explains pins 4/6 and also 11-14), it sounds like pins 1-2 are wired the same as the LCD with the NK. Pins 4 and 6 are also the same. Your LCD uses 8 pins for data, but according to the datasheet it can be done in 4 bit nibbles like the NK's LCD. You could also just use 8 pins on the NK. The color cathodes going to ground and the backlight anode going to "+5V" are pretty self explanitory.

It seems like you have a pretty nice LCD there, but it is definately more "programming" intensive. The programming part loses me a bit, so hopefully one of the gurus around here will chime in on that. Anyhow, hope that helps a little

March 30, 2011
by lnino
lnino's Avatar

Hi 6ofhalfdozen,

thank you for your reply.

But what are the ports 7-10 and 15-16 on LED of the NK for? I can't find it neither in the NK Guide nor in the datasheet.

It would great if a guru can help a little bit.

March 30, 2011
by rajabalu21
rajabalu21's Avatar

The pin descriptions for LCD could be found here.

-Raja

March 30, 2011
by mongo
mongo's Avatar

The nice thing about the HD44780 is that it is somewhat standardized. Only a couple of different pinouts are used so they are pretty much all compatible. All you need to do is watch the line and character counts from what I can tell.

March 30, 2011
by lnino
lnino's Avatar

@ rajabalu21: Thank you for the link. This is exactly what I have been looking for.

@ mongo: Thanks to you. I will have a look.

March 30, 2011
by lnino
lnino's Avatar

I was now able to wire my new color lcd. :-)

Thanks for the help.

Here's a picture(Because of the flash you can't see green color):

LCD Color

March 30, 2011
by Ralphxyz
Ralphxyz's Avatar

That's interesting, I take it you can have a RGB background (Red, Green and Blue).

Can you mix the colors or just useone color at a time?

Ralph

March 30, 2011
by Noter
Noter's Avatar

Very cool! Where'd you get that multi-color LCD?

March 31, 2011
by lnino
lnino's Avatar

@ Ralphxyz: You can mix the colors if you want. But it looks strange when you use Red, Green and Blue at the same time. :-) But it is posible. But you can also use them seperated.

@ Noter: I don't know in which shop you can by them. A guy in the forum of www.microcontroller.net made a big modder project and a company designed this LCDs for him. He bought 100 pieces because this was the minimum order value.

If you are interested here are some links. Maybe some LCDs are still left. One piece was about 15 Dollars.

http://www.mikrocontroller.net/topic/200176#new

daniel@schemann.net

The guy is located in Germany.

March 31, 2011
by lnino
lnino's Avatar

I have now took a look into my lcd.c so see which things I have to change, when I use a 2x16 instead of a 4x20 display.

I have only found this entry:

void lcd_goto_position(uint8_t row, uint8_t col) {
  lcd_set_type_command();

  // 20x4 LCD: offsets 0, 0x40, 20, 0x40+20
  uint8_t row_offset = 0;
  switch(row) {
    case 0: row_offset = 0; break;
    case 1: row_offset = 0x40; break;
    case 2: row_offset = 20; break;
    case 3: row_offset = 0x40+20; break;
  }

  lcd_write_byte(0x80 | (row_offset + col));
}

void lcd_line_one()   { lcd_goto_position(0, 0); }
void lcd_line_two()   { lcd_goto_position(1, 0); }
void lcd_line_three() { lcd_goto_position(2, 0); }
void lcd_line_four()  { lcd_goto_position(3, 0); }

Is there more to change?

In this code I would delete void lcd_line_three() and lcd_line_four() and also case 2 and case 3.

Do I have to change also the value of case 1? Or is there any other var in the lcd.c which has the value of the 4 lines and 20 digits in it? Or does someone have a ready to go lcd.c for a 2x16 display?

March 31, 2011
by Ralphxyz
Ralphxyz's Avatar

It seems like you "should" be able to get varied colors using RBG maybe even chartreuse/Pear (209, 226, 49) :-)

Ralph

Post a Reply

Please log in to post a reply.

Did you know that microcontrollers have two different kinds of memory, program space (flash) and SRAM? Learn more...