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

Spectrum measurements with DTM firmware

Hi all, we are performing some transmitter spectrum measurements using your nRFGo (PCA10005) board and an Aaronia HF-60105 spectrum analyzer. The SMA connector of nRFGo has been connected to the spectrum analyzer through a 30 dB attenuator. On the PCA10005 board we have uploaded a custom DTM firmware that performs only the TRANSMITTER_TEST.

This is the code of the main file:

#include <stdint.h>
#include <stdbool.h>
#include "nrf51.h"
#include "nrf51_bitfields.h"
#include "ble_dtm.h"
#include "boards.h"
#include "nrf_gpio.h"

#define UICR		0x10001080

int main(void)
{
    uint32_t    dtm_error_code;
    uint32_t	dtm_tx_power = ((*(uint32_t *)UICR) & 0xFFFF0000) >> 16;
    uint32_t	dtm_freq     = ((*(uint32_t *)UICR) & 0x0000FFFF);

    // dtm init
    dtm_error_code = dtm_init();
    if (dtm_error_code != DTM_SUCCESS)
    {
        // If DTM cannot be correctly initialized, then we just return.
        return -1;
    }

    if (dtm_set_txpower(dtm_tx_power) != true)
    {
        // Error
        return -1;
    }

    // dtm transmitter test
    dtm_error_code = dtm_cmd(LE_TRANSMITTER_TEST, dtm_freq, 32, DTM_PKT_PRBS9);
    if (dtm_error_code != DTM_SUCCESS)
    {
        // If DTM cannot be correctly initialized, then we just return.
        return -1;
    }

    for (;;)
    {
        // Will return every timeout, 625 us.
        dtm_wait();
    }
}

Using this firmware the physical channel and the tx power are read from the UICR register (that we write during flashing procedure).

We have found some strange spurs at about TX frequency + 430 MHz (see attached sweep image). This seems not to be the local oscillator which is about 330 Mhz above RX frequency. The spur level is about -23 dBm, much higher than the expected LO leakage.

Can someone explain this strange behavior?

image description

Parents
  • Hi, we have made some other tests using also a basic version of the radio_test firmware to perform the TX_CARRIER_TEST. We have removed the attenuator between the nRFGo and the spectrum analyzer and programmed the nRF51 with a TX power of -30 dBm (see attached image).

    This is the code we have used for the test:

    #include <stdint.h>
    #include <stdbool.h>
    #include "boards.h"
    #include "nrf.h"
    #include "nrf51_bitfields.h"
    
    static uint8_t mode_     = RADIO_MODE_MODE_Nrf_1Mbit;
    static uint8_t txpower_  = RADIO_TXPOWER_TXPOWER_Neg30dBm;
    static uint8_t channel_  = 2;
    
    int main(void)
    {
        // Initialization
        NRF_RNG->TASKS_START = 1;    
        // Start 16 MHz crystal oscillator
        NRF_CLOCK->EVENTS_HFCLKSTARTED  = 0;
        NRF_CLOCK->TASKS_HFCLKSTART     = 1;
        // Wait for the external oscillator to start up
        while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
        {
            // Do nothing.
        }
        
        // Radio disable
        NRF_RADIO->SHORTS          = 0;
        NRF_RADIO->EVENTS_DISABLED = 0;
        NRF_RADIO->TEST            = 0;
        NRF_RADIO->TASKS_DISABLE   = 1;
        while (NRF_RADIO->EVENTS_DISABLED == 0)
        {
            // Do nothing.
        }
        NRF_RADIO->EVENTS_DISABLED = 0;
        
        // Perform test
        NRF_RADIO->SHORTS     = RADIO_SHORTS_READY_START_Msk;
        NRF_RADIO->TXPOWER    = (txpower_ << RADIO_TXPOWER_TXPOWER_Pos);    
        NRF_RADIO->MODE       = (mode_ << RADIO_MODE_MODE_Pos);
        NRF_RADIO->FREQUENCY  = channel_;
        NRF_RADIO->TEST       = (RADIO_TEST_CONST_CARRIER_Enabled << RADIO_TEST_CONST_CARRIER_Pos) \
                            | (RADIO_TEST_PLL_LOCK_Enabled << RADIO_TEST_PLL_LOCK_Pos);
    
        NRF_RADIO->TASKS_TXEN = 1;
    
        while(1)
        {
            // Do nothing.
        }
    }
    

    The same spur, as described in the previous post, is still present also with this radio test software.

    Do you have any suggestions/explanations for this radio behaviour?

    image description

    Zoomed image of the spur: image description

Reply
  • Hi, we have made some other tests using also a basic version of the radio_test firmware to perform the TX_CARRIER_TEST. We have removed the attenuator between the nRFGo and the spectrum analyzer and programmed the nRF51 with a TX power of -30 dBm (see attached image).

    This is the code we have used for the test:

    #include <stdint.h>
    #include <stdbool.h>
    #include "boards.h"
    #include "nrf.h"
    #include "nrf51_bitfields.h"
    
    static uint8_t mode_     = RADIO_MODE_MODE_Nrf_1Mbit;
    static uint8_t txpower_  = RADIO_TXPOWER_TXPOWER_Neg30dBm;
    static uint8_t channel_  = 2;
    
    int main(void)
    {
        // Initialization
        NRF_RNG->TASKS_START = 1;    
        // Start 16 MHz crystal oscillator
        NRF_CLOCK->EVENTS_HFCLKSTARTED  = 0;
        NRF_CLOCK->TASKS_HFCLKSTART     = 1;
        // Wait for the external oscillator to start up
        while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
        {
            // Do nothing.
        }
        
        // Radio disable
        NRF_RADIO->SHORTS          = 0;
        NRF_RADIO->EVENTS_DISABLED = 0;
        NRF_RADIO->TEST            = 0;
        NRF_RADIO->TASKS_DISABLE   = 1;
        while (NRF_RADIO->EVENTS_DISABLED == 0)
        {
            // Do nothing.
        }
        NRF_RADIO->EVENTS_DISABLED = 0;
        
        // Perform test
        NRF_RADIO->SHORTS     = RADIO_SHORTS_READY_START_Msk;
        NRF_RADIO->TXPOWER    = (txpower_ << RADIO_TXPOWER_TXPOWER_Pos);    
        NRF_RADIO->MODE       = (mode_ << RADIO_MODE_MODE_Pos);
        NRF_RADIO->FREQUENCY  = channel_;
        NRF_RADIO->TEST       = (RADIO_TEST_CONST_CARRIER_Enabled << RADIO_TEST_CONST_CARRIER_Pos) \
                            | (RADIO_TEST_PLL_LOCK_Enabled << RADIO_TEST_PLL_LOCK_Pos);
    
        NRF_RADIO->TASKS_TXEN = 1;
    
        while(1)
        {
            // Do nothing.
        }
    }
    

    The same spur, as described in the previous post, is still present also with this radio test software.

    Do you have any suggestions/explanations for this radio behaviour?

    image description

    Zoomed image of the spur: image description

Children
No Data
Related