This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

re:nrf24l01p and nrf51822 esb communication

I can't see the answer, so I will write it again.

hello.

nrf24l01p(ptx), nrf51822(prx)

nrf24l01p set

TX_ADDR = 0xA5B300

EN_AA = 0

EN_RXADDR = 1

SETUP_AW = 1

RF_CH = 0x0A

RF_SETUP = 0x26

W_TX_PAYLOAD = 0x00E1124525

CONFIG = 0x0E

I want to receive the set nrf24l01p with nrf51822.

Example Even though #define NRF_ESB_LEGACY is set in esb_low_power_prx and the frequency channel, address length and address are changed, it is not received.

How should I set up the nrf51822?

Parents Reply Children
  • thank you. I'll try.

    In NRF51, we try to designate the address as 3 bytes.
    nrf_esb_set_address_length(3);
    Then, the base address is 2 bytes and the prefix is 1 byte.
    Is that right?
    S0,S1,LFLEN settings are S0, S1 = 1, LFLEN =0; Is it this way?

    NRF51_RM(Page 82) "The base address is truncated from LSByte if the BALEN is less than 4. "
    For example, when setting 3 bytes of the pipe 0 address to 0xABCDEF
    1) uint8_t base_addr_0[4] = {0xAB, 0xCD, 0x00, 0x00};
    2) uint8_t base_addr_0[4] = {0x00, 0x00, 0xAB, 0xCD};
    uint8_t addr_prefix[8] = {0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

    How should I set it up?
    The datasheet is too short to understand.

  • In general we don't recommend using address fields with multiple 00 or FF, since that resemble noise, and may increase the packet error rate. 

    If you are unsure of the address is correct, just set all address bytes to the the same value, e.g. the default is all bytes are C2 or all E7. It is easier to find if that is the problem that way.

    Best regards,
    Kenneth 

    JK5 said:
    nrf_esb_set_address_length(3);
    Then, the base address is 2 bytes and the prefix is 1 byte.

     Correct.

  • hi.

    I did the test as you told me.

    I tried nrf51(prx), nrf24(ptx) and it worked.
    However, it was only possible when using the complete basic example.
    Do not change the address strangely.
    Only 0xE7E7E7E7E7 is possible, and if you change to 0xC2C2C2C2C2, 0xC3C3C3C3C3,0xA5A5A5A5A5, prx only receives once and does not receive.

    The changed source code is
    NRF51
    esb_init()
    {
    ...
    uint8_t base_addr_0[4] = {0xA5, 0xA5, 0xA5, 0xA5};
    uint8_t base_addr_1[4] = {0xC2, 0xC2, 0xC2, 0xC2};
    uint8_t addr_prefix[8] = {0xA5, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8 };
    ...
    }

    NRF24
    main()
    {
    unsigned char address[5] = {0xA5, 0xA5, 0xA5, 0xA5, 0xA5};
    ...
    hal_nrf_set_address(HAL_NRF_TX, address);
    ...
    while (1)
    {
    hal_nrf_write_tx_payload(payload, 3);
    CE_PULSE();
    }
    }

    ------add

    For the above problem, for nrf24 to nrf24, EN_AA should be 0.

    If EN_AA is set to 0 in nrf24, how should it be set in NRF51?

  • If you are setting EN_AA=0 then you are disabling the auto ack -> in other words you are disabling the "Enhanced" in the "E"SB protocol, and instead are using old SB protocol. This is not really supported by the ESB examples. In such case you likely will need to look at the \examples\peripheral\radio\receiver example.

    Best regards,
    Kenneth

Related