You are on page 1of 7

Interfacing to LCD

surya abadi (2009 042 054) marcellus pekik (2007 042 0xx)

LCD module
Liquid Crystal Display Backlight & liquid crystal Billing machine, telepon umum, timbangan digital, kalkulator, dll low power dissipation, high readability, flexibility for programmers

Block Diagram LCD

DB0DB7 RS R/W E VDD VSS VLC CONTROLLER

COMMON SIGNAL SEGMENT SIGNAL

LCD

SERIAL DATA

SEGMENT DRIVER

TIMMING DATA

Antarmuka dengan port paralel

Pin No 1 2 3 4 5 6 7 to 14 15 16

Symbol GND Vcc Vo RS R/W E D0 to D7 VB1 VB0

Details Ground Supply Voltage +5V Contrast adjustment 0->Control input, Read/ Write Enable Data Backlight +5V Backlight ground 1-> Data input

address
#include <dos.h> #include <string.h> #include <conio.h> #include <time.h> #define PORTADDRESS 0x378 /* Enter Your Port Address Here */ #define DATA PORTADDRESS+0 #define STATUS PORTADDRESS+1 #define CONTROL PORTADDRESS+2 void lcd_init(void); void lcd_write(char char2write); void lcd_putch(char char2write); void lcd_puts(char * str2write); void lcd_goto(int row, int column); void lcd_clear(void); void lcd_home(void); void lcd_cursor(int cursor); void lcd_entry_mode(int mode);

Aplikasi
void main(void) { struct time t; struct date d; char strtime[17]; textbackground(0); clrscr(); textcolor(0); textbackground(10); gotoxy(8,5); cputs(" "); gotoxy(8,4); cputs(" "); lcd_init(); lcd_cursor(0);

while(!kbhit()) { gettime(&t); getdate(&d); lcd_goto(0,4); sprintf(strtime,"%02d:%02d:% 02d", t.ti_hour%12, t.ti_min, t.ti_sec); lcd_puts(strtime); gotoxy(12,4); cputs(strtime); lcd_goto(1,3); sprintf(strtime,"%02d:%02d:% 4d", d.da_day, d.da_mon, d.da_year); lcd_puts(strtime); gotoxy(11,5); cputs(strtime); delay(200); } textbackground(0); textcolor(7); }

You might also like