??? 04/25/04 00:14 Read: times |
#69129 - LCD HD44780 |
I have never written LCD output code before, can someone tell me these functions will work for my HD44780. I am running them on my 8052. It compiles, but I don't understand this whole wait_lcd bussiness, is the wait in the right spot? long enough? Thanks!
void MOVECURSOR(unsigned short int row, unsigned short int col) { P1=row + col; //column can be up to 39, row = 80h RS=0; EN=1; EN=0; WAIT_LCD(); } void LCD_INIT(void)//initialize lcd display { P1=0x38;//8 bit mode 2 lines 5*8 RS=0; RW=0; EN=1; EN=0; WAIT_LCD(); P1=0x0E;//display ON, cursor ON, blink OFF RS=0; RW=0; EN=1; EN=0; WAIT_LCD(); } void WAIT_LCD(void) { short int i=0; i++; while(i<50) { i++; } } //output P1 to screen void LCDWRITECHAR(char Ascii) { P1=Ascii; RS=1; RW=0; EN=1; EN=0; WAIT_LCD(); } void LCD_CLEAR(void) { P1=0x01; RS=0; RW=0; EN=1;//clears lcd EN=0; WAIT_LCD(); } |
Topic | Author | Date |
LCD HD44780 | 01/01/70 00:00 | |
RE: LCD HD44780 | 01/01/70 00:00 | |
RE: LCD HD44780 | 01/01/70 00:00 | |
RE: LCD HD44780 | 01/01/70 00:00 | |
RE: LCD HD44780 | 01/01/70 00:00 | |
RE: LCD HD44780![]() | 01/01/70 00:00 |