Have been trying on both a 16F627A and now a 16F84A'
The first code below works, but when I switch the R/S pin from PortA.2 to Port B.2, I get a blank LCD screen. I can't see what I'm doing wrong. Can anyone help?

LCD Display
' ================
'
'
' The connection between the LCD display and the microcontroller is as follows:
'
' Display Microcontroller pin
' DB4 RB4
' DB5 RB5
' DB6 RB6
' DB7 RB7
' E RB3
' RS RA2
'
' Compiler: PicBasic Pro
'
' Modifications
' ==========
'
'************************************************* *******************************************

' DEFINITIONS
define LCD_DREG PORTB
define LCD_DBIT 4
define RSREG PORTA
define LCD_RSBIT 2
define LCD_EREG PORTB
define LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50

TRISA = 0 ' Register A pins are outputs
TRISB = 0 ' Register B pins are outputs


PAUSE 500 ' Wait 0.5sec for LCD to initialize

OPTION_REG = $80

LCDOUT $FE, 1 ' Clear LCD
LCDOUT $FE, $C0
LCDOUt "ClockWorks"
'

END




The following does not work:
' LCD Display
' ================
'
'
' The connection between the LCD display and the microcontroller is as follows:
'
' Display Microcontroller pin
' DB4 RB4
' DB5 RB5
' DB6 RB6
' DB7 RB7
' E RB3
' RS RB2
'
' Compiler: PicBasic Pro
'
' Modifications
' ==========
'
'************************************************* *******************************************

' DEFINITIONS
define LCD_DREG PORTB
define LCD_DBIT 4
define RSREG PORTB
define LCD_RSBIT 2
define LCD_EREG PORTB
define LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50

TRISA = 0 ' Register A pins are outputs
TRISB = 0 ' Register B pins are outputs


PAUSE 500 ' Wait 0.5sec for LCD to initialize

OPTION_REG = $80

LCDOUT $FE, 1 ' Clear LCD
LCDOUT $FE, $C0
LCDOUt "ClockNot"


END