Hi,

I took a look at what you are doing and I have a thought. (Keep in mind I'm still kind of a newbie, but hey, sometimes a second pair of eyes can help If I'm totally off, I'm sorry - just trying to help.

In your lines-

loop2:
pulsin portb.0,1,rcin
rcin2=((rcin-536)*10)/17

Being that you have a word variable for rcin, the result is going to be a 16 bit number (between 0-1024,) but the math seems to need a number greater than 536 or it is going to have some trouble going negative won't it? When your transmitter is on, it is probably OK, but when it is off, wouldn't it read close to zero and end up negative?

I was under the impression that would cause some difficulty. Maybe a test right there would do the trick.

Good luck,

Chris