Home/Support/Support Forum/Xbee S8 DM, serial interface not working as it should

Xbee S8 DM, serial interface not working as it should

+1 vote

i'm having a strange problem with S8 DigiMesh 868MHz Xbee (XB8-DM, Function set: 865/868LP 80k, Firmware version: 8074, Hardware version: 2442) unit in API2 mode. The problem is with the UART interface. When two units are both connected by XCTU I have a normal connection and everything works as it should. The problem arises when I connect the radio to arduino. First let me point out it's I started with S2Pro 2.4GHz radio and I worked like a charm, so the software and arduino should be fine. But when switching to S8 I get a strange traffic on serial port. I've set up ScanaStudio logic analyzer to see the traffic and send a remote AT command (DB command as I want to get an RSSI reading). The problem is the Xbee doesn't wait for the command to end and immediately sends some data back, which is not in proper API frame. It starts whit 0x7E but the length that follows is incorrect 0xFF 0xF.

So to recap:

- S2 ZigBee 2.4GHz unit -> working as it should
- S8 DigiMesh (same Xbee adapter, same program, same arduino) as S2 unit:
- XB8-DM, Function set: 865/868LP 80k, Firmware version: 8074, Hardware version: 2442
- XCTU to XCTU -> working as it should
- Arduino serial to Xbee -> strange traffic
- XCTU to Xbee(1) -> Xbee(2) to arduino - Xbee(2) not forwarding data on serial port

Arduino is Teensy 3.1 and i'm using an Xbee library for communication with Xbee - https://www.pjrc.com/teensy/td_libs_XBee.html

I tried: - changing adapters
- direct connection
- disable SPI interface, RTS pin
- sleep is set to normal(0) so always awake
and nothing works.

I only got it to work by removing the RX TX wire from arduino, add XBee to XCTU through USB, removing the USB cable reconnecting RX TX wire to arduino, while keeping the power on. In this case it works as it should, so the program and the library should not be the problem. But that is not an option as it stops working when reset.

Any thoughts?

Link to google photos album of ScanaStudio screenshoots: https://goo.gl/photos/7eMHpE3Wnq3Fi4dE9

Regards, Iztok
asked Jan 6, 2016 in RF Solutions and XBee by ISkof New to the Community (5 points)
edited Jan 7, 2016 by ISkof

Please log in or register to answer this question.

1 Answer

+1 vote
Best answer
Sounds like you have an issue with the TX line being held in a state that is causing issues with the radio. Try adding a small pull up resistor on the Tx line and see what happens.
answered Jan 7, 2016 by mvut Veteran of the Digi Community (15,108 points)
selected Jan 14, 2016 by ISkof
What kind of code? Uploading the digimash firmware is not enough?
No, uploading the RF processor firmware is not enough.  There is  a 2nd processor that stands between the UART pins on the XBee and the RF processor. That processor is a FreeScale processor that you must write and upload an application too before you can communicate with this xbee and an external device.
OK, thank you. I read the user guide again and see I missed that part.

It reads:
Module operation for the Programmable variant The modules with the programmable option have a secondary processor with 32k of flash and 2k of random-access memory (RAM). This allows module integrators to put custom code on the XBee module to fit their own unique needs. The DIN, DOUT, RTS, CTS, and RESET lines are intercepted by the secondary processor to allow it to be in control of the data transmitted and received. All other lines are in parallel and can be controlled by either the internal microcontroller or the MC9S08QE micro; see the block diagram under Digi XBee 865/868LP RF Module operation on page 29 for details. The internal microcontroller has control of certain lines by default. The internal microcontroller can release these lines by sending the proper command(s) to disable the desired DIO line(s). For more information, see Digi XBee 865/868LP RF Modules command reference tables on page 77. In order for the secondary processor to sample with ADCs, you must connect the XBee pin 27 (VREF) to a reference voltage. Digi provides a bootloader that can take care of programming the processor over the air or through the serial interface. This means that over the air updates can be supported through an XMODEM protocol. The processor can also be programmed and debugged through a one wire interface BKGD (Pin 9).

But if the internal microcontroller disables the DIO lines (I reckon DIO13 and DIO14 needs to be disabled) doesn't this disable the UART completely?

EDIT: Ok, I see now. I need to disable the FreeScales pins that are connected to the XBee pins. Is this correct?

regards, Iztok
Yes you are correct.  You need to disable the Freescale lines that are connected to the Xbee modules pins.
Ok, now I just need to figure out how to do that :) Thank you for your help, much appreciated.