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

RSSI measurement on a specific channel

Hey all

I'm working on a BLE device using a nRf52840 SOC and for some tests now I've to measure the RSSI on a specific BLE channel (e.g. ch 37). What I've done so far to measure the RSSI is following.

    static uint32_t u32Packet = 0;
    static uint32_t u32RssiSample = 0;

    NRF_RADIO->PACKETPTR = (uint32_t)u32Packet; // set payload pointer

    NRF_RADIO->EVENTS_READY = 0u;           // clear ready event
    NRF_RADIO->TASKS_RXEN = 1u;             // enable radio in RX mode
    while(NRF_RADIO->EVENTS_READY == 0u);   // wait for the radio to be ramped up and ready to be started

    NRF_RADIO->EVENTS_READY = 0u;           // clear ready event
    NRF_RADIO->TASKS_START = 1u;            // start radio
    // TODO while(NRF_RADIO->EVENTS_READY == 0u);   // wait for the radio to be ramped up and ready to be started

    // perform RSSI determination
    NRF_RADIO->EVENTS_RSSIEND = 0u;         // clear rssiend event
    NRF_RADIO->TASKS_RSSISTART = 1u;        // start the RSSI and take one single sample of the receive signal strength
    while(NRF_RADIO->EVENTS_RSSIEND == 0u); // wait for the sampling of the receive signal strength to be completed

    u32RssiSample = NRF_RADIO->RSSISAMPLE;   // take RSSI sample

    NRF_RADIO->TASKS_RSSISTOP = 1u;         // stop RSSI sampling

    NRF_RADIO->TASKS_STOP = 1u;             // stop radio

    NRF_RADIO->EVENTS_DISABLED = 0u;        // clear disabled event
    NRF_RADIO->TASKS_DISABLE = 1u;          // disable the radio
    while(NRF_RADIO->EVENTS_DISABLED == 0u); // wait for the radio to be disabled

This seems to work fine to take a RSSI sample. My question now is, can I and if yes how can I measure the RSSI only on a specific channel?

For the test the device would be in an shielded environment, where only the signal from the test-infrastructure should be received, so I'm also wondering if it even makes sense to measure on a specific channel, if the transmitted signal is only on this specific channel. However if there is a possibility I'd still like to set it up like this.

Any help would be much appreciated

Greetings

Samuel

Parents
  • Please note that the frequency for channels 37, 38, and 39 are not 2437, 2438, and 2439. The BLE system operates on 40 channels from 2402 to 2480 each being 2MHz wide. The advertising channels are strategically placed at these values to avoid interference from each other and other devices operating in the same spectrum.

    I would suggest using the nrf_radio_frequency_set if you'd like to advertise on one specific frequency, but writing straight to the registers should work as well. The frequency for channel 37 would be 2402MHz.

    Best regards,

    Simon

  • What I've seen from the nrf_radio_frequency_set function, it sets the RF_RADIO->FREQUENCY register to a delta value of the provided frequency minus 2400.

    If I provide 2480 for Channel 39 the register is set to 80.

    Would this mean if I want to set the register directly, I'd have to write  the following values to the register to set it to channel  39 or channel 37?


    RF_RADIO->FREQUENCY = 80u; //Channel 39
    RF_RADIO->FREQUENCY = 2u;  //Channel 37

Reply Children
No Data
Related