Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Radio 2.4 Ghz, Enable Fast mode in Rx and Tx

Hi,

How to enable fast mode for radio transmission and reception (I am using nRF5 SDK). These are the default examples and I can see that fast mode is not implemented:

Reception:

uint32_t read_packet(uint32_t* packet)
{
    memset((uint8_t*)packet, 0, CUSTOM_PACKET_STATIC_LENGTH);

    NRF_RADIO->PACKETPTR = (uint32_t)packet;
    uint32_t result = !NRF_SUCCESS;

    NRF_RADIO->EVENTS_READY = 0U;
    // Enable radio and wait for ready
    NRF_RADIO->TASKS_RXEN = 1U;

    while (NRF_RADIO->EVENTS_READY == 0U)
    {
        // wait
    }
    NRF_RADIO->EVENTS_END = 0U;
    // Start listening and wait for address received event
    NRF_RADIO->TASKS_START = 1U;

    // Wait for end of packet or buttons state changed
    while (NRF_RADIO->EVENTS_END == 0U)
    {
        // wait
    }

    if (NRF_RADIO->CRCSTATUS == 1U || packet[0]!=0)
    {
        //Packet received with CRC ok or just received some data
        result = NRF_SUCCESS;
    }

    NRF_RADIO->EVENTS_DISABLED = 0U;
    // Disable radio
    NRF_RADIO->TASKS_DISABLE = 1U;

    while (NRF_RADIO->EVENTS_DISABLED == 0U)
    {
        // wait
    }
    return result;
}

Transmission:

 void send_packet(uint32_t* packet)
{
    uint32_t err_code = NRF_SUCCESS;
    // Set payload pointer
    NRF_RADIO->PACKETPTR = (uint32_t)packet;
    // send the packet:
    NRF_RADIO->EVENTS_READY = 0U;
    NRF_RADIO->TASKS_TXEN   = 1;
    // NRF_LOG_INFO("Waiting for ready");
    while (NRF_RADIO->EVENTS_READY == 0U)
    {
        // wait
    }
    NRF_RADIO->EVENTS_END  = 0U;
    NRF_RADIO->TASKS_START = 1U;
    // NRF_LOG_INFO("Prepare sending");
    while (NRF_RADIO->EVENTS_END == 0U)
    {
        // wait
    }
    // NRF_LOG_INFO("Done sending");
    
    err_code = bsp_indication_set(BSP_INDICATE_SENT_OK);
    APP_ERROR_CHECK(err_code);

    // NRF_LOG_INFO("The packet was sent");

    NRF_RADIO->EVENTS_DISABLED = 0U;
    // Disable radio
    NRF_RADIO->TASKS_DISABLE = 1U;

    while (NRF_RADIO->EVENTS_DISABLED == 0U)
    {
        // wait
    }
}

Would really appreciate some help.

Related