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 !