This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/MSP-EXP430FR2355: MSP430FR2355 problem to connect with nRF24L01+ (ENERGIA)

Part Number: MSP-EXP430FR2355
Other Parts Discussed in Thread: ENERGIA, MSP430FR2433, MSP430FR2355

Tool/software: TI C/C++ Compiler

Hi,

I recently bought a MSP-EXP430FR2355 launch pad to build a Weather station with NRF24L01+ so i have used a specific library Enrf24.h for ENERGIA.
The code for below already works with my MSP-EXP430FR2433 but not with my new MSP-EXP430FR2355.

I can't use the MSP430FR2433 beacause it doesn't have enough memory for me to add my temperature sensor BME280 with all code required by the sensor...
On the other side i can receive the information ON and OFF with a Raspberry Pi send by the FR2433 but not with my FR2355.

#include <SPI.h>
#include <Enrf24.h>
#include <nRF24L01.h>
#include <string.h>

//Enrf24 radio(P1_7, P2_2, P3_2);  //WIRING MSP430FR2433 P1.7=CE, P2.2=CSN, P3.2=IRQ -> MOSI P2.6, MISO P2.5, SCK P2.4

Enrf24 radio(P5_4, P5_0, P5_1);  //WIRING MSP430FR2355 P2.0=CE, P2.1=CSN, P2.2=IRQ -> MOSI P1.6, MISO P1.7, SCK P1.5

const uint8_t txaddr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 };

const char *str_on = "ON65";
const char *str_off = "OFF65";

void setup() {
  Serial.begin(9600);
  Serial.println("RED10");
  
  SPI.begin();
  SPI.setDataMode(SPI_MODE0);
  SPI.setBitOrder(1); // MSB-first

  radio.begin( 1000000, 76 );   
  radio.setCRC( 1, 1 );  
  //radio.begin();  // Defaults 1Mbps, channel 0, max TX power
  radio.setSpeed(250000);
  
  radio.setTXaddress((void*)txaddr);
 // Serial.println("RED10");

  Serial.print("STATE: ");
  Serial.println(radio.radioState());

  Serial.print("SPEED: ");
  Serial.println(radio.getSpeed());
}

void loop() {

  Serial.println("ON_1");
  radio.print(str_on);
  radio.flush();  // Force transmit (don't wait for any more data)
  
  delay(1000);
  Serial.println("OFF_1");
  radio.print(str_off);
  radio.flush();  //
  
  delay(1000);
  //Serial.println("GREEN");
}

With the MSP430FR2433 STATE: 1 and SPEED: 250000 which is logic

With the MSP430FR2355 STATE: 0 and SPEED: 1000000


The code stops when we entrer the loop and display only ON_1 and stops, i thinks it's the SPI but it can be the library itself

Thanks for your help !

  • Hi Maxime,

    I think the difference between the FR2433 and FR2355 is SPI pins and USCI-SPI module configuration.  Please look into the SPI configuration code to make sure the SPI communication is correct.

  • Hi,

    I have try to activate USCI-SPI mode only but i think this option is not avaible for MSP430FR2355 in ENERGIA, so have you got any solution for me ?

  • Could you capture the SPI communication signal using oscilloscope and see why it stops?
  • I have change CSN CE and IRQ and the code don't stop at ON_1 but it don't send any message !

    #include <SPI.h>
    #include <Enrf24.h>
    #include <nRF24L01.h>
    #include <string.h>
    
    Enrf24 radio(P1_3, P1_4, P2_2);  //WIRING MSP430FR2355 P1_3=CE, P1_4=CSN, P2_2=IRQ -> MOSI P1.6, MISO P1.7, SCK P1.5
    
    const uint8_t txaddr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 };
    
    const char *str_on = "ON65";
    const char *str_off = "OFF65";
    
    void setup() {
      Serial.begin(9600);
      Serial.println("RED10");
      
      SPI.begin();
      SPI.setDataMode(SPI_MODE0);
      SPI.setBitOrder(1); // MSB-first
    
      radio.begin( 1000000, 76 );   
      radio.setCRC( 1, 1 );  
      //radio.begin();  // Defaults 1Mbps, channel 0, max TX power
      radio.setSpeed(250000);
      
      radio.setTXaddress((void*)txaddr);
     // Serial.println("RED10");
    
      Serial.print("STATE: ");
      Serial.println(radio.radioState());
    
      Serial.print("SPEED: ");
      Serial.println(radio.getSpeed());
    }
    
    void loop() {
    
      Serial.println("ON_1");
      radio.print(str_on);
      radio.flush();  // Force transmit (don't wait for any more data)
      
      delay(1000);
      Serial.println("OFF_1");
      radio.print(str_off);
      radio.flush();  //
      
      delay(1000);
    }

  • Is the Serial.println using UART interface? Which EUSCI-UART moulde? Could you make sure the UART communication is correct using UART basic code example.
  • Yes i think serial.println is in conflict with SPI, how to choose which module is used by USCI to separate UART module from SPI with energia ?

  • Energia is a third party tool. I'm not familiar with it. You can seek for help in energia forum 43oh.com.
  • There issomething wrong with SPI. The pins and registers are setup wrong in the SPI library due to incorrect pins in the MSP430FR2355 pins_energia.h header file.

    Please copy the attached pins_energia.h to the MSP-EXP430FR2355LP variants directory.

    • Windows: <Energia dir>\hardware\energia\msp430\variants\MSP-EXP430FR2355LP
    • Linux: <Energia dir>/hardware/energia/msp430/variants/MSP-EXP430FR2355LP
    • macOS: Energia.app/Contents/Java/hardware/energia/msp430/variants/MSP-EXP430FR2355LP

    Download the new pin_energia here : https://forum.43oh.com/applications/core/interface/file/attachment.php?id=10212

**Attention** This is a public forum