info:lcd_4_bit_interfacing
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
info:lcd_4_bit_interfacing [2011/01/15 09:13] – tomgee | info:lcd_4_bit_interfacing [2011/01/16 11:29] (current) – tomgee | ||
---|---|---|---|
Line 22: | Line 22: | ||
The steps are: | The steps are: | ||
- | | + | |
2. Send to the LCD port | 2. Send to the LCD port | ||
- | | + | |
- | | + | |
5. Send to LCD port | 5. Send to LCD port | ||
- | | + | |
==== C code to perform the above ==== | ==== C code to perform the above ==== | ||
Line 71: | Line 71: | ||
lcd_cmd(0x06); | lcd_cmd(0x06); | ||
lcd_cmd(0x80); | lcd_cmd(0x80); | ||
+ | } | ||
+ | |||
+ | ==== Sending Command/ | ||
+ | |||
+ | void lcd_cmd (char cmd) | ||
+ | { | ||
+ | lcd_port = ((cmd >> 4) & 0x0F)|LCD_EN; | ||
+ | lcd_port = ((cmd >> 4) & 0x0F); | ||
+ | |||
+ | lcd_port = (cmd & 0x0F)|LCD_EN; | ||
+ | lcd_port = (cmd & 0x0F); | ||
+ | |||
+ | delayus(200); | ||
+ | delayus(200); | ||
+ | } | ||
+ | |||
+ | void lcd_data (unsigned char dat) | ||
+ | { | ||
+ | lcd_port = (((dat >> 4) & 0x0F)|LCD_EN|LCD_RS); | ||
+ | lcd_port = (((dat >> 4) & 0x0F)|LCD_RS); | ||
+ | |||
+ | lcd_port = ((dat & 0x0F)|LCD_EN|LCD_RS); | ||
+ | lcd_port = ((dat & 0x0F)|LCD_RS); | ||
+ | |||
+ | delayus(200); | ||
+ | delayus(200); | ||
} | } |
info/lcd_4_bit_interfacing.1295100791.txt.gz · Last modified: 2011/01/15 09:13 by tomgee