How to create a 38 Khz pulse with arduino using timer or PWM?

praky:
I want to create a square wave of 38 KHz to be fed to an IR led.

Are you absolutely determined to do this in software? If not, have you considered doing it with a 555 timer?