LCDInfo.com
http://forum.lcdinfo.com/

HD44780, how to program and display user defined characters?
http://forum.lcdinfo.com/viewtopic.php?f=9&t=1699
Page 1 of 1

Author:  washburn_it [ Sat Sep 02, 2006 15:26 ]
Post subject:  HD44780, how to program and display user defined characters?

Hi,
I have a 8x2 LCD display equipped with a HD44780.
Everything is working fine and since there is no functionality to reverse the characters I thought that I could create "user defined font" with all the characters reversed and then "upload" them to the HD44780 everytime my program run, after the initialization.
Actually I need to reverse only characters from "0" to "9" and the " " (space).
Reading the datasheet it seems it's possible but, unfortunately, it's not so clear how to do that.
Then I'm asking the experts how I can do that considering that I'm using the display in 8-bit mode.
Thank you, regards.

Bob

Author:  washburn_it [ Sat Sep 02, 2006 19:20 ]
Post subject: 

I tried the code below to redefine the character 0 but it doesn't work:

LPT= 0x0378

// set the CGRAM at the address 00

portwriteb(LPT, $40);
portwriteb(LPT+2,E_1 or RS_0);
delay(1);
portwriteb(LPT+2,E_0 or RS_0);

// this is the cycle where the character pattern is passed to the
// display 7 times, one for each row of the character matrix.
// At the end character 0 should display 3 vertical lines

for c:=0 to 7 do
begin
portwriteb(LPT, $15); // <-- bit pattern
portwriteb(LPT+2,E_1 or RS_0);
delay(1);
portwriteb(LPT+2,E_0 or RS_0);
delay(1);
end;

Where's the mistake?

Regards,

Bob

Author:  washburn_it [ Mon Sep 11, 2006 15:06 ]
Post subject: 

I found it...I should have put RS=1 instead of RS=0.
I hope it helps other users, regards.

Bob

Page 1 of 1 All times are UTC + 2 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/