LiquidCrystal Custom Chars Limit

The HD44780 is limited to 8 custom characters on screen at once:

for example

 byte tmpChar[0] = {B10001,
                   B10001,
                   B10001,
                   B10001,
                   B10001,
                   B10001,
                   B10001,};
lcd.createChar(5,tmpChar);
lcd.setCursor(1,0);
lcd.write(5);

delay(1500);

byte tmpChar2[0] = {B00100,
                   B00100,
                   B00100,
                   B00100,
                   B00100,
                   B00100,
                   B10001,};
lcd.createChar(5,tmpChar2);
lcd.setCursor(2,0);
lcd.write(5);

will create tmpChar at 1,0 then create tmpChar2 at 1,0 AND at 2,0. ie: I can't use custom character 5 twice.

Is there any work around or is 8 an absolute limitation? Can 're-draw' of previous chars be prevented?

Or you can draw it as you create it, which will only use one custom character space, and allows you make as many as you want.

Downside is you can't go back unless you remake it.

When you define a custom character, the pattern you define is saved into character memory in the LCD. It draws those characters from that memory. If you define custom character 0 to display an A, then wherever you write 0 to the display, an A will be drawn. If you now define custom character 0 to be Z, anywhere that there is a custom character 0 being displayed, it will immediately change from A to Z.

And, yes, there's a limit in the LCD hardware (at least the ones I have used) of 8 custom characters.

Pete

MarkOne: Is there any work around or is 8 an absolute limitation?

Yes, it is unquestionably an absolute limit. That is the end of the matter.

However, the "on screen at once" is the trick. For a 1602 display, that is one quarter of all the on-screen characters, and the font already contains blank, underscore, block (255) and a couple of other promising pieces, so you can do a lot with it already and dynamically change the characters to only those required at a given moment in animation.

For example.

Thanks guys, that confirms my suspicion.

I had a full screen splash-screen plan for a 40 x 4 display, I'll just forget it !

HazardsMind: Or you can draw it as you create it, which will only use one custom character space, and allows you make as many as you want.

Downside is you can't go back unless you remake it.

for reference, this does not work.

All previously drawn characters will overwrite as you overwrite the custom chars

All previously drawn characters will overwrite as you overwrite the custom chars

Ah, yes I just tested that and it is true. My mistake.

MarkOne: I had a full screen splash-screen plan for a 40 x 4 display, I'll just forget it !

Wow! Haven't come across one of those!

MarkOne: The HD44780 is limited to 8 custom characters on screen at once:

for example

 byte tmpChar[0] = {B10001,
                   B10001,
                   B10001,
                   B10001,
                   B10001,
                   B10001,
                   B10001,};
lcd.createChar(5,tmpChar);
lcd.setCursor(1,0);
lcd.write(5);

delay(1500);

byte tmpChar2[0] = {B00100,                   B00100,                   B00100,                   B00100,                   B00100,                   B00100,                   B10001,}; lcd.createChar(5,tmpChar2); lcd.setCursor(2,0); lcd.write(5);




will create tmpChar at 1,0 then create tmpChar2 at 1,0 AND at 2,0. ie: I can't use custom character 5 twice.

Is there any work around or is 8 an absolute limitation? Can 're-draw' of previous chars be prevented?

For an HD44780u and compatible LCD controller, the 8 character limit is a hardware limit (that's how much "custom character" ram the chip has).

You can create new characters on the fly as needed, but that will be rather slow. Also, if you change a custom character that's already in use, it will also change.

For example, say you made Slot 0 the "degrees" symbol to display a temperature. Then while displaying the temperature, you re-define Slot 0 as, say, the Sigma symbol. Your display will instantly show the "sigma" character where the degrees symbol was!

Hope this helps.

MarkOne: Thanks guys, that confirms my suspicion.

I had a full screen splash-screen plan for a 40 x 4 display, I'll just forget it !

You may be interested in using a graphics VFD display. Noritake has a really nice 128 x 64 VFD display that you can buy new for $38 USD (LINK)

There is also a driver library for that display, using either the parallel interface or the SPI interface (LINK)

Note that this display is a Vacuum Florescent Display (the kind that glows a blue-green), not an LCD. It's a really nice display and you can't beat the price!

Good luck!