Sorry to drag up an old thread but i am struggling to get my head around these registers. I am moving over from using a 16F876A chip and at the moment i cant get the LCD to operate correctly. The characters are displaying but every few cycles they seem to get confused with some noise and random characters appear. Could this be anything to do with having not set the oscillator in the code for my external 4Mhz (I looked for this code but couldn't see any need for it)?

Thanks for any help!


Code:
'BO = LCD INTERFACE'B1 = LCD INTERFACE
'B2 = LCD INTERFACE
'B3 = LCD INTERFACE
'B4 = LCD INTERFACE
'B5 = LCD INTERFACE
'B6 = LCD INTERFACE
'B7 = LCD INTERFACE
'
'C0 = SERVO 1
'C1 = SERVO 2
'C2 = 
'C3 = 
'C4 = 
'C5 =
'C6 =
'C7 =




'***********************************************************************
'****************** DEFINE ADCIN PARAMETERS*****************************
'***********************************************************************
pause 1000




   asm
        __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
        __CONFIG    _CONFIG1H, _FOSC_HSPLL_HS_1H
        __CONFIG    _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
        __CONFIG    _CONFIG3H, _PBADEN_OFF_3H
        __CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L & 0DFh
endasm




DEFINE LCD_DREG PORTB 			'Define PIC port used for LCD Data lines
DEFINE LCD_DBIT 4 			'Define first pin of portb connected to LCD DB4
DEFINE LCD_RSREG PORTB 			'Define PIC port used for RS line of LCD
DEFINE LCD_RSBIT 3 			'Define Portb pin used for RS connection
DEFINE LCD_EREG PORTB 			'Define PIC prot used for E line of LCD
DEFINE LCD_EBIT 0 			'Define PortB pin used for E connection
DEFINE LCD_BITS 4 			'Define the 4 bit communication mode to LCD
DEFINE LCD_LINES 2 			'Define using a 2 line LCD
DEFINE LCD_COMMANDUS 2000 		'Define delay between sending LCD commands
DEFINE LCD_DATAUS 50 			'Define delay time between data sent.




main:
LCDOUT $FE, 1
pause 10
LCDOUT $FE, 2
pause 10
LCDOUT "3 axis track V1"
pause 5000




 goto main




END