I'll also suggest you to follow Dave's post
http://www.picbasic.co.uk/forum/show...79&postcount=9

If the transmitter output signal is a bit messy, you will need to 'shape it'. Probably the internal comparator could be used here..