发表于:2012/3/11 21:28:40
#0楼
第一段:
void Dat(unsigned char d)
{
R_W=1;
D_I=0;
Loop:
P1=0xFF;
E=1;
q=P1;
E=0;
if(q&0x80)
{
goto Loop;
}
D_I=1;
R_W=0;
P1=d;
E=1;
E=0;
}
第二段:
bit lcd_busy()
{
bit result;
LCD_RS = 0;
LCD_RW = 1;
LCD_EN = 1;
_nop_();
_nop_();
_nop_();
_nop_();
result = (bit)(P0&0x80);
LCD_EN = 0;
return result;
}
void Dat(unsigned char d)
{
R_W=1;
D_I=0;
Loop:
P1=0xFF;
E=1;
q=P1;
E=0;
if(q&0x80)
{
goto Loop;
}
D_I=1;
R_W=0;
P1=d;
E=1;
E=0;
}
第二段:
bit lcd_busy()
{
bit result;
LCD_RS = 0;
LCD_RW = 1;
LCD_EN = 1;
_nop_();
_nop_();
_nop_();
_nop_();
result = (bit)(P0&0x80);
LCD_EN = 0;
return result;
}