Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to display custom character in lcd 16x2

Status
Not open for further replies.

vikrant

Junior Member level 2
Joined
Jun 30, 2006
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,425
16x2 lcd custom characters

hi friends,

I have interfaced hitachi HD44780 lcd (16x2) with AT89s52. I want to display custom character or user defined character ex. ARROW, BOX,SMILEY.
Can any body give me the code for that or atleast give me the correct algorithm or seudo code.

this code i m using but it is not working

void lcd_DefineChar (int charnum, unsigned char values[])
{
unsigned char set_address;
int i;
if ((charnum >= 0) || (charnum <= 7))
{
set_address = (0x40 + charnum*8); // set LCD address to CG RAM

for (i=0; i<8; i++) // enter character bytes into CG RAM
{
SetCGRAM(set_address + i);
lcdDisplayCharacter(values);
printf(" \n %x ", values);
}
}
}
 

cgram address lcd

Did you actually write the patterns to the 64-byte CG RAM?

Have a look at this page:
http://www.geocities.com/dinceraydin/lcd/custom.htm

Your should use the following logic for the IF structure:
Code:
((charnum >= 0) && (charnum <= 7))

Otherwise, every character code would be valid, and you would go beyond the address range of the CG RAM.

Cheers,
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top