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
  • Hi Samuel

    Yes, it should be possible to get the RSSI only from one specific channel, but you would have to implement the logic to do so where you only request the RSSI from I.E. Channel 37 and not theother channels.

    If you check out the DTM example we have as well as the DTM app in nRFConnect for Desktop, you can see that it has handled this in the central application where you either set it to retrieve the RSSI value of either a selected "sweep" of channels or just a single one.

    Best regards,

    Simon

  • Hi Simon

    thank you for your response..

    The DTM example I've already been looking at, however its hard to deceipher what command in the end is provided to the dtm_cmd(...) function.

    I'm not sure if you had a look at the code I've provided in the original question, but there I can nowhere see where to set the channle/frequency. Could you point me a bit to a closer location in the DTM example where to look at?

    My goal is to read the RSSI value of channel 37.

    Another approach I've tried was, using the radio_test example as a basis, but there it seems not to be possible to measure an RSSI value.

    EDIT:

    I've just found out that you can also set the radio frequency like this:

    NRF_RADIO->FREQUENCY = 2400 + 39;

    So in order to measure the RSSI on channel 39, would this do the trick? By setting the frequency before enabling the radio?

Reply
  • Hi Simon

    thank you for your response..

    The DTM example I've already been looking at, however its hard to deceipher what command in the end is provided to the dtm_cmd(...) function.

    I'm not sure if you had a look at the code I've provided in the original question, but there I can nowhere see where to set the channle/frequency. Could you point me a bit to a closer location in the DTM example where to look at?

    My goal is to read the RSSI value of channel 37.

    Another approach I've tried was, using the radio_test example as a basis, but there it seems not to be possible to measure an RSSI value.

    EDIT:

    I've just found out that you can also set the radio frequency like this:

    NRF_RADIO->FREQUENCY = 2400 + 39;

    So in order to measure the RSSI on channel 39, would this do the trick? By setting the frequency before enabling the radio?

Children
No Data
Related