Seems to work as design here using the following
Code:
@ DEVICE PIC16F886, INTOSCIO,WDT_OFF,MCLR_OFF,LVP_OFF,PROTECT_OFF,BOD_OFF,CPD_OFF,IESO_OFF,FCMEN_OFF,PWRT_OFF 'Device line
OSCCON= %01100000
Include "bs2defs.bas"
DEFINE LCD_DREG PORTC 'LCD data port
DEFINE LCD_DBIT 0 'LCD data starting bit 0 or 4
DEFINE LCD_RSREG PORTC 'LCD register select port
DEFINE LCD_RSBIT 4 'LCD register select bit
DEFINE LCD_EREG PORTC 'LCD enable port
DEFINE LCD_EBIT 5 'LCD enable bit
DEFINE LCD_BITS 4 'LCD bus size 4 or 8
DEFINE LCD_LINES 2 'Number lines on LCD
DEFINE LCD_COMMANDUS 2000 'Command delay time in us
DEFINE LCD_DATAUS 50 'Data delay time in us
ANSEL=0
ANSELH=0
ADCON0=0
CM1CON0=0
CM2CON0=0
VRCON = 0
PORTA=0
PORTB=0
PORTC=0
TRISA=0
TRISB=0
TRISC=0
PAUSE 1000
start:
lcdout $FE,1,"TEST THE LCD"
lcdout $FE,$C0," TEST"
PAUSE 1000
high porta.2
pause 500
low porta.2
pause 500
high portb.5
pause 500
low portb.5
lcdout $FE,1,"RESETTING"
pulsout porta.5,1000
pause 1000
pulsout porta.5,1000
pause 1000
goto start
Bookmarks