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)
