Thanks for the help first of all.
I've rewritten the code and connections as per the example in the picbasic pro manual.
Works great on the 16F627A, now to port it over to the 16F88.
I'll post the results when it's done.
'************************************************* ***************
'* Name : LCDTest1.pbp *
'* Author : Greensasquatch *
'* Notice : Copyright (c) 2008 greensasquatch.ca *
'* : All Rights Reserved *
'* Date : 05/09/2008 *
'* Chip : PIC16F627A *
'* Version : 1.1 *
'* Notes : Send Hello World to a LCD on PORTB pins *
'* : blink a LED connected to RB6 as a status light *
'************************************************* ***************
'* PicBasicPro program to demonstrate *
'* operation of an LCD in 4-bit mode. *
'************************************************* ***************
'*
'* Connections are as follows:
'*
'* N/C -01-|####|-18- N/C
'* N/C -02-|####|-17- N/C
'* N/C -03-|####|-16- N/C
'* N/C -04-|####|-15- N/C
'* Gnd -05-|####|-14- V+
'* E on LCD on RB0 -06-|####|-13- RB7, LCD Pin DB7
'* RS on LCD on RB1 -07-|####|-12- RB6, LCD Pin DB6
'* N/C -08-|####|-11- RB5, LCD Pin DB5
'* red LED on RB3 -09-|####|-10- RB4, LCD Pin DB4
'*
'************************************************* ***************
INCLUDE "MODEDEFS.BAS"
@ DEVICE pic16F627A, INTRC_OSC_NOCLKOUT, MCLR_OFF
' Set LCD Data port
DEFINE LCD_DREG PORTB
' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 4
' Set LCD Register Select port
DEFINE LCD_RSREG PORTB
' Set LCD Register Select bit
DEFINE LCD_RSBIT 1
' Set LCD Enable port
DEFINE LCD_EREG PORTB
' Set LCD Enable bit
DEFINE LCD_EBIT 0
' Set LCD bus size (4 or 8 bits)
DEFINE LCD_BITS 4
' Set number of lines on LCD
DEFINE LCD_LINES 2
' Set command delay time in us
DEFINE LCD_COMMANDUS 2000
' Set data delay time in us
DEFINE LCD_DATAUS 50
'LED Connected to PortB.3 to circuit is doing something
LED var PORTB.3
output PORTB.3
CMCON = 7 'Turn off comparators
Pause 2000 ' Wait for LCD to startup
loop: toggle LED
Lcdout $fe, 1 ' Clear LCD screen
Pause 500 ' Wait .5 second
Lcdout "Greensasquatch" ' Display Greensasquatch on 1st line
Pause 500 ' Wait .5 second
toggle LED
Lcdout $fe,$c0,"Hello" ' move cursor to 2nd line, display Hello
Pause 1000 ' Wait 1 second
toggle LED
Lcdout $fe,$c0,"World" ' move cursor to 2nd line, display World
Pause 1000 ' Wait 1 second
toggle LED
Goto loop ' Do it forever
Bookmarks