Somehow the RA.5 randomly stays high since I use RA.5 as pulseout. Even that ADC is disabled, comparator disabled.

Include "bs2defs.bas"
define lcd_dreg portc
define lcd_dbit 0 '0
define lcd_rsreg portc
define lcd_rsbit 4
define lcd_ereg portc
define lcd_ebit 5
define lcd_bits 4
define lcd_lines 2
define lcd_commandus 1500 '1500 2000
define lcd_dataus 44 '44
PAUSE 1000
ADCON1=$0F ' all digital
ANSEL=%00000000

ADCON0 = $00
anselh = %0010 'Convert from Analog input to Digital input.
trisb = %0010 '0=output, 1=input in analog.
anselh = %01000000 'sets portc.6 as input
trisc =%01000000 'sets portc.6 as input
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



Above program works, but when in big program, RA.5 stays high.

in other program, the following list is added

ANSEL=%00100100 'Rev E
TRISA=%00000011 'Rev E
ADCON1 = %1
ADCON0 = %01000101 'Rev E
CM1CON0.7 = 0 'disables comp1
CM2CON0.7 = 0 'disables comp2
SSPCON.5 = 0 'disables MSSP
'ADCON1=$0F

and those line
pulsout porta.5,1000


that way randomly staying high and no longer getting pulsout. strange.