You can use the DEFINE statements as in the manual. E.g.,
Also, have a look at the LCD_AnyPin thread.' Set LCD Enable port
DEFINE LCD_EREG PORTX
Best Regards,
Paul
You can use the DEFINE statements as in the manual. E.g.,
Also, have a look at the LCD_AnyPin thread.' Set LCD Enable port
DEFINE LCD_EREG PORTX
Best Regards,
Paul
The way to avoid mistakes is to gain experience. The way to gain experience is to make mistakes.
Hi,
The 16F688 has both an ADC and a comparator connected to some of its pins. These peripherals can interfere when trying to use the pin as digital I/O. On some devices these peripherals are disabled by default, on some they are not. On the 16F688 they are NOT disabled so you need to turn them off. How to turn them off also varies across chips but it's quite easy to find in the datasheet. For the the 16F688 you'd do:Then Paul showed you how to remap the pins used by the LCDOUT command. I suggest you do it the standard way with the DEFINE directive as shown in the manual before starting to play with special stuff like the LCD_AnyPin code. If you can't get it to work can you post a schematic of your setup?Code:CMCON = 7 'Disable both comparators ANSEL = 0 ' Set all analog pins to digital
/Henrik.
Thank you Paul and Henrik, for trying to help.
Henrik, I tried the CMCON = 7 command, but it generated a syntax error and wouldnt compile. I searched the web for similar topics, and it was suggested to use CMCON0 = 0, and that compiled without any error. However, the LCD still doesnt work.
In my search, I found this thread http://www.picbasic.co.uk/forum/arch...hp/t-4896.html , which mentions a patch for PBP, which fixes 16F688 register issues. I wonder if thats what I need to do?
Here is my current program, which only produces a line of black boxes on the LCD. The LED does blink, as expected....
CMCON0 = 7 'Disable both comparators
ANSEL = 0 ' Set all analog pins to digital
' Set LCD Enable port
DEFINE LCD_EREG PORTC
' Set LCD Enable bit
DEFINE LCD_EBIT 0
LED VAR PORTC.1 ' Pin-9 on 16F688
Pause 500 ' Wait for LCD to startup
mainloop:
Lcdout $fe, 1 ' Clear LCD screen
Lcdout "Hello" ' Display Hello
high LED
Pause 500 ' Wait .5 second
Lcdout $fe, 1 ' Clear LCD screen
Lcdout "World"
LOW led
Pause 500 ' Wait .5 second
Goto mainloop ' Do it forever
End
Thanks for any other further help or ideas.
Bill
Bookmarks