After defining the lcd you must place a pause of about 500 msec.
This is nessesary to give the lcd a chanche to setup and set all registers insite ok, before receiving de lcd data for the screen.