Home > other >  1602 LCD screen display
1602 LCD screen display

Time:12-05

Consult everybody microcontroller bosses I'm learning 1602 LCD shows but
why?


# include
# define uchar unsigned char
# define uint unsigned int
Uchar code table1 []="I Love You";
Uchar code table2 []="xiao Ming".
Uchar * str1=table1;
Uchar * str2=table2.

# define LcdDB P0

Sbit LcdEN=P2 ^ 3;
Sbit LcdRW=P2 ^ 1;
Sbit LcdRS=P2 ^ 0;

Void Lcd_Init ();
Void LcdWrCmd uchar (CMD);
Void LcdWrDat uchar (dat);
Void LcdBusy ();
Void Lcd_Show (uchar x, uchar y);


Void main ()
{
Lcd_Init ();


Lcd_Show (2, 0);


While (* str1!='\ 0')
{
LcdWrDat (* str1 + +);
}

Lcd_Show (1, 1);

While (* str2!='\ 0')
{
LcdWrDat (* str2 + +);
}

While (1)
{
;
}

}

Void Lcd_Init ()
{
X38 LcdWrCmd (0);
X0c LcdWrCmd (0);
LcdWrCmd x06 (0);
LcdWrCmd (0 x01);

}

Void LcdWrCmd uchar (CMD)
{
LcdBusy ();
LcdRS=0;
LcdRW=0;
LcdDB=CMD;
LcdEN=1;
LcdEN=0;
}
Void LcdWrDat uchar (dat)
{
LcdBusy ();
LcdRS=1;
LcdRW=0;
LcdDB=dat;
LcdEN=1;
LcdEN=0;
}

Void LcdBusy ()
{
LcdDB=0 XFF;
LcdRS=0;
LcdRW=1;
LcdEN=1;
While (LcdDB& 0 x80);
LcdEN=0;
}

Void Lcd_Show (uchar x, uchar y)
{
Uchar addr.
If (y==0)
{
Addr=0 x00 + x;
}
The else
Addr=0 x40 + x;
LcdWrCmd (addr | 0 x80);

}

CodePudding user response:

Down to see whether where V0 high voltage

CodePudding user response:

The voltage is not pin set ready?
  • Related