I get a compiler problem if I try to use a LCD with a 16F887.
I get this error
lcd.h (291): Error: SYSLCDTEMP is not a valid I/O pin or port
If I look at the ASM file it does indeed contain SYSLCDTEMP (see below)
LCDNORMALWRITEBYTE clrf TRISSYSLCDTEMP movf LCDBYTE,W movwf SYSLCDTEMP
If I replace these lines (in the ASM file) with the ones below it works ok.
LCDNORMALWRITEBYTE banksel TRISB clrf TRISB banksel LCDBYTE movf LCDBYTE,W movwf PORTB
The following is the GCBasic code I used to produce the error
#chip 16F887,4 #config OSC=INTRC_OSC_NOCLKOUT,MCLRE=OFF,WDT=OFF #define LCD_IO 8 #define LCD_DATA_PORT_B #define LCD_RS PORTD.6 #DEFINE LCD_NO_RW #define LCD_Enable PORTD.7 jj=0 dim jj as word start: wait 1 sec cls jj=readad10(an7) locate 0,0 lcdword jj goto start
Oh no I've just realized I have made an error its should be LCD_DATA_PORT PORTB
Now it works - was not a helpful error message though.
Log in to post a comment.
I get a compiler problem if I try to use a LCD with a 16F887.
I get this error
lcd.h (291): Error: SYSLCDTEMP is not a valid I/O pin or port
If I look at the ASM file it does indeed contain SYSLCDTEMP (see below)
LCDNORMALWRITEBYTE
clrf TRISSYSLCDTEMP
movf LCDBYTE,W
movwf SYSLCDTEMP
If I replace these lines (in the ASM file) with the ones below it works ok.
LCDNORMALWRITEBYTE
banksel TRISB
clrf TRISB
banksel LCDBYTE
movf LCDBYTE,W
movwf PORTB
The following is the GCBasic code I used to produce the error
#chip 16F887,4
#config OSC=INTRC_OSC_NOCLKOUT,MCLRE=OFF,WDT=OFF
#define LCD_IO 8
#define LCD_DATA_PORT_B
#define LCD_RS PORTD.6
#DEFINE LCD_NO_RW
#define LCD_Enable PORTD.7
jj=0
dim jj as word
start:
wait 1 sec
cls
jj=readad10(an7)
locate 0,0
lcdword jj
goto start
Oh no I've just realized I have made an error its should be
LCD_DATA_PORT PORTB
Now it works - was not a helpful error message though.