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

  • 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

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

Children
No Data
Related