Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need more than 8 user defined characters

Status
Not open for further replies.

mcs51mc

Member
Hi there,

I need more than eight user defined characters in one LCD screen.
How can that be done using the HD44780U display controller?

What I want to do?
Combine four adjacent (5*7 dots) characters + cursor to one big number. Characters 1 and 2 from lines 1 and 2 will result in one big number.

I thought of following steps:
1) make four user defined characters (1 to 3) for a big 1
2) write those characters on the display
3) make four user defined characters (1 to 3) for a big 2
4) write the new characters in the display, and so on… …

With the above sequence I thought I will end up with a large 12 on the display but:
The first written big number 1 is overwritten by an even big 2 so I end up with 22 instead of 12.

With a delay between the two write sequences I clearly first see a big 1 and then a big 22.
So the display don’t copy the data of the user defined characters into DDRAM but the address of the user defined character.

Thanks for any inputs… …
 
It's a limitation of all those Hitachi based displays. There is only 8 bytes for custom characters. But your description should work as it's only 8 charaters.
 
blueroomelectronics said:
It's a limitation of all those Hitachi based displays. There is only 8 bytes for custom characters. But your description should work as it's only 8 charaters.

You've misunderstood what he's trying to do, he needs TWO defined characters per digit - one for the top half, and one for the bottom half (one complete digit across the two lines).
 
He's only using 4 characters (0-3 not 1-3 as stated) and overwriting then with the 2nd digit.

mcs,
If you write 1 to chars 0-3 and 2 to chars 4-7 then you will be able to display 12 on your display. You will not however be able to display any other digits at the same time. If you only want to count from 00 to 99 then you can do it, otherwise you can't.

Mike.
 
Could you PWM it? Load the 8 charactors, display the first line for a few ms's clear it, load the next 8 charactors then display the lower line and switch back and forth really fast? According to the PDF at 5 volts you can communicate at 2MHZ. With an 8 bit interface you should be able to switch the lines fast enough to get it to work, but it would require the MCU to pay a lot more attention to the display.
 
Thanks for the reactions guys,

Blueroom & Nigel;
I use 4 characters for 1 digit, two on the top line and two on the bottom line. Otherwise the aspect ratio width/height of the digits will be very bad :)

Pommie;
You're wright it's 0 to 7 in the HD44780U but I wrote a LCD library long time ago and I numberd them 1 to 8. In my post I refered to the numbers I use in my library.
I already tried your idea with the 8 user defined characters and indeed it works but I want to write HH:MM:SS on an LCD :(

Sceadwian;
I already tried PWM but I didn't clear the display in between two consecutive writes :(. I'll try that this evening.


Beside this way of working, could anyone think of another way to write to the LCD?
 
You should be able to create and load the custom characters into display ram 'on the fly' as the displayed pixel information is not changed until the print position is overwritten with something else. Try create a custom char, display it, then create another custom char in the same custom location and display that.
 
Gordz said:
You should be able to create and load the custom characters into display ram 'on the fly' as the displayed pixel information is not changed until the print position is overwritten with something else. Try create a custom char, display it, then create another custom char in the same custom location and display that.

hi,
This is exactly way I would tackle the problem, create the special symbols in a table and reload the display in real time.;)
 
Gordz said:
You should be able to create and load the custom characters into display ram 'on the fly' as the displayed pixel information is not changed until the print position is overwritten with something else. Try create a custom char, display it, then create another custom char in the same custom location and display that.

This is not how character based displays work. If you print the character a number of times and then change the definition, the characters on screen will change. The only "display ram" is the ram that contains the character numbers (1 byte per character location), there is no pixel data type ram.

Multiplexing (described as pwm above) the display may work but I think it will be very faint. Changing the contrast may improve things.

Mike.
 
hi,
This is another way you could use just 8 special characters.

Its based on the standard 7 segment display pattern.

You could double the width/height of the special character 'segments' to give a better looking digit.

EDITED: added a pix of the LCD display, special characters on the fly, its a crappy display, due to the physical gaps in the LCD layout.
Had to use a 20 character LCD for this demo.
 
Last edited:
Hi Eric,

I can't implement your solution since I have to treat each sub-character as one item.
You can't say user defined character 0 (udc) is segement a, udc1 is segment b and so on to udc7 is segment h.
In your example is udc1 segments a, c, e (upper left character); udc2 segments b, g, f (upper right character) and so on. That way I need more than 8 udc's for all possible combinations.

