Here's one way if you have a 16F1827 http://www.picbasic.co.uk/forum/show...4227#post84227

And another way http://www.rentron.com/Micro-Bot/IR_Serial.htm with any PIC with hardware PWM.