SOLVED:XBEE 868LP SPI communication with Particle Photon

Hi all,
I have a problem in order to using a communication between 2 Particle Photon via XBEE.
This is my configuration:

Photon1 ----> XBEE_A -------------------------------------> XBEE_B ----> Photon2

XBEE_A is in API mode
XBEE_B is in Transparent Mode.

If I connect XBEE_A via XCTU and I send data to Photon2 this work fine.
If I send data from Photon1 via SPI ports Photon2 doesn’ receive nothing.

I have connected pin of Photon1 like this:

Photon1                   XBEE_A
A2(SS)                      pin 15 (SPI_nSSel)
A3(SCK)                   pin 14 (SPI_Clk)
A4(MISO)                 pin 17 (SPI_MISO)
A5(MOSI)                 pin 16 (SPI_MOSI)

and this is a simple test code in Photon1:

SYSTEM_MODE(MANUAL);

byte sendData;

void setup() 
{
    pinMode(SS,OUTPUT);
    digitalWrite(SS,HIGH);
    Serial.begin(9600);
    SPI.begin(SPI_MODE_MASTER,SS);
    SPI.setClockSpeed(1, MHZ);
    SPI.setBitOrder(MSBFIRST);
    SPI.setDataMode(SPI_MODE0);
    WiFi.off();
}

void loop()
{
    digitalWrite(SS,LOW);
    sendData = 0xFF;
    SPI.transfer(sendData);
    digitalWrite(SS, HIGH);
    Serial.print("\nSend to Photon2=");
    Serial.print(sendData);
    delay(800);
}

Who can help me?
Best Regards,

Michele.

You have SS and CLK swapped around

Hi ScruffR,
thanks for your reply.
I have corrected my post but the connection in my configuration was correct.
What can be?

Best regards,
Michele.

SOLVED!!!
The problem was first 8 byte with MAC address of Photon2.
Thanks in advance,

Michele.

1 Like