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

How to turn radio off in proprietary mode (nrf_esb)?

We make the project where we want to connect new device (currently designing on nRf52832) to existing system made on nRF24.
It's a beacon in proprietary mode. It should periodicaly wake up, send Req, receive Ack, (sometimes another one Req/Ack) and going sleep back.

The main device on nRf24 listen the radio full time. So we just need to control the beacon.

There are we have some questions:

  • How to turn radio off in ESB mode? (for low power, when sleep)
    • I think we can use nrf_esb_suspend  or nrf_esb_disable, but i'm not sure it the right solutiuon.
  • Periodically we lost second Ack in dialog between nRF52832 and nRF24. What can lead to it?
  • Update:

    We trying to turn radio off by nrf_esb_disable(). Now we can't reinitilaze the radio by nrf_esb_init().

  • There are our init function.

    uint32_t esb_init( void )
    {
        uint32_t err_code;
        
        uint8_t base_addr_0[4] = {0xE7, 0xE7, 0xE7, 0xEF};
        uint8_t base_addr_1[4] = {0xA1, 0xA2, 0xA3, 0xA4};
        uint8_t addr_prefix[8] = {0xE0, 0xA0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0 };
        
        nrf_esb_config_t nrf_esb_config         = NRF_ESB_DEFAULT_CONFIG;
         
            
        nrf_esb_config.protocol=                NRF_ESB_PROTOCOL_ESB_DPL;
        nrf_esb_config.retransmit_delay=        600;
        nrf_esb_config.bitrate=                 NRF_ESB_BITRATE_2MBPS;
        nrf_esb_config.event_handler=           nrf_esb_event_handler;
        nrf_esb_config.mode=                    NRF_ESB_MODE_PTX;
        nrf_esb_config.selective_auto_ack=      1;
        nrf_esb_config.payload_length=          4;
        nrf_esb_config.retransmit_count=        3;
        nrf_esb_config.crc=                     NRF_ESB_CRC_8BIT;
        nrf_esb_config.tx_mode=                 NRF_ESB_TXMODE_MANUAL;
    
        err_code = nrf_esb_init(&nrf_esb_config);
        VERIFY_SUCCESS(err_code);
    
        nrf_esb_enable_pipes(3);
        
        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);
        if(addr_prefix[0])
            __NOP();
        err_code = nrf_esb_set_prefixes(addr_prefix, 4); // This function configures the number of available pipes, enables the pipes, and sets their prefix addresses.
        VERIFY_SUCCESS(err_code);
        
        nrf_esb_update_prefix(0, 0xE0);
        
        err_code = nrf_esb_set_rf_channel(1);
        VERIFY_SUCCESS(err_code);
    
        return err_code;
    }

  • Hi,

    You may try to power cycle the radio peripheral, e.g.:

            nrf_esb_disable();
            
            // Power cycle the radio perpipheral
            *(volatile uint32_t *)0x40001FFC = 0;
            *(volatile uint32_t *)0x40001FFC;
            *(volatile uint32_t *)0x40001FFC = 1;
            
            err_code = esb_init();
            APP_ERROR_CHECK(err_code);

    That seems to work without any problems here placed in the while(1) loop in main() in \examples\proprietary_rf\esb_ptx

    I highly recommend using 16bit CRC.

    Best regards,
    Kenneth

  • hi everybody, 

    i don't understand how to fit it in my programm. 

    I have a time base made by Timer, and the programm RX mode switching between on and off(low power mode).

    I'm not able to turn it off. 

              handler time base called by the timer: 
               
                on(LED);
    			rf_proprietary_rx_start(); // nrf_esb_start_rx();
    			while(rf_proprietary_rx_get_counter() != 0);
    			rf_proprietary_rx_stop(); // nrf_esb_stop_rx();
    			off(LED);

    It does not work right.

    Thanks

Related