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.

  • 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

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

  • hello sir, i am waiting for your reply.as i am stucked with this problem... Pallavi.

  • Hi
    Since I don't have the Arduino stuff up and running I had to dig out some old code to control the nRF24L01+ module from a Nordic kit.

    I used the following code to configure the L01+ module:

    static void l01_configure(void)
    {
        l01_config_t l01_config = {1, 11, 12, 13, 14, 15, 16};
        hal_nrf_nrf52_init(&my_l01, &l01_config, l01_irq);
        
        nrf_delay_us(1500);
        
        hal_nrf_set_power_mode(HAL_NRF_PWR_UP);
            
        nrf_delay_us(1500);
    		
        hal_nrf_set_crc_mode(HAL_NRF_CRC_16BIT);
        
        hal_nrf_set_datarate(HAL_NRF_2MBPS);
        
        hal_nrf_setup_dynamic_payload(0x3F);
        hal_nrf_enable_dynamic_payload(true);
    }
    

    The register readout after configuration was the following:

    APP:INFO:  Reg 0x00: 0x0E
    APP:INFO:  Reg 0x01: 0x3F
    APP:INFO:  Reg 0x02: 0x03
    APP:INFO:  Reg 0x03: 0x03
    APP:INFO:  Reg 0x04: 0x03
    APP:INFO:  Reg 0x05: 0x02
    APP:INFO:  Reg 0x06: 0x0F
    APP:INFO:  Reg 0x07: 0x0F
    APP:INFO:  Reg 0x08: 0x93
    APP:INFO:  Reg 0x09: 0x00
    APP:INFO:  Reg 0x0A: 0xE7-0xE7-0xE7-0xE7-0xE7
    APP:INFO:  Reg 0x0B: 0xC2-0xC2-0xC2-0xC2-0xC2
    APP:INFO:  Reg 0x0C: 0xC3
    APP:INFO:  Reg 0x0D: 0xC4
    APP:INFO:  Reg 0x0E: 0xC5
    APP:INFO:  Reg 0x0F: 0xC6
    APP:INFO:  Reg 0x10: 0xE7-0xE7-0xE7-0xE7-0xE7
    APP:INFO:  Reg 0x11: 0x00
    APP:INFO:  Reg 0x12: 0x00
    APP:INFO:  Reg 0x13: 0x00
    APP:INFO:  Reg 0x14: 0x00
    APP:INFO:  Reg 0x15: 0x00
    APP:INFO:  Reg 0x16: 0x00
    APP:INFO:  Reg 0x17: 0x21
    APP:INFO:  Reg 0x18: 0x00
    APP:INFO:  Reg 0x19: 0x00
    APP:INFO:  Reg 0x1A: 0x00
    APP:INFO:  Reg 0x1B: 0x00
    APP:INFO:  Reg 0x1C: 0x3F
    APP:INFO:  Reg 0x1D: 0x04
    

    With this configuration I could send packets to an nRF51822 device, running the standard esb_prx example in the SDK.

    Do you have two nRF51 boards?
    If so I can probably share my code, and you can try to run the nRF24L01+ module straight from the Nordic DK and see if you can get that to work.

    Regards

  • hello sir, i have two nrf51 bords. but in one side i am using arduino with nrf24l01 and on the other side nrf51 board.then if you have the code please share.i am stuccked here badly.i want this communication for further implimentation of project on nrf51.

    Thank you , Pallavi

Related