element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum nRF24L01+ link  to MSP430G2553 launchpad with RF24 library
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 4 replies
  • Answers 1 answer
  • Subscribers 665 subscribers
  • Views 1356 views
  • Users 0 members are here
  • nrf24l01+
  • raspberry_pi
  • raspberrypi
  • ti_launchpad
Related

nRF24L01+ link  to MSP430G2553 launchpad with RF24 library

vish
vish over 10 years ago

Hello all,

 

I'm trying to set up a wireless connection between my raspberry pi and an TI MSP430G2 launchpad. I'm using RF24 library from TMRh20 at my raspberry pi and Enrf24 from spirilis with energia for my launchpad.

 

I want to send some analog data from launchpad to rPi using nRF24. Between rPis, nRF link is working. Aldo between launchpads also it's working. But my rPi is not able to receive the data send from launchpad.

 

Please find below the code I'm using :

In rPi :

#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <RF24/RF24.h>

using namespace std;

// Setup for GPIO 15 CE and CE0 CSN with SPI Speed @ 8Mhz
RF24 radio(RPI_BPLUS_GPIO_J8_15,RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ);


// const uint64_t linkAddress = 0xE7D3F035FF;

int main(int argc, char** argv){

    // Setup and configure rf radio
    radio.begin();
    // set channel
    radio.setChannel( 76 );
    // set datarate
    radio.setDataRate( RF24_1MBPS );
    // optionally, increase the delay between retries & # of retries
    radio.setRetries(15,15);
    
    radio.openWritingPipe( linkAddress );
    radio.openReadingPipe( 1, linkAddress );
    
    // Dump the configuration of the rf unit for debugging
    radio.printDetails();
    
    radio.startListening();
    
    // forever loop
    while (1)
    {
        // if data ready
        if( radio.available() ) {
            unsigned long data = 0;
            // fetch the payload
            while( radio.available() ) {
                radio.read( &data, sizeof(unsigned long) );
            }
            printf( "Recieved data : %lu\n", data );
            delay( 500 );
        }
    }
    
    return 0;
}

 

Once I start this( after starting my lauchpad ), the output is like this

================ SPI Configuration ================
CSN Pin       = CE0 (PI Hardware Driven)
CE Pin       = Custom GPIO22
Clock Speed     = 8 Mhz
================ NRF Configuration ================
STATUS         = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0xe7d3f035ff 0xe7d3f035ff
RX_ADDR_P2-5     = 0xc3 0xc4 0xc5 0xc6
TX_ADDR         = 0xe7d3f035ff
RX_PW_P0-6     = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA         = 0x3f
EN_RXADDR     = 0x02
RF_CH         = 0x4c
RF_SETUP     = 0x07
CONFIG         = 0x0e
DYNPD/FEATURE     = 0x00 0x00
Data Rate     = 1MBPS
Model         = nRF24L01+
CRC Length     = 16 bits
PA Power     = PA_MAX

And the program stays there -- meaning nothing is detected as received.

 

In my launchpad :

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

Enrf24 radio(P2_0, P2_1, P2_2);  // P2.0=CE, P2.1=CSN, P2.2=IRQ
const uint8_t txaddr[] = { 0xE7, 0xD3, 0xF0, 0x35, 0xFF };

const int sensorPin = A4;
int sensorValue = 0;
int dataPacket = 0;

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

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

    radio.begin( 1000000, 76 );  // Defaults 1Mbps, channel 0, max TX power
    
    radio.setTXaddress((void*)txaddr);
  
    // set push button
    pinMode( P1_3, INPUT );
    // set leds
    pinMode( P1_0, OUTPUT );
    // do some startup animation
    for( int i = 0; i < 5; i++ ) {
        digitalWrite( P1_0, HIGH );
        delay( 250 );
        digitalWrite( P1_0, LOW );
        delay( 250 );
    }
    digitalWrite(P1_0, LOW);
}

void loop() {
  
    sensorValue = analogRead( sensorPin );
    dataPacket = map( sensorValue, 0, 1023, 0, 255 );
    
    radio.print( dataPacket );
    radio.flush();  // Force transmit (don't wait for any more data)

    delay(50);
    
}

 

 

Any clue what I'm doing wrong??

 

With thanks,

vish

  • Sign in to reply
  • Cancel
Parents
  • starcruizer
    0 starcruizer over 7 years ago

    Can you please tell me how to make connections between nRF module and my TI board ( i have MSP430FR5994LP)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • fmilburn
    0 fmilburn over 7 years ago in reply to starcruizer

    The library being used above was written for Energia, an Arduino port for some TI parts.  I don’t believe Energia has been ported to the FR5994.  I have ported Energia to other TI microcontrollers in the past and it isn’t too difficult if you start with a similar board that has already been ported. Do a search at 43oh.com on porting Energia and you will find a number of posts on how to go about it.  The author of Energia also monitors that site and it is possible someone has already ported it.   Once Energia is ported you can try using the library by spirilis.   

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • fmilburn
    0 fmilburn over 7 years ago in reply to starcruizer

    The library being used above was written for Energia, an Arduino port for some TI parts.  I don’t believe Energia has been ported to the FR5994.  I have ported Energia to other TI microcontrollers in the past and it isn’t too difficult if you start with a similar board that has already been ported. Do a search at 43oh.com on porting Energia and you will find a number of posts on how to go about it.  The author of Energia also monitors that site and it is possible someone has already ported it.   Once Energia is ported you can try using the library by spirilis.   

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube