LCDproc development and user support list

Text archives Help


[lcdproc] HD44780 - 80x1


Chronological Thread 
  • From: ojoa AT gmx.net (Oliver Joa)
  • Subject: [lcdproc] HD44780 - 80x1
  • Date: Thu, 14 Sep 2000 09:23:48 +0200 (CEST)

Hi,

I have a problem with my HD44780-Display. It is a 80x1-Display. I tried to
program it, but there is a Problem. I have used the code of LCDproc to
initialize it. Then I have written a some code (see at bottom of mail) to
put out some digits, but sometimes the Display switches to 2-line-mode
without have send the special code (32 | 8). Then I have put 2
usleep(1) between the port_outs in the senddata-function, and
it worked. The Display does not as often as before switch to the
2-line-mode, but sometimes it does it anyway. Do you have any idea about
this problem? May the Display have a malfunction?

Thank you very much

Oliver






static void HD44780_senddata(unsigned char flags, unsigned char ch)
{
unsigned char h = ch >> 4;
unsigned char l = ch & 15;

port_out(lp, 128 | EN | flags | h); usleep(1); port_out(lp,
128 | flags | h);
port_out(lp, 128 | EN | flags | l); usleep(1); port_out(lp,
128 | flags | l);
}


....
....


// init HD44780
port_out(lp, 128 | EN | 3); usleep(1); port_out(lp, 128 |
3); usleep(5000);
port_out(lp, 128 | EN | 3); usleep(1); port_out(lp, 128 |
3); usleep(150);
port_out(lp, 128 | EN | 3); usleep(1); port_out(lp, 128 | 3);

// now in 8-bit mode... set 4-bit mode
port_out(lp, 128 | EN | 2); usleep(1); port_out(lp, 128 | 2);
// now in 4-bit mode... set 1 line, small char mode
HD44780_senddata(0, 32);

//clear
HD44780_senddata(0, 1);
// set lcd on (4), cursor_on (2), and cursor_blink(1)
HD44780_senddata(0, 8 | 4 | 0 | 0);

for (j=0; j<20;j++)
{
for (i=0; i<79;i++)
{
// position
val=i;
HD44780_senddata(0,128 | i);

// draw
HD44780_senddata(RS,(i % 10)+65+j);
}
}

....


--
ojoa AT gedif.de
*
ojoa AT gmx.net
*
ojoa AT yahoo.com
*
o.joa AT web.de




-----------------------------------------------------------
To unsubscribe from this list send a blank message to
lcdproc-unsubscribe AT lists.omnipotent.net



  • [lcdproc] HD44780 - 80x1, Oliver Joa, 09/14/2000

Archive powered by MHonArc 2.6.18.

Top of page