program PIC16F887_LCD_003
dim LCD_RS as sbit at RC4_bit
LCD_EN as sbit at RC5_bit
LCD_D4 as sbit at RC0_bit
LCD_D5 as sbit at RC1_bit
LCD_D6 as sbit at RC2_bit
LCD_D7 as sbit at RC3_bit
LCD_RS_Direction as sbit at TRISC4_bit
LCD_EN_Direction as sbit at TRISC5_bit
LCD_D4_Direction as sbit at TRISC0_bit
LCD_D5_Direction as sbit at TRISC1_bit
LCD_D6_Direction as sbit at TRISC2_bit
LCD_D7_Direction as sbit at TRISC3_bit
dim counter as word
dim counter_txt as string[5]
main:
PORTC = 0xFF
TRISC = 0x00
ANSELC = 0x00
OSCCON = %01110010
Lcd_Init() Lcd_Cmd(_LCD_CLEAR) Lcd_Cmd(_LCD_CURSOR_OFF) counter = 0
while TRUE counter = counter + 1
WordToStr(counter, counter_txt)
Lcd_Out(1,6,counter_txt)
delay_ms(100)
wend
end.