Quote Originally Posted by lerameur View Post
but the LCD is only showing black squares...
That looks like a timing issue or maybe a problem with the LCD contrast. That would be my guess. To check that the timing is correct I would try to blink an LED with let's say a 1 sec on and off interval. For the contrast issue I would use a pot to see if there are any changes. Are you using the same voltage with the PIC16F887 and with the PIC18F4550?

Robert