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

nRF52 receiving data from 24L01 incorrectly

Hi,

I am using a 24L01+(as PTX) communicating with a nrf52832(as PRX).

I can have these two device communicating, where nrf52832 can receive data from 24L01+.

However, the data nrf52832 received is not the exactly same as the data 24L01+ has transmitted. For example, the 24L01+ is transmitting a 3-byte data(e.g. 0x123456) to nRF52832, while the data nRF52832 received is 0x2468AC. As you can see, 0x2468AC = 0x123456 <- 1. However, in another test, the 24L01+ transmitted 0x676767, while the nRF52832 received 0xCECECF.

Any suggestion would be appreciated. 

Best regards!

Parents
  • Hi,

     

    It sounds like you have configured the radio incorrectly, especially the endianess of the nrf52 radio (see PCNF1 register)

    Have you tried using nrf_esb library for nRF52 to see if that works better?

     

    Kind regards,

    Håkon

  • Thanks for your suggestion.

    The program running on the nRF52832 was modified from the nRF52 SDK 15.0.0 esb_prx example. It uses the nrf_esb library to recieve data.

    A part of my code which config the esb is as follows.

    uint32_t esb_init( void )
    {
        uint32_t err_code;
        uint8_t base_addr_0[3] = {0xE7, 0xE7, 0xE7};
        uint8_t base_addr_1[3] = {0xC2, 0xC2, 0xC2};
        uint8_t addr_prefix[2] = {0xE7, 0xC2};
        nrf_esb_config_t nrf_esb_config         = NRF_ESB_LEGACY_CONFIG;
        nrf_esb_config.payload_length           = 3;
        nrf_esb_config.crc 	                	= NRF_ESB_CRC_8BIT;
        nrf_esb_config.protocol                 = NRF_ESB_PROTOCOL_ESB;
        nrf_esb_config.bitrate                  = NRF_ESB_BITRATE_2MBPS;
        nrf_esb_config.mode                     = NRF_ESB_MODE_PRX;
        nrf_esb_config.event_handler            = nrf_esb_event_handler;
        nrf_esb_config.selective_auto_ack       = false;
    
        err_code = nrf_esb_init(&nrf_esb_config);
        VERIFY_SUCCESS(err_code);		
    		
        err_code = nrf_esb_set_rf_channel(73);
        VERIFY_SUCCESS(err_code);
    		
        err_code = nrf_esb_set_address_length(4);
        VERIFY_SUCCESS(err_code);
    
        err_code = nrf_esb_set_base_address_0(base_addr_0);
        VERIFY_SUCCESS(err_code);
    
        err_code = nrf_esb_set_base_address_1(base_addr_1);
        VERIFY_SUCCESS(err_code);
    
        err_code = nrf_esb_set_prefixes(addr_prefix, 2);
        VERIFY_SUCCESS(err_code);
    
        return err_code;
    }
    

    I don't know where I should modify my code. 

    Thanks

Reply
  • Thanks for your suggestion.

    The program running on the nRF52832 was modified from the nRF52 SDK 15.0.0 esb_prx example. It uses the nrf_esb library to recieve data.

    A part of my code which config the esb is as follows.

    uint32_t esb_init( void )
    {
        uint32_t err_code;
        uint8_t base_addr_0[3] = {0xE7, 0xE7, 0xE7};
        uint8_t base_addr_1[3] = {0xC2, 0xC2, 0xC2};
        uint8_t addr_prefix[2] = {0xE7, 0xC2};
        nrf_esb_config_t nrf_esb_config         = NRF_ESB_LEGACY_CONFIG;
        nrf_esb_config.payload_length           = 3;
        nrf_esb_config.crc 	                	= NRF_ESB_CRC_8BIT;
        nrf_esb_config.protocol                 = NRF_ESB_PROTOCOL_ESB;
        nrf_esb_config.bitrate                  = NRF_ESB_BITRATE_2MBPS;
        nrf_esb_config.mode                     = NRF_ESB_MODE_PRX;
        nrf_esb_config.event_handler            = nrf_esb_event_handler;
        nrf_esb_config.selective_auto_ack       = false;
    
        err_code = nrf_esb_init(&nrf_esb_config);
        VERIFY_SUCCESS(err_code);		
    		
        err_code = nrf_esb_set_rf_channel(73);
        VERIFY_SUCCESS(err_code);
    		
        err_code = nrf_esb_set_address_length(4);
        VERIFY_SUCCESS(err_code);
    
        err_code = nrf_esb_set_base_address_0(base_addr_0);
        VERIFY_SUCCESS(err_code);
    
        err_code = nrf_esb_set_base_address_1(base_addr_1);
        VERIFY_SUCCESS(err_code);
    
        err_code = nrf_esb_set_prefixes(addr_prefix, 2);
        VERIFY_SUCCESS(err_code);
    
        return err_code;
    }
    

    I don't know where I should modify my code. 

    Thanks

Children
Related