I have set up 2 XBEE modules in AT mode, one co-ordinator and one router/end device.
There is data communication between them, however the data in and out just isn’t correct.
I have included a file that shows in the first column what the coordinator is sending, the second column shows the data i am recieving.
Well, that was an interesting little brain-teaser. I think I’ve figured it out.
I wrote a little program to construct the RS-232 bit sequence (start, data, stop) and then to decode it. I was able to reproduce your table if I inverted the data stream (interchanging 1 and 0 throughout). The only exception was that h decodes as 09, not 08 as in the table. Could that be a typo in the table?
So I think some part of your circuitry is performing a signal inversion where it shouldn’t.
Looks like the diagnosis is right then. Sorry, there’s no way to fix that one in software - I reckon you’re going to have to dive into the hardware.
It does occur to me to ask: are you by any chance connecting an XBee directly to an RS-232 port? If so, that would explain the signal inversion because they use opposite polarities. Connecting an XBee to an RS-232 line needs level converters in the circuit if it’s to work properly. If you look at the Digi schematic for an RS-232 development board you’ll see how it’s done.