Do not use high ?. Use PORT?.? instead, works much better.
Here is some code to look at. My LCD is on PORT B so the pins are different than yours but you can get the idea.
Code:
'#####################
'16F877A
DEFINE OSC 20
'####################
'LCD SET UP
DEFINE LCD_DREG PORTB
define LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 0
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
'#####################
V1 VAR BYTE
LED VAR PORTD.2
PAUSE 1000
RUN:
LCDOUT $FE,1,"POT"
LCDOUT $FE,$C0,DEC V1
PAUSE 100
POT PORTC.7,127,V1
IF V1 < 100 THEN
GOTO LMP1
ELSE
GOTO LMP2
ENDIF
GOTO RUN
LMP1:
HIGH LED
GOTO RUN
LMP2:
LOW LED
GOTO RUN
END
Bookmarks