HD44780 LCD and using CGRAM

hi,

is there any way to use the LCD internal Character Generator RAM to print these symbols:

[ch9650] [ch9660] [ch9658] [ch9668]

ciao sunny

PS: I'm using the LiquidCrystal Library packaged with v0012

Yes, no problem. You must define these characters yourself. I don’t know if the library you’re using has this functionality, here’s the code I use myself:

// Upload a user-defined character (5x8)
// See http://www.quinapalus.com/hd44780udg.htm for
// character generator.
void LcdUploadUdef5x8(int character, int *data)
{
  int c = character << 3, i;

  for (i = 0; i < 8; i++)
  {
    LcdCommandWrite(0x40 | c | i);
    LcdDataWrite(data[i]);
  }
}

“character” is the index of the character you want to define (there’s eight user definable characters), “data” is a pointer to an array of eight bytes that defines the character.

To print a user defined character you just write the index to the LCD. E.g. user defined character 1 is printed by writing the byte 1. That’s it.

hey, thats really nice! thank you! :)

ciao sunny

hm, i've modified LiquidCrystal with your sugestion, but i think i'm doing something wrong. Can someone take a look at the examble?

http://www.visualdrugs.net/temp/GCRAM_Test.rar

thx sunny

If you can use zip instead of rar I can take a look at it.

no problem:

http://www.visualdrugs.net/temp/GCRAM_Test.zip

thanks in advance, sunny

int up_arrow[] = {14, 27, 24, 27, 27, 25, 15}; only contains seven bytes. It must be eight. Insert a zero at the end. I'm not good at C++ so I can't say if your implementation if writeToCGRAM is OK.

I am using a lcm1602a. I use the latest .zip file posted. I am able to print character but unable to print what's been stored in the CGRAM. Why is that?