i’m testing a pic18f2620 to Tx to a Rx xbee pin. the pic/xbee node is setup with the DH&DL address of the coordinator and both are set to API=1 mode and set at 9600 baud.
however, the coordinator isn’t receiving packets from the pic/xbee node.
with this simple setup, shouldn’t the node be able to send the data as it is received from the pic to the coordinator?
or do i have to prefix pic Tx data with the 3 byte xbee header before the pic Tx’s?
The pic will have to compose valid Tx packets if the XBee is to understand what it’s supposed to do. XBees don’t build packets themselves , you need to supply the packets ready-built.
With API mode enabled, if the XBee sees something that doesn’t constitute a valid packet it will silently discard it. Sounds as though that’s what’s happening here.
 XBees do compose modem status and line state packets. That doesn’t seem to be the issue here, though.
understood about the API mode.
let’s say i switch API mode to ‘0’/off. the pic will still have to compose the valid Tx packet, (header…chksum), yes? i think so, but need to ask.
the only time i see the xbee composing a packet, is when i have a sensor on a DIO pin and have the xbee configured to send at periodic times to a coordinator. at least that is what i believe to be the case.
thanks John, for some reason, a few of these tidbits is just hard for me head to wrap around. appreciate the help and patience.
With API mode off you’ll be operating in transparent mode so whatever is sent will be directly received by the other host. So if you send a Tx packet (after all, in transparent mode you can send anything you like) the other host will receive exactly that Tx packet. Sending a Tx packet in API mode will get you a Tx Status packet at the originating host, and the destination host will see an Rx packet.
You’re right about the I/O line states packet, but don’t forget the modem status packet. That can arrive at any time, so your software needs to be able either to handle it or to ignore it.
i did indeed forget about the modem status packet. i have read your docs and have successfully built the API frames and have the PC accounting for the Rx packet with the data.
the modem status packet are only sent to its host from the xbee only in API mode, yes? and your notes state they cannot be requested so the xbee simply sends them out when a state change occurs.
the modem status packet isn’t sent when in transparent mode though, is that correct?
Glad it helped.
I don’t see how the modem status packet could be sent in transparent mode because there’d be no way to tell that it wasn’t just part of the ordinary data stream. So my assumption is that in transparent mode it would not be sent. I haven’t seen that mentioned in the manual though.