I’ve been using XBee Pro 892.15 modules in several products, driven by an 8051 variant running Keil C51. Good success accessing the AT command set, and very satisfied with performance.
A new project uses a Microchip PIC18F87J72 processor, running with Microchip’s MCC18 compiler. My first problem was that their printf() function is broken - so I wrote workaround code doing puts emulations. The code seems to work fine, according to my serial output buffer.
Now, for the issue - as a modem, the XBee module works perfectly. I receive and transmit data flawlessly. When I want to enter AT command mode, things go bad rapidly.
I ported the working code from the 8051 project to Microchip C18, and things are happening that I can’t attribute to the code. I’ve got the baud rate set to 38,400, and it is accurate. Guard times are set to values that seem to work for this application.
On startup, I go into AT command mode and look for “OK” to verify the module is installed and working, then send ATCN to get back to modem mode.
When I send the “+++” string after the guard time expires, and then wait another guard time, the modem transmits “++” and then the closing ATCN command to my receiving module. If I instead send “+++X” with any ASCII character appended as the ‘X’, it goes into command mode and responds with “OK”. The serial output buffer shows the sent characters in either case, and they are correct.
Sending a request for data returns an “OK”, but no data field. This is reliable.
The modules have version 10E6 firmware. The module is never put to sleep in this application.
It’s maddening that everything works fine in one product, but not here.