IF the DEFINE OSCCAL break the serial comm and almost everything, it's a good sign your device programmer screwed the internal calibration, that's for sure. If you have a PICKIT2, you can recover it in few seconds with the OSCCAL Auto regenerate utility.
Acetronics also posted something here.
Lost your OSCCAL Value ???
http://www.picbasic.co.uk/forum/showthread.php?t=7588&
One thing is sure, you're using a BitBanging Serial communication, you may miss some bytes here and there. Using a Hardware USART provide a 2 bytes buffer and Interrupt capability... which are handy.
For a simple test, remove the relay check and keep only the serial part, without timeout. See if it works better.
Last edited by mister_e; - 28th May 2008 at 14:32.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks