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.

HD44780U LCD not displaying 2nd row

Status
Not open for further replies.

pardner

Newbie level 6
Joined
Jun 22, 2009
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,401
I bought a 16x2 display off ebay six years ago and I am finally getting around to building something with it. As far as I can tell, its a HD44780U display and it appears to have ROM code A00 (reduced character set).

When I first got the display, I tested it quickly and confirmed that it was a 16x2 display. I tied all data lines high and just clocked it by hand. It displayed 32 black squares: 16 on top, 16 on bottom. Now that I finally got it hooked to a MSP430 and can write meaningful characters, I cannot get the second line to display.

When I power up the display I send the following commands :
  1. Clear Display:
    Data: 0x01
  2. Display on/off control
    Data: 0x0C (display on, cursor off, cursor blink off)
  3. Function set
    Data: 0x30 (dat format 8bit, 1 line, 5x8dots)

If I change the Function set to 2 line, the display contrast dims and the second line is still not displayed.

After I do the initialization, I clock 32 characters to the display. 16 characters are displayed on the top line and none are displayed on the bottom.

Is there something special I need to do to display characters on the bottom line?

Thank you for any help.

ps: As I am writting this, I realize I probably should write the Function set first, then clear display, and then turn on display.
 

your observation of

....
If I change the Function set to 2 line, the display contrast dims and the second line is still not displayed.
...

indicate that the display has some problem inside .
 

Assuming you are initializing it correctly, are you taking into account that the HD44780 drives 2 lines of 40 characters but your LCD only displays the first 16 on each line. It means that the character address for the second line starts at address 40 so you have to take into account the jump across the gap in the addresses to overflow the first line into the second.

Brian.
 

hello,

be carrefull with the commande to initialise the line position
with bit D7=1 !


Code:
// LCD GDM 1602 :  2 lignes de 16 cars
// Ligne 1 addresses de 00h  0Fh
// Ligne 2 addresses de 40h  4Fh
// but 
#define LCD_LINE1 0x80      // 0x00 + bit D7=1 
#define LCD_LINE2 0xC0      // 0x40 + bit D7=1 

void LCD_Ligne( Byte NL)
{
	if (NL == 1) NL= 0x08;		// MSB ligne 1
	if (NL == 2) NL =0x0C;		// MSB ligne 2
	LCD_Cmd(NL);
	NL = 0x00;		// LSB
	LCD_Cmd(NL);

}

post all your code ...

nota :
for LCD 1x16 , some are mapped as 1x16 , but some other are maped as 1 x (2x8)
i don't know if we can get same situation with LCD 2x16
 

Assuming you are initializing it correctly, are you taking into account that the HD44780 drives 2 lines of 40 characters but your LCD only displays the first 16 on each line. It means that the character address for the second line starts at address 40 so you have to take into account the jump across the gap in the addresses to overflow the first line into the second.

Brian.
Yes! That worked. I assumed that because I had a 16x2 display, the second line would start at address 32. Writing data at address at 40 starts the second line. Thank you!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top