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.

MSP430G2553: Interfacing with Nordic nRF24l01 Transceivers

Part Number: MSP430G2553

For weeks now, I have been trying to interface my MSP430G2553's with nRF24l01 transceivers. I followed the instructions of this forum exactly:

forum.43oh.com/.../

Unfortunately, I was not able to sign up for that forum (website issue) to ask questions, so here I am. The sample code given for the receiver seems to be working alright. I was able to measure the pin voltages and monitor the current draw of the receiver. However, the transmitter doesn't seem to be working as expected. The CE pin will not go high. Even if I force it high, the transmitter will not draw any current. Here's the code:

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


Enrf24 radio(P2_0, P2_1, P2_2);  // P2.0=CE, P2.1=CSN, P2.2=IRQ
const uint8_t txaddr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 };

const char *str_on = "ON";
const char *str_off = "OFF";

void dump_radio_status_to_serialport(uint8_t);

void setup() {
  Serial.begin(9600);

  SPI.begin();
  SPI.setDataMode(SPI_MODE0);
  SPI.setBitOrder(MSBFIRST);

  radio.begin();  // Defaults 1Mbps, channel 0, max TX power
  dump_radio_status_to_serialport(radio.radioState());

  radio.setTXaddress((void*)txaddr);

//MY ADDITION TO THE CODE (FLASHING LED). THIS ENSURES THE MICROCONTROLLER IS READY/ACTIVE.
   pinMode(P1_0, OUTPUT);
   digitalWrite(P1_0, LOW);
   int x=0;
   volatile int state = HIGH;
   volatile int flag = HIGH;
  digitalWrite(P1_0, state);
  while(x<15)
  {
  digitalWrite(P1_0, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a 1/10th second
  digitalWrite(P1_0, LOW);    // turn the LED off by making the voltage LOW
  delay(100);               // wait for 1/10th second
  x=x+1;
  }

//END FLASHING LED


}


void loop() {
  Serial.print("Sending packet: ");
  Serial.println(str_on);
  radio.print(str_on);
  radio.flush();  // Force transmit (don't wait for any more data)
  dump_radio_status_to_serialport(radio.radioState());  // Should report IDLE
  delay(1000);

  Serial.print("Sending packet: ");
  Serial.println(str_off);
  radio.print(str_off);
  radio.flush();  //
  dump_radio_status_to_serialport(radio.radioState());  // Should report IDLE
  delay(1000);
}

void dump_radio_status_to_serialport(uint8_t status)
{
  Serial.print("Enrf24 radio transceiver status: ");
  switch (status) {
    case ENRF24_STATE_NOTPRESENT:
      Serial.println("NO TRANSCEIVER PRESENT");
      break;

    case ENRF24_STATE_DEEPSLEEP:
      Serial.println("DEEP SLEEP <1uA power consumption");
      break;

    case ENRF24_STATE_IDLE:
      Serial.println("IDLE module powered up w/ oscillators running");
      break;

    case ENRF24_STATE_PTX:
      Serial.println("Actively Transmitting");
      break;

    case ENRF24_STATE_PRX:
      Serial.println("Receive Mode");
      break;

    default:
      Serial.println("UNKNOWN STATUS CODE");
  }
}

Other symptoms vary depending on if the IC is on the launchpad or standalone. On the launchpad, the CE and MISO pin remain at about half supply voltage. Standalone, they remain low. The most significant observation (only happens for standalone) is that the MOSI pin stays at 3.3V as expected, but pulses toward 0V every second or so repeatedly. During this short pulse duration, the transceiver tries to draw some current, but then shuts off immediately. The CE pin remains low for the most part. However, I was able to get a measurable voltage (in the mV range) during this odd pulse time.

Hardware setup remains the same between receiver and transmitter. If you want to see the working receiver code for comparison, I can post it as well. Any help here would be greatly appreciated.

  • Sorry to hear about your troubles signing up for the 43oh forum, unfortunately I do not have any experience with nRF24L01 transceivers. Have you tried any of these other resources?

    github.com/.../msprf24
    e2e.ti.com/.../146220
    e2e.ti.com/.../435887
    forum.43oh.com/.../
    http://www.kaltpost.de/?p=994

    Make sure to disconnect the MSP-EXP430G2 P1.0 and P1.6 LED jumpers if you are using those pins for communication. Also keep in mind that P1.1 and P1.2 are connected to the ez430's should be removed as well if the backchannel UART is not needed. Use a multimeter to ensure that all devices are powered properly and that there is continuity between all connections. Also provide oscilloscope or logic analyzer screenshots of the SPI communication lines.

    Regards,
    Ryan
  • Ryan Brown1 said:

    Also keep in mind that P1.1 and P1.2 are connected to the ez430's should be removed as well if the backchannel UART is not needed.


    Could you please clarify this? I did notice that P1.1 and P1.2 are at VCC when connected to the USB port but have no idea why. Up until now, I have been ignoring this for the standalone, which seems to be working properly with other coding. Being completely new to all this, I do not know the meaning of the term "ez430's".

  • You should be able to access 43oh.com now.  It was apparently down over part of the weekend due to a software issue but is now operational. Just out of curiosity I typed nRF24l01 into the search window and it returned 274 results, so you may find the answers you are looking for.  If not, please feel free to post a question.

  • The ez430 is the on-board FET tool that connects to the target device through the J3 header row, it is the top fourth of the board and is marked as "EMULATION". It includes a backchannel UART system so that you can communicate with your host PC but requires access to the RXD/TXD lines on P1.1/P1.2. If you intend to use P1.1/P1.2 externally (for nRF24L01 purposes) then the RXD/TXD jumpers must be removed.

    Regards,
    Ryan

**Attention** This is a public forum