Hello, I developed code for a project to work on a PIC 18f452 and have decided to use a PIC 18f252 instead. It works fine on the 452 chip but will not work on the 252 chip. I have the problem narrowed down to the define commands to initialize the LCD. I can comment them out and it works fine except the LCD . The attached code is not my actual project but some test code that I used to narrow the problem down. It runs fine on the 452 chip but when you run it on the 252 chip the watchdog timer times out. The code sends messages to an LCD and turns an LED attached to portb.6 on and off depending on which message is displayed. I have double checked the hardware connections and they are correct. ANY IDEA'S ????

Thanks

Define OSC 20 ' Set Oscillator Freq to 20 MHZ
Define LCD_DREG PORTC 'Set LCD Data Port
Define LCD_DBit 0 'Set Starting data bit (0 or 4) if 4- bit bus
Define LCD_RSREG PORTA 'Set LCD Register Select port
Define LCD_RSBIT 0 'Set LCD Register select bit
Define LCD_EREG PORTB 'Set LCD Enable port
Define LCD_EBIT 0 'Set LCD Enable bit
Define LCD_BITS 4 'Set LCD BUS size (4 or 8 bits)
Define LCD_LINES2 'Set # of lines on LCD
Define LCD_COMMANDUS 2000 'Set command delay time in us
Define LCD_DATAUS 500 'Set Data delay time in us
LCD1 VAR Word ' LCD Counter LSD
LCD2 VAR Word ' LCD Counter MSD
LCDFlag Var Bit
LCDFlag=0
LCD2 = 600 'Counter to switch between LCD Messages

loop: '********************* Program Loop ****************************
LCD1 = LCD1 + 1 ' COUNTER
If LCD1 => 92 Then
LCD2 = LCD2 + 1 'Counter to switch between LCD Messages
LCD1 = 0
endif
If LCD2 > 500 then 'Switch LCD Messages every 500 counts
if LCDFlag = 0 then
Lcdout $fe, $80 ' Move Cursor to 1st line of LCD Display
Lcdout "Msg1 Line1"
Lcdout $fe, $C0 ' Move Cursor to 2nd lind of LCD display
Lcdout "Msg1 Line2"
LCDFlag=1
low 6 'Turn on LED on PORTB.6
LCD2 = 0 'Reset Counter
Else
Lcdout $fe, $80 ' Move Cursor to 1st line of LCD Display
Lcdout "Msg2 Line1"
Lcdout $fe, $C0 ' Move Cursor to 2nd lind of LCD display
Lcdout "Msg2 Line2"
LCDFlag=0
high 6 'Turn off LED on PORTB.6
LCD2 = 0 'Reset Counter
Endif
endif
goto loop