Or did I misunderstand your example?

Thanks anyway to help me out on this one :)
 
mcs51mc said:
Hi Eric,

I can't implement your solution since I have to treat each sub-character as one item.
You can't say user defined character 0 (udc) is segement a, udc1 is segment b and so on to udc7 is segment h.
In your example is udc1 segments a, c, e (upper left character); udc2 segments b, g, f (upper right character) and so on. That way I need more than 8 udc's for all possible combinations.

Or did I misunderstand your example?

Thanks anyway to help me out on this one :)

Hi,
The concept is to use the bars as per a standard 7 segment display.
You will have to 'create' the LCDs 5*8 pix block, in real time, for each digit, using the 7 segment idea.

Its messy, but it can be done. I think the simple test, showing the '8's convinced me that it wont look very 'elegant' as a total display.:)

What language do you use for writing programs?
 
hi mcs,

Done some test programs for the 'time' display.

Attached a picture taken from my PIC Sim.

This using a 2 * 16 LCD.

What do you think?
 
Last edited:
It doesn't work.

For the first number (2) you need 4 characters.
For the 3 you need an additional 2 characters - bottom 2.
For the 4 you need 3 more - all of them.

That's nine already and we're not even half way through.

Mike.
 
Pommie said:
It doesn't work.

For the first number (2) you need 4 characters.
For the 3 you need an additional 2 characters - bottom 2.
For the 4 you need 3 more - all of them.

That's nine already and we're not even half way through.

Mike.

Hi Mike,
I am sitting here watching my PIC count up/down, using the segment method.:rolleyes:

As I explained to mcs, he has to change the special characters in real time.
I have defined 0 thru 9 digits, then I load them to the LCD ram location and call them from within the program.

The program is set to refresh/update only the digits that have changed.

Regards
 
Last edited:
Pommie said:
It doesn't work.

For the first number (2) you need 4 characters.
For the 3 you need an additional 2 characters - bottom 2.
For the 4 you need 3 more - all of them.

That's nine already and we're not even half way through.

Mike.

hi Mike,
I have just re-read my earlier post regarding '8 special characters', it is a little ambiguous, it could be read as implying that only 8 symbols could be used to represent all the numbers from 0 thru 9, thats not the case.:)

I have kept advising the OP that it would be necessary to create the symbols within the program in real time.

Although it isn't a brilliant display, it could be used to show a real time clock.

Regards
 
Hi there,

Sorry Eric but I think I don't understand what you mean by:
ericgibbs said:
... it would be necessary to create the symbols within the program in real time...
I think I'm already doing that since I modify the user defined characters (udc) as I need them. Is this what you mean by "in real time"??
Problem is that, like Mike already mentioned, the address of the udc is written at the DDRAM addresses not the data of the udc itself.
So when I change one udc all DDRAM locations using that udc changes at the same time :(:(

I think your PIC simulator doesn't react like a real HD44780U does or I'm still missing something :(:(

I'm using 8051 system en program in assembler.

Attached a screen shot of the "Big Font" I planned to make :)
 

Attachments

  • BigFont.jpg
    BigFont.jpg
    158.2 KB · Views: 218
mcs51mc said:
I looked
I downloaded
Now I will study :)
Thanks a lot...

hi mcs,
Do you understand the Basic language, I know there are many variants, but I will, if you are interested, post my draft copy of the Oshonsoft basic program I have been using for the special characters.

The OS LCD sim does respond in this application as per the HD44780.

If you examine my program, you will see for each digit, before its written to the LCD, the special character pattern
is loaded into DDRAM, it is then called using that special characters address.

I write the digit to its designated location on the LCD.

eg: consider 6 digits, representing the real time of day,
if I want to display the minutes 'tens', the program gets the digit for the time counter,
creates the special char pattern for 4 of the LCD pixel blocks, it then writes these 4 spec chars to location number 5 of the LCD.
Remember when you do it this way, only 4 LCD pixel blocks, require a new spec char, before its written to the display.

When dealing with these LCD's its a good idea to only re-write a digit to the LCD, when that digit has changed from its previous value.
There is no point in refreshing the whole display, if only one digit has changed.

Let me know what you like to do?
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top