Can you post your LcdBusy routine?
Mike.
Sure, here it is, with the definitions
#DEFINE LCD_DATA_PORT PORTB
#DEFINE LCD_DATA_TRIS TRISB
#DEFINE LCD_DATA_MASK_INPUT 0x0F ; 1 to become input (1), 0 for untouched
#DEFINE LCD_DATA_MASK_OUTPUT 0xF0 ; 1 for untouched, 0 to become output (0)
#DEFINE LCD_BUSY_FLAG 3 ; Busy flag is LCD data bit 7, Found on RB3
#DEFINE LCD_CTRL_PORT PORTA
#DEFINE LCD_CTRL_TRIS TRISA
#DEFINE LCD_RS LCD_CTRL_PORT,0
#DEFINE LCD_RW LCD_CTRL_PORT,1
#DEFINE LCD_E LCD_CTRL_PORT,2
LcdBusy
;+
; Step 1 - set data port as input
;-
movlw LCD_DATA_MASK_INPUT ; Set bits used by LCD ...
errorlevel -302 ; Temporarily turn off banking message
BANKSEL LCD_DATA_TRIS ; Select correct Bank
iorwf LCD_DATA_TRIS,f ; ... as input (1)
BANK0
errorlevel +302 ; Turn banking messages back ON
;+
; Step 2 - read lcd data
;-
bcf LCD_RS ; RS = 0 (This is a command)
bsf LCD_RW ; RW = 1 (Read Mode)
LcdBusyCheck ;
bsf LCD_E ; Pulse E...
bcf LCD_E ; ... to latch upper nible data
btfss LCD_DATA_PORT, LCD_BUSY_FLAG ; Check busy flag, high = busy. Busy?
goto LcdBusyNotBusy ; No - Done testing
bsf LCD_E ; Pulse E...
bcf LCD_E ; ... to latch lower nibble data
goto LcdBusyCheck ; and check again
LcdBusyNotBusy
bsf LCD_E ; Pulse E...
bcf LCD_E ; ... to latch lower nibble data
LcdBusyResetPort
;+
; Step 3 - reset data port as output
;-
movlw LCD_DATA_MASK_OUTPUT; Set bits used by LCD ...
errorlevel -302 ; Temporarily turn off banking message
BANKSEL LCD_DATA_TRIS ; Select correct Bank
andwf LCD_DATA_TRIS,f ; ... as output (0)
BANK0
errorlevel +302 ; Turn banking messages back ON
return