Strange RF communication related issues

My project is fairly simple. Two boards, one with three input signals (digital ports 8,9,10), one with three output signals (same ports). Xbees and Sparkfun shields. Once per cycle, I read PINB, send it via serial.print, read it at the other side, and set PORTB to that value. In theory, the 3 bits should simply appear at the far side.

however, the data is corrupted at the receiving side. Each time I execute serial.read(), the output data "blips". at slow speeds (as in the oscope reading attached) it is barely noticable, but at 4000Hz it means the data is only correct about 1/2 the time.

For testing, I tried setting a value to the output of the receiving board when serial data was received, without executing serial.read(), and the blips go away, the data is smooth.

The oscope reading in the attached file is the result of transmitting and receiving a slow count (xmit, add 1, xmit, add 1, etc...). The data errors should be plainly visible.

This is holding up a pretty big project, and I'd appreciate any advice, help, or wisdom that anyone here can offer. I am subscribed, so I will answer any questions quickly.

Thank you for your help and time
Brian Lojeck

bd57600_PulseReceiver.pde (530 Bytes)

bd57600_PulseTransmitter.pde (500 Bytes)

You are sending each value as several ASCII Decimal digits (DEC). The other side receives "0123456789101112131415". You probably want to send the value as a byte (BYTE).

That's far too sensible, that can't be it! :wink:

Thanks. I'll try that when I get in tomorrow morning.

johnwasser, you were dead on, the issue was fixed that morning, and I looked like I knew what I was doing again. :wink:

Many thanks.