Without even looking into code flow, your delays are probably wrong. LCDs are quite slow devices and especially during initialization it is very important they have long enough to digest the bytes you feed them. A simple count down of 200 or 300 to zero is likely to take far shorter than the several mS delays needed. In particular, note how long the LCD needs from powering up to being ready for the start of initializing data, most need around 100mS. It looks like you are using a PIC although you haven't said which type, your present 'delay(200)' probably only lasts around 200uS when you really need several mS.