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 at one point i am succesful for achieving communication between nrf51822 and nrf24l01.but there is one problem i am facing now i am receiving interrupt from nrf24l01 but at the receiver end i am not getting any data. for which i had used the code from sdk 12.2.0 from the folder examples/peripherals/radio in this code the settings given for nrf24 series, these are as follows, uint8_t tx_address[5] = { 0xC0, 0x01, 0x23, 0x45, 0x67 };

    • hal_nrf_set_rf_channel(7);
    • hal_nrf_set_address_width(HAL_NRF_AW_5BYTES);
    • hal_nrf_set_address(HAL_NRF_TX, tx_address);
    • hal_nrf_set_address(HAL_NRF_PIPE0, tx_address);
    • hal_nrf_open_pipe(0, false);
    • hal_nrf_set_datarate(HAL_NRF_1MBPS);
    • hal_nrf_set_crc_mode(HAL_NRF_CRC_16BIT);
    • hal_nrf_setup_dynamic_payload(0xFF);
    • hal_nrf_enable_dynamic_payload(false);
    • @endverbatim
    • When transmitting packets with hal_nrf_write_tx_payload(const uint8_t *tx_pload, uint8_t length),
    • match the length with PACKET_STATIC_LENGTH.
    • hal_nrf_write_tx_payload(payload, PACKET_STATIC_LENGTH); according to this i had programmed arduino board with the following settings, const byte rxAddr[5]={0xC0,0x01,0x23,0x45,0x67}; radio.setDataRate(RF24_1MBPS); radio.setChannel(7); // radio.setRetries(15,15); radio.setCRCLength(RF24_CRC_16); radio.openWritingPipe(rxAddr); radio.stopListening(); and for the payload length making equal i had chaned the arduino library function and made payload width 1. at one point i had received the data from nrf24l01.but when next time i started to code arduino board and nrf51822 my rf communuication fail.i dont know how this happened. will you please help me in one thing because now i am thinking reversly i am trying to change opayload width of nrf51822 .will you please help me how to change the payload width with 32 bytes.cz nrf24l01 has default payload width of 32 bytes. so please tell me what changes i have to do for changing payload widgth of nrf51822 according to receing 32 bytes data. Pallavi
Reply
  • sir, i at one point i am succesful for achieving communication between nrf51822 and nrf24l01.but there is one problem i am facing now i am receiving interrupt from nrf24l01 but at the receiver end i am not getting any data. for which i had used the code from sdk 12.2.0 from the folder examples/peripherals/radio in this code the settings given for nrf24 series, these are as follows, uint8_t tx_address[5] = { 0xC0, 0x01, 0x23, 0x45, 0x67 };

    • hal_nrf_set_rf_channel(7);
    • hal_nrf_set_address_width(HAL_NRF_AW_5BYTES);
    • hal_nrf_set_address(HAL_NRF_TX, tx_address);
    • hal_nrf_set_address(HAL_NRF_PIPE0, tx_address);
    • hal_nrf_open_pipe(0, false);
    • hal_nrf_set_datarate(HAL_NRF_1MBPS);
    • hal_nrf_set_crc_mode(HAL_NRF_CRC_16BIT);
    • hal_nrf_setup_dynamic_payload(0xFF);
    • hal_nrf_enable_dynamic_payload(false);
    • @endverbatim
    • When transmitting packets with hal_nrf_write_tx_payload(const uint8_t *tx_pload, uint8_t length),
    • match the length with PACKET_STATIC_LENGTH.
    • hal_nrf_write_tx_payload(payload, PACKET_STATIC_LENGTH); according to this i had programmed arduino board with the following settings, const byte rxAddr[5]={0xC0,0x01,0x23,0x45,0x67}; radio.setDataRate(RF24_1MBPS); radio.setChannel(7); // radio.setRetries(15,15); radio.setCRCLength(RF24_CRC_16); radio.openWritingPipe(rxAddr); radio.stopListening(); and for the payload length making equal i had chaned the arduino library function and made payload width 1. at one point i had received the data from nrf24l01.but when next time i started to code arduino board and nrf51822 my rf communuication fail.i dont know how this happened. will you please help me in one thing because now i am thinking reversly i am trying to change opayload width of nrf51822 .will you please help me how to change the payload width with 32 bytes.cz nrf24l01 has default payload width of 32 bytes. so please tell me what changes i have to do for changing payload widgth of nrf51822 according to receing 32 bytes data. Pallavi
Children
No Data
Related