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

Poor alignment of pa lna signal with RF burst

We are developing a beacon device with 10dBm power amplifier. During software development we noticed the control signals provided by ble_common_opt_pa_lna_t align poorly with the actual RF burst of the advertising beacon. We used a PCA10040 and measured RF output directly from the nRF52832. The amplifier control signal was routed out P0.23. In the bmp files below from the scope the measured RF power (shown in green) starts nearly 10usec ahead of the pa control signal from PPI. During testing with an actual external amplifier this results in significant loss of the advertising signal. The code (shown below) was a direct copy from your example in the blogs.

In general a power amplifier should have at least 1usec of turn on time ahead of the RF burst. Given the jitter and latency associated with your implementation on the PPI bus, 5 usec of advance notice would be useful. We are using S132 2.0.0-8 on nRF52832-QFAA-BA. Please advise how this can be resolved.

static void pa_lna_assist(void) { ret_code_t err_code;

static const uint32_t gpio_toggle_ch = 0;
static const uint32_t ppi_set_ch = 0;
static const uint32_t ppi_clr_ch = 1;

// Configure SoftDevice PA/LNA assist
ble_opt_t opt;
memset(&opt, 0, sizeof(ble_opt_t));
// Common PA/LNA config
opt.common_opt.pa_lna.gpiote_ch_id  = gpio_toggle_ch;        // GPIOTE channel
opt.common_opt.pa_lna.ppi_ch_id_set = ppi_set_ch;            // PPI channel for pin clearing
opt.common_opt.pa_lna.ppi_ch_id_clr = ppi_clr_ch;            // PPI channel for pin setting
// PA config
opt.common_opt.pa_lna.pa_cfg.active_high = 1;                // Set the pin to be active high
opt.common_opt.pa_lna.pa_cfg.enable      = 1;                // Enable toggling
opt.common_opt.pa_lna.pa_cfg.gpio_pin    = 23;      // The GPIO pin to toggle

// LNA config
opt.common_opt.pa_lna.lna_cfg.active_high  = 1;              // Set the pin to be active high
opt.common_opt.pa_lna.lna_cfg.enable       = 1;              // Enable toggling
opt.common_opt.pa_lna.lna_cfg.gpio_pin     = 22;   // The GPIO pin to toggle

NRF_GPIO->DIRSET = PA_MASK;
err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &opt);
APP_ERROR_CHECK(err_code);
	

} Leading edge of channel 1 burst

All three advertising bursts and RF in green Test Setup

  • With regard to RADIO->EVENTS_READY, I already did this earlier. I used EVENTS_READY for SET and EVENTS_DISABLED for CLR. Based on the signal modulation, as seen on a spectrum analyzer, it appears that EVENTS_READY does not coincide with the beginning of transmission. It does however coincide precisely with the transmission of the preamble. According to the transmit sequence as shown in the reference manual, EVENTS_READY should occur at the start of the CW transmit phase. However, as I noted it occurs precisely 14usec later, which seems to be the start of the preamble. See scope image. PA_LNA assist in yellow and EVENTS_READY in green. link text

    Also, yes you are correct. A power amplifier should have some time to stabilize before transmission occurs. Most power amplifiers your clients would use need about 1usec.

  • FormerMember
    0 FormerMember in reply to FormerMember

    The radio will not transmit anything before RADIO->EVENTS_READY. Everything before that event is noise from the ramp-up of the radio. We don't want to amplify that noise.

  • I agree with you it should not. What I am saying is that the leading portion of a Tx burst is unmodulated carrier consistent with your reference manual. However, EVENTS_READY does not happen at the beginning of the Tx burst but instead occurs later. According to the reference manual, EVENTS_READY should occur at the start of unmodulated carrier. Based on the carrier modulation (as seen on a spectrum analyzer) it occurs at the start of the preamble. The linked image shows the Tx burst (shown in green) directly from your development board running production code and hardware. It clearly occurs before the EVENTS_READY event (shown in yellow). link text

  • Here is the code I use. I init immediately after the softdevice is started and before any advertising is started nor configured.

    static void gpiote_sdtask_init(void)
    

    { NRF_GPIOTE->CONFIG[2] =((GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) |(12 << GPIOTE_CONFIG_PSEL_Pos) |(GPIOTE_CONFIG_POLARITY_Toggle << GPIOTE_CONFIG_POLARITY_Pos) |(GPIOTE_CONFIG_OUTINIT_Low << GPIOTE_CONFIG_OUTINIT_Pos));

    			sd_ppi_channel_assign(2, &(NRF_RADIO->EVENTS_READY), &(NRF_GPIOTE->TASKS_SET[2]));
    			sd_ppi_channel_assign(3, &(NRF_RADIO->EVENTS_DISABLED), &(NRF_GPIOTE->TASKS_CLR[2]));
    
    			sd_ppi_channel_enable_set(PPI_CHEN_CH2_Msk);
        sd_ppi_channel_enable_set(PPI_CHEN_CH3_Msk);
    

    }

  • FormerMember
    0 FormerMember in reply to FormerMember

    Where in the reference manual did you find that "EVENTS_READY should occur at the start of unmodulated carrier"? According to the reference manual, EVENTS_READY should occur right before the preamble, see here, figure 7 and 8.

Related