[9]?
?
Example?Initialization?Program:?
?
/*****************************************/?
void?Comleft(char?i)?
{?
?P1?=?i;?
?R_W?=?0;?
?D_I?=?0;?
?E1?=?1;?
?delay(2);?
?E1?=?0;?
}?
?
void?Comright(char?i)?
{?
?P1?=?i;?
?R_W?=?0;?
?D_I?=?0;?
?E2?=?1;?
?delay(2);?
?E2?=?0;?
}?
?
void?Writeleft(char?i)?
{?
?P1?=?i;?
?R_W?=?0;?
?D_I?=?1;?
?E1?=?1;?
?delay(2);?
?E1?=?0;?
}?
?
void?Writeright(char?i)?
{?
?P1?=?i;?
?R_W?=?0;?
?D_I?=?1;?
?E2?=?1;?
?delay(2);?
?E2=?0;?
}?
/*****************************************/?
void?bothSides(char?i)?
{?
?Comleft(i);?
?Comright(i);?
}?
/*****************************************/?
?
void?init()?
{?
?P1?=?0;?
?P3?=?0;?
?RST?=?0;?
//?
Reset?RST?
?delay(1);?
?RST?=?1;?
//?
Reset?RST=?M68?Interface?
?delay(10);?
?D_I?=?0;?
?E1?=?1;?
?E2?=?1;?
?R_W?=?1;?
??
?bothSides(0xE2);?
?delay(10);?
?bothSides(0xA4);?
?bothSides(0xA9);?
?bothSides(0xA0);?
?bothSides(0xEE);?
?bothSides(0xC0);?
?bothSides(0xAF);?
}?
/*****************************************/?