| ??? 10/22/04 08:11 Read: times |
#79704 - Code in proper format Responding to: ???'s previous message |
Sorry I missed the pre.
/*Initialises LCD by sending appropriate command sequence */
void init_lcd(void)
{
lcd_icmd(0x30);
lcd_icmd(0x30);
lcd_icmd(0x30);
lcd_icmd(0x20);
lcd_cmd(0x28);
lcd_cmd(0x0c);
lcd_cmd(0x06);
lcd_cmd(0x01);
}
/* This function sends commands to lcd*/
void lcd_cmd(uchar lcmd)
{
uchar l2cmd;
l2cmd=lcmd;
lcmd=_cror_(lcmd,2);
lcmd=lcmd | 0xc3;
lcmd=lcmd & 0xfe;
diskeyport = lcmd;
lcdgate=0;
_nop_();
lcmd=lcmd & 0xfd;
diskeyport=lcmd;
_nop_();
lcdgate=1;
l2cmd=_crol_(l2cmd,2);
l2cmd=l2cmd | 0xc3;
l2cmd=l2cmd & 0xfe;
diskeyport = l2cmd;
lcdgate=0;
_nop_();
l2cmd=l2cmd & 0xfd;
diskeyport=l2cmd;
_nop_();
lcdgate=1;
ms_delay(10);
}
/*Function tp send initialisation commands to LCD*/
void lcd_icmd(uchar icmd)
{
ms_delay(200);
icmd=_cror_(icmd,2);
icmd=icmd | 0xc3;
icmd=icmd & 0xfe;
diskeyport = icmd;
lcdgate=0;
_nop_();
icmd=icmd & 0xfd;
diskeyport=icmd;
_nop_();
lcdgate=1;
ms_delay(200);
}
/* This function sends data to lcd*/
void lcd_data(uchar ldata)
{
uchar l2data;
l2data=ldata;
ldata=_cror_(ldata,2);
ldata=ldata | 0xc3;
diskeyport = ldata;
lcdgate=0;
_nop_();
ldata=ldata & 0xfd;
diskeyport=ldata;
_nop_();
lcdgate=1;
l2data=_crol_(l2data,2);
l2data=l2data | 0xc3;
diskeyport = l2data;
lcdgate=0;
_nop_();
l2data=l2data & 0xfd;
diskeyport=l2data;
_nop_();
lcdgate=1;
ms_delay(1);
}
|
| Topic | Author | Date |
| Stuck with LCD problem. | 01/01/70 00:00 | |
| Address setup time | 01/01/70 00:00 | |
| RE: Address setup time | 01/01/70 00:00 | |
| How is it connected? | 01/01/70 00:00 | |
| More Hardware Details. | 01/01/70 00:00 | |
| Probably need code | 01/01/70 00:00 | |
| RE: Probably need code | 01/01/70 00:00 | |
| RE: Probably need code | 01/01/70 00:00 | |
| Problem Solved. | 01/01/70 00:00 | |
| Code in proper format | 01/01/70 00:00 | |
| Floating... | 01/01/70 00:00 | |
| RE: Floating... | 01/01/70 00:00 | |
| LCD in india | 01/01/70 00:00 | |
| RE: LCD in india | 01/01/70 00:00 | |
| RE: LCD in india | 01/01/70 00:00 | |
| RE: LCD in india | 01/01/70 00:00 | |
RE: Stuck with LCD problem. | 01/01/70 00:00 |



