This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

want nrf24l01 communication with nrf51822

hello,will you please tell me which code i have to use in the sdk 12.2.0 for rf communication with nrf51822 and nrf24l01 .and also tell me which settings i have to do for nrf24l01 side as a transmitter.so that i can receive data on nrf51822 side.

Parents
  • Hi Pallavi

    The ESB library in the nRF5 SDK v12.2.0 is designed to be backwards compatible with the nRF24L01/nRF24L01+, assuming you don't use the L01 device in legacy Shockburst mode (ACK's disabled).

    On the nRF5 side you can use the esb_ptx and esb_prx examples as a starting point: \nRF5_SDK_12.2.0\examples\proprietary_rf\

    For this to work you need the following settings on the nRF24L01 side:
    Default address (0xE7E7E7E7E7), with 5 byte address length
    16-bit CRC
    2Mbps bitrate
    Auto ACK and dynamic payload length enabled

    For all other settings you can use the default values.

    Edit: Added attachment.

    Best regards
    Torbjørn

  • sir i have also tried radio example for nrf51822 nrf\nRF5_SDK_12.3.0_d7731ad\nRF5_SDK_12.3.0_d7731ad\examples\peripheral\radio\receiver\pca10028\blank\arm4 on the arduino side i have done these settings,

    #include <SPI.h>
    #include <nRF24L01.h>
    #include <RF24.h>
    #include "printf.h"      // General includes for radio and audio lib
    
    RF24 radio(18, 19);
    unsigned char values;
    int x=0;
    //const byte rxAddr[6] = "00001";
    const byte rxAddr[5] = {0xC0, 0x01, 0x23, 0x45, 0x67};
    //char values;
    void setup()
    {
      Serial.begin(9600);
      printf_begin();  
      radio.begin();
      radio.openWritingPipe(rxAddr);
      radio.setChannel(7);
     //radio.setPALevel(RF24_PA_MAX);
      radio.setDataRate(RF24_1MBPS);
     // radio.setChannel(7);
    //  radio.setRetries(15,15);
       radio.setCRCLength(RF24_CRC_16);
       radio.setPayloadSize(1);
     //radio.enableAckPayload();
    // radio.enableDynamicPayloads();
     //radio.openWritingPipe(rxAddr);
      radio.stopListening();
    //radio.printDetails();
    }
    
    void loop()
    {
    //  Serial.print("value");
     // if(Serial.available()) {    
        
      //   while (Serial.available()>0){
            
           values = '1';
            
             radio.write(&values,32);
             delay(500);
          //  Serial.print(value);  //prints the character just read
         }
         
               
        //Serial.println();
    

    in this case i am able to make radio communication betrween nrf24l01 and nrf51822.but in nrf51822 side i am not able to take transmitted character it shows nrflog as data received is 0.

    can you please tell me if there is any settings of setting payload on transmission and recveiver side.

Reply
  • sir i have also tried radio example for nrf51822 nrf\nRF5_SDK_12.3.0_d7731ad\nRF5_SDK_12.3.0_d7731ad\examples\peripheral\radio\receiver\pca10028\blank\arm4 on the arduino side i have done these settings,

    #include <SPI.h>
    #include <nRF24L01.h>
    #include <RF24.h>
    #include "printf.h"      // General includes for radio and audio lib
    
    RF24 radio(18, 19);
    unsigned char values;
    int x=0;
    //const byte rxAddr[6] = "00001";
    const byte rxAddr[5] = {0xC0, 0x01, 0x23, 0x45, 0x67};
    //char values;
    void setup()
    {
      Serial.begin(9600);
      printf_begin();  
      radio.begin();
      radio.openWritingPipe(rxAddr);
      radio.setChannel(7);
     //radio.setPALevel(RF24_PA_MAX);
      radio.setDataRate(RF24_1MBPS);
     // radio.setChannel(7);
    //  radio.setRetries(15,15);
       radio.setCRCLength(RF24_CRC_16);
       radio.setPayloadSize(1);
     //radio.enableAckPayload();
    // radio.enableDynamicPayloads();
     //radio.openWritingPipe(rxAddr);
      radio.stopListening();
    //radio.printDetails();
    }
    
    void loop()
    {
    //  Serial.print("value");
     // if(Serial.available()) {    
        
      //   while (Serial.available()>0){
            
           values = '1';
            
             radio.write(&values,32);
             delay(500);
          //  Serial.print(value);  //prints the character just read
         }
         
               
        //Serial.println();
    

    in this case i am able to make radio communication betrween nrf24l01 and nrf51822.but in nrf51822 side i am not able to take transmitted character it shows nrflog as data received is 0.

    can you please tell me if there is any settings of setting payload on transmission and recveiver side.

Children
No Data
Related