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

Reply
  • 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

Children
  • sir these settings i have done on the nrf24l01 side.will you please tell me is these settings are write for nrf24l01 as a transmitter.

    on nrf24l01 side prograaming ide is arduino.and in nrf51 side using keil ide in nrf51 side i used sdk 12.2.0 and the code from this is esb_prx. but i am failing to do communication between nrf24l01 anf nrf51.

    #include <SPI.h>
    #include <nRF24L01.h>
    #include <RF24.h>
    
    RF24 radio(18, 19);
    String TEXT="";
    int x=0;
    //const byte rxAddr[6] = "00001";
    const byte rxAddr[5] = {0xE7,0xE7,0xE7,0xE7,0xE7};
    char values;
    void setup()
    {
      Serial.begin(9600);
      radio.begin();
     //radio.setPALevel(RF24_PA_MAX);
      radio.setDataRate(RF24_2MBPS);
     // radio.setChannel(7);
    //  radio.setRetries(15,15);
     radio.setCRCLength(RF24_CRC_16);
     radio.enableAckPayload();
    radio.enableDynamicPayloads();
     radio.openWritingPipe(rxAddr);
    
      
      radio.stopListening();
    }
    
    void loop()
    {
    //  Serial.print("value");
     // if(Serial.available()) {    
        
      //   while (Serial.available()>0){
            
           values = '1';
            
             radio.write(&values,1);
             delay(500);
          //  Serial.print(value);  //prints the character just read
    }
         
    //Serial.println();
    
  • Hi

    What kind of hardware are you using on the nRF24L01+ side? Just a regular Arduino Uno?

    Have you been able to verify the Arduino/nRF24L01+ kit in isolation by using a similar kit as the receiver, or could there be issues on the Arduino side as well?

    Best regards
    Torbjørn

  • i am using arduino uno board. i have done the tx rx communication of nrf24l01+arduino with another nrf24l01+arduino uno;with the above same specifications of rf. but it is not working with nrf51822. as you told i have used radio.enableAckPayload(); //function for enabling the Auto ACK and radio.enableDynamicPayloads(); // function for enabling the dynamic payload is these are write functions i am using for the two purposes,Auto ACK and enabling the dynamic payload.

  • Hi

    Can you run the printDetails() function on the Arduino side after you have configured the radio, and let me know what you get?

    Best regards

  • hello sir, these are the details aftyer executing printDetails(); function

    STATUS		 = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1	 = 0xe7e7e7e7e7 0xc2c2c2c2c2
    RX_ADDR_P2-5	 = 0xc3 0xc4 0xc5 0xc6
    TX_ADDR		 = 0xe7e7e7e7e7
    RX_PW_P0-6	 = 0x01 0x00 0x00 0x00 0x00 0x00
    EN_AA		 = 0x3f
    EN_RXADDR	 = 0x03
    RF_CH		 = 0x4c
    RF_SETUP	 = 0x0f
    CONFIG		 = 0x0e
    DYNPD/FEATURE	 = 0x3f 0x06
    Data Rate	 = 2MBPS
    Model		 = nRF24L01+
    CRC Length	 = 16 bits
    PA Power	 = PA_MAX
    

    Pallavi

Related