'16F877A LCD Demo 23Aug2012
AllDigital
Define SIMULATION_WAITMS_VALUE = 1
Dim cntr1 As Byte
Define LCD_LINES = 2
Define LCD_CHARS = 16
Define LCD_BITS = 4
Define LCD_DREG = PORTB
Define LCD_DBIT = 0
Define LCD_RSREG = PORTB
Define LCD_RSBIT = 6
Define LCD_EREG = PORTB
Define LCD_EBIT = 4
Define LCD_RWREG = PORTB
Define LCD_RWBIT = 5
TRISA = %00000000
TRISB = %00001111
TRISC = %00000000
TRISD = %11110000
TRISE = %00000000
Lcdinit
Lcdout "Ready"
Lcdout 0xff
main:
Lcdcmdout LcdLine2Home
Lcdout #cntr1
cntr1 = cntr1 + 1
'here code for timer
'if counter is reach 20, the timer1 will start but counter is still counting
'when timer is reach 5 second it will stop counting and reset count value to 0
Goto main
End