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.

LCD User defined Characters

Status
Not open for further replies.

vheerdg

New Member
Hi there plz help I have a topway lmb162a lcd. I tried writting user defined characters to it but the cursor just jumps to the second line and moves one space foward each time. this is what i did.
1. set cgram address - 00h - RS = 0 R/W = 0
2. write cgram - I write the 8 bytes one after eachother to form the charter

Can someone plz help

thanks
 
Hi there plz help I have a topway lmb162a lcd. I tried writting user defined characters to it but the cursor just jumps to the second line and moves one space foward each time. this is what i did.
1. set cgram address - 00h - RS = 0 R/W = 0
2. write cgram - I write the 8 bytes one after eachother to form the charter

Can someone plz help

thanks

hi,:)

Look at this link in the 'Define Characters section' 3.2.3 +

http://home.iae.nl/users/pouweha/lcd/lcd1.shtml#_8051_lcd_busy

also here:
 
Last edited:
CLRSI();
RB4 = 0;
PORTD = 0x40; //set cgram address
LCDPI();
RB4 = 1;
PORTD = 0x0E; //
LCDPI();
PORTD = 0x11; //
LCDPI();
PORTD = 0x0E; //
LCDPI();
PORTD = 0x04; //
LCDPI();
PORTD = 0x1F; //
LCDPI();
PORTD = 0x04; //
LCDPI();
PORTD = 0x0A; //
LCDPI();
PORTD = 0x11; // 8 bytes that makes up character
LCDPI();
PORTD = 0x00; // thats to read it
LCDPI();
 
CLRSI();
RB4 = 0;
PORTD = 0x40; //set cgram address
LCDPI();
RB4 = 1;
PORTD = 0x0E; //
LCDPI();
PORTD = 0x11; //
LCDPI();
PORTD = 0x0E; //
LCDPI();
PORTD = 0x04; //
LCDPI();
PORTD = 0x1F; //
LCDPI();
PORTD = 0x04; //
LCDPI();
PORTD = 0x0A; //
LCDPI();
PORTD = 0x11; // 8 bytes that makes up character
LCDPI();
PORTD = 0x00; // thats to read it
LCDPI();

You expect anyone to make any sense of that??

Mike.
 
You expect anyone to make any sense of that??

Mike.
Edit, this is twice today I posted a reply and it didn't show. Something is broke.
 
Last edited:
Hi there this is my code i went through section 3.2.3 and it is what my code does. I think
after the set cgram address is send the RS is taken high for data mode and the 8 bytes are clock into the lcd as you would normaly write a character.

CLRSI();
RB4 = 0;
PORTD = 0x40; //set cgram address
LCDPI();
RB4 = 1;
PORTD = 0x0E; //
LCDPI();
PORTD = 0x11; //
LCDPI();
PORTD = 0x0E; //
LCDPI();
PORTD = 0x04; //
LCDPI();
PORTD = 0x1F; //
LCDPI();
PORTD = 0x04; //
LCDPI();
PORTD = 0x0A; //
LCDPI();
PORTD = 0x11; // 8 bytes that makes up character
LCDPI();
PORTD = 0x00; // thats to read it
LCDPI();
 
See line 3 of the code thats where i set CGRAM address to zero by sending command
0x40

Sorry bout the code its a mess i know
 
I hope that better

X = 8;
CLRSI(); //Clear lcd function
RB4 = 0; //RS line
PORTD = 0x40; //set cgram address
LCDPI(); // Clock data into lcd
RB4 = 1;
PORTD = 0x0E; //first line of char
LCDPI();
PORTD = 0x11; //3rd line of char
LCDPI();
PORTD = 0x0E; //4th line of char
LCDPI();
PORTD = 0x04; //5th line of char
LCDPI();
PORTD = 0x1F; //6th line of char
LCDPI();
PORTD = 0x04; //7th line of char
LCDPI();
PORTD = 0x0A; //8th line of char
LCDPI();
PORTD = 0x11; // 8 bytes that makes up character
LCDPI();
PORTD = 0x00; / address to read it char
LCDPI();
 
Well, your code is wrong. I have no idea why your code is wrong because you have posted the bit you think is wrong.

If you send command 0x40 and then send 8 data bytes you will define character zero. If you then send command 0x80 and data 0x00 you will get your character in the top corner.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top