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

Radio Transmitter/Receiver example

Your served radio tramsmitter/receiver example using PCA 10000 USB dongle, PCA 10001 evaluation kit. It's just only one byte data communication. It works well. If I communication multi-byte data with one packet, what did I fixed source code in "main.c" , "Radio_config.c"?

Parents
  • sir,

    i am using Radio Transmitter example .i am able to send data successfully.but i observed current as 9.7mA constantly.

    please help me to reduce power consumption.

    here is  SDK: examples/Radio/transmitter 

    PCA  10040e NRF52810

    void radio_config()
    {
      // Radio config
        NRF_RADIO->TXPOWER   = (RADIO_TXPOWER_TXPOWER_0dBm << RADIO_TXPOWER_TXPOWER_Pos);
        NRF_RADIO->FREQUENCY = 40UL;  
        NRF_RADIO->MODE      = (RADIO_MODE_MODE_Nrf_1Mbit << RADIO_MODE_MODE_Pos);
        
           update_radio_addresses(NRF_ESB_ADDR_UPDATE_MASK_BASE0);
           update_radio_addresses(NRF_ESB_ADDR_UPDATE_MASK_BASE1);
           update_radio_addresses(NRF_ESB_ADDR_UPDATE_MASK_PREFIX);
        
        NRF_RADIO->TXADDRESS   = 0x00UL;  // Set device address 0 to use when transmitting
        NRF_RADIO->RXADDRESSES = 0x01UL;  // Enable device address 0 to use to select which addresses to receive
    
        NRF_RADIO->PCNF0 = (0 << RADIO_PCNF0_S0LEN_Pos) |
                           (0 << RADIO_PCNF0_LFLEN_Pos) |
                           (1 << RADIO_PCNF0_S1LEN_Pos) ;
    
    NRF_RADIO->PCNF1 = (RADIO_PCNF1_WHITEEN_Disabled    << RADIO_PCNF1_WHITEEN_Pos) |
                           (RADIO_PCNF1_ENDIAN_Big          << RADIO_PCNF1_ENDIAN_Pos)  |
                           ((m_esb_addr.addr_length - 1)    << RADIO_PCNF1_BALEN_Pos)   |
                           (10             << RADIO_PCNF1_STATLEN_Pos) |
                           (32             << RADIO_PCNF1_MAXLEN_Pos);
    
    NRF_RADIO->SHORTS   = RADIO_SHORTS_READY_START_Msk  | RADIO_SHORTS_END_DISABLE_Msk | \
                          RADIO_SHORTS_DISABLED_TXEN_Msk;
    NRF_RADIO->INTENSET = RADIO_INTENSET_DISABLED_Msk | RADIO_INTENSET_READY_Msk;
    }
    
    
    void send_packet()
    {
        NRF_RADIO->PACKETPTR = (uint32_t)&packet;
        NRF_RADIO->EVENTS_READY = 0U;
        NRF_RADIO->TASKS_TXEN   = 1;
    
        while (NRF_RADIO->EVENTS_READY == 0U)
        {
            // wait
        }
        NRF_RADIO->EVENTS_END  = 0U;
        NRF_RADIO->TASKS_START = 1U;
    
        while (NRF_RADIO->EVENTS_END == 0U)
        {
            // wait
        }
    
        NRF_RADIO->EVENTS_DISABLED = 0U;
        // Disable radio
        NRF_RADIO->TASKS_DISABLE = 1U;
    
        while (NRF_RADIO->EVENTS_DISABLED == 0U)
        {
            // wait
        }
          
    }
    
    

Reply
  • sir,

    i am using Radio Transmitter example .i am able to send data successfully.but i observed current as 9.7mA constantly.

    please help me to reduce power consumption.

    here is  SDK: examples/Radio/transmitter 

    PCA  10040e NRF52810

    void radio_config()
    {
      // Radio config
        NRF_RADIO->TXPOWER   = (RADIO_TXPOWER_TXPOWER_0dBm << RADIO_TXPOWER_TXPOWER_Pos);
        NRF_RADIO->FREQUENCY = 40UL;  
        NRF_RADIO->MODE      = (RADIO_MODE_MODE_Nrf_1Mbit << RADIO_MODE_MODE_Pos);
        
           update_radio_addresses(NRF_ESB_ADDR_UPDATE_MASK_BASE0);
           update_radio_addresses(NRF_ESB_ADDR_UPDATE_MASK_BASE1);
           update_radio_addresses(NRF_ESB_ADDR_UPDATE_MASK_PREFIX);
        
        NRF_RADIO->TXADDRESS   = 0x00UL;  // Set device address 0 to use when transmitting
        NRF_RADIO->RXADDRESSES = 0x01UL;  // Enable device address 0 to use to select which addresses to receive
    
        NRF_RADIO->PCNF0 = (0 << RADIO_PCNF0_S0LEN_Pos) |
                           (0 << RADIO_PCNF0_LFLEN_Pos) |
                           (1 << RADIO_PCNF0_S1LEN_Pos) ;
    
    NRF_RADIO->PCNF1 = (RADIO_PCNF1_WHITEEN_Disabled    << RADIO_PCNF1_WHITEEN_Pos) |
                           (RADIO_PCNF1_ENDIAN_Big          << RADIO_PCNF1_ENDIAN_Pos)  |
                           ((m_esb_addr.addr_length - 1)    << RADIO_PCNF1_BALEN_Pos)   |
                           (10             << RADIO_PCNF1_STATLEN_Pos) |
                           (32             << RADIO_PCNF1_MAXLEN_Pos);
    
    NRF_RADIO->SHORTS   = RADIO_SHORTS_READY_START_Msk  | RADIO_SHORTS_END_DISABLE_Msk | \
                          RADIO_SHORTS_DISABLED_TXEN_Msk;
    NRF_RADIO->INTENSET = RADIO_INTENSET_DISABLED_Msk | RADIO_INTENSET_READY_Msk;
    }
    
    
    void send_packet()
    {
        NRF_RADIO->PACKETPTR = (uint32_t)&packet;
        NRF_RADIO->EVENTS_READY = 0U;
        NRF_RADIO->TASKS_TXEN   = 1;
    
        while (NRF_RADIO->EVENTS_READY == 0U)
        {
            // wait
        }
        NRF_RADIO->EVENTS_END  = 0U;
        NRF_RADIO->TASKS_START = 1U;
    
        while (NRF_RADIO->EVENTS_END == 0U)
        {
            // wait
        }
    
        NRF_RADIO->EVENTS_DISABLED = 0U;
        // Disable radio
        NRF_RADIO->TASKS_DISABLE = 1U;
    
        while (NRF_RADIO->EVENTS_DISABLED == 0U)
        {
            // wait
        }
          
    }
    
    

Children
No Data
Related