Home  >  Support  >  Support Forum  >  Why does XBee 868LP SPI not respond when connected to Atmega328P MCU

Why does XBee 868LP SPI not respond when connected to Atmega328P MCU

0 votes
I have connected CLK, MISO, MOSI, CSel and ATTN lines to a standalone Atmel Atmega328P chip, loaded with the Arduino bootloader and running on its internal 8MHz oscillator at Vcc = 3.3V. On the XBee, GND, VCC (also 3.3V) and either [CLK, MISO, MOSI, CSel and ATTN] or [DOUT and DIN] are connected.

The Atmega chip can transmit data ("Hello world") in API mode 1 (non-escaped) via UART to a second XBee which is connected to a PC via USB. When I disconnect the UART lines and connect the SPI lines, the XBee does not transmit anything. Moreover, upon a hard reset of the XBee, no status frame is received on the SPI bus and the ATTN line always remains HIGH. When I send a RF data frame from the PC XBee, it is received in UART mode, but again SPI does not respond and ATTN remains high.

I have checked the outgoing signals from the Atmega MCU. The waveforms are as expected for CLK, MOSI and CSel (3.3V, mode 0, MSB first, leading edge rises).

The MISO line however remains high constantly. I have connected a flash-memory chip using the same SPI interface and it works correctly.

I have tried the following, to no avail:

- connecting the DOUT to ground and resetting the XBee.
- setting the DOUT and DIN to 'disabled' using XCTU.
- setting all disconnected DIO pins to disabled, input, output low and output high.
- disabling the pullup/down resistors on the SPI lines
- SPI communication at different speeds (2, 1, 0.5, 0.25, 0.125, 0.0625 MHz)
- repeating the abovementioned tests with a second XBee module

There is simply no reponse from the XBee in SPI mode. When UART lines are connected, the XBee always works. This suggests that the XBee never enters SPI mode. I have read the 868LP manual, and the following posts:

- http://www.digi.com/support/kbase/kbaseresultdetl?id=3362
- http://www.digi.com/support/forum/38903/spi-configuration-on-xbee-s6

, but they have not helped. I would be grateful if you could provide some advice and perhaps some more detailed information on the SPI implementation on the XBee 868LP. Am I missing some essential step? Do you know of anyone successfully using XBee + Atmega328 with SPI interface? Thank you for your time.
asked Aug 11 in DigiMesh Proprietary Mesh Networking by samartax New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
Try restoring the XBee to defaults. Then enable the SPI ports and disable the UART pins and don't do anything else. Then reset the module with the SPI lines connected. To then receive data from the SPI of the XBee, trigger your SPI ATTN line and feed it 0xFF's. You should then get back a valid API frame. That is if there is any data to be sent out the UART.
answered Aug 26 by mvut Veteran of the Digi Community (2,147 points)
Contact a Digi expert and get started today! CONTACT US
...