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

Parents
  • To those who are interested in this thread, here is a recap of the items learned about PA_LNA assist in the softdevice:

    1. PA_LNA assist does work in the softdevice and can be implemented as shown above.
    2. The PA turn on will always occur approx 10 usec into the CW (unmodulated carrier) phase of the TX sequence but will occur approx 4 usec before the beginning of the preamble. This keeps the preamble from being corrupted.
    3. A variety of shortcuts are used by the softdevice on the radio. Be careful if you decide to start using radio events to trigger other actions. An example of this is the DISABLED to TX_EN short is used during client connect. This results in only a single RX_EN event and no TX_EN event for RX and TX activity. You should monitor the shorts register if you start using radio events.

    As an RF engineer, I would suggest you examine carefully the requirements of the FEM (front end module) you intend to use with PA_LNA assist. A PA turn on with CW input is not the most graceful way to turn on a power amplifier. All amplifiers turn on quickly as Class-C and then only after the bias has stabilized turn into Class-AB. Significant harmonic emissions may result. Also, if your FEM has an antenna switch or bypass switch that is changing state, this implementation could result in it being hit with a large blast of CW while it is trying to change state. Switch failure is a common problem caused by hot switching RF switches.

    It was noted during this process that there is no PA_LNA assist implementation in the DTM software. Since this code was needed by both myself and an associate, I put together a modified DTM app with PA_LNA assist. DTM does not use the softdevice, though the app provided by Nordic is designed to sit in the application area of flash. If you want to load it on a device without the SD, just change the rom start to 0x0 in the project settings.

    There are two versions of the modified DTM attached. On one "ble_dtm_mod.c" the pa turn on will occur approx 100usec ahead of any TX activity (CW or otherwise). On the second version "ble_dtm_mod_timer.c" the implementation is more like Nordic's PA_LNA assist. A timer runs at EVENTS_READY and delays TASKS_START by 4usec. This results in a PA turn on during CW but 4 usec before the preamble. Just rename the appropriate file and use it in place of the Nordic file.

    Enjoy!
    ble_dtm_mod.c ble_dtm_mod_timer.c

Reply
  • To those who are interested in this thread, here is a recap of the items learned about PA_LNA assist in the softdevice:

    1. PA_LNA assist does work in the softdevice and can be implemented as shown above.
    2. The PA turn on will always occur approx 10 usec into the CW (unmodulated carrier) phase of the TX sequence but will occur approx 4 usec before the beginning of the preamble. This keeps the preamble from being corrupted.
    3. A variety of shortcuts are used by the softdevice on the radio. Be careful if you decide to start using radio events to trigger other actions. An example of this is the DISABLED to TX_EN short is used during client connect. This results in only a single RX_EN event and no TX_EN event for RX and TX activity. You should monitor the shorts register if you start using radio events.

    As an RF engineer, I would suggest you examine carefully the requirements of the FEM (front end module) you intend to use with PA_LNA assist. A PA turn on with CW input is not the most graceful way to turn on a power amplifier. All amplifiers turn on quickly as Class-C and then only after the bias has stabilized turn into Class-AB. Significant harmonic emissions may result. Also, if your FEM has an antenna switch or bypass switch that is changing state, this implementation could result in it being hit with a large blast of CW while it is trying to change state. Switch failure is a common problem caused by hot switching RF switches.

    It was noted during this process that there is no PA_LNA assist implementation in the DTM software. Since this code was needed by both myself and an associate, I put together a modified DTM app with PA_LNA assist. DTM does not use the softdevice, though the app provided by Nordic is designed to sit in the application area of flash. If you want to load it on a device without the SD, just change the rom start to 0x0 in the project settings.

    There are two versions of the modified DTM attached. On one "ble_dtm_mod.c" the pa turn on will occur approx 100usec ahead of any TX activity (CW or otherwise). On the second version "ble_dtm_mod_timer.c" the implementation is more like Nordic's PA_LNA assist. A timer runs at EVENTS_READY and delays TASKS_START by 4usec. This results in a PA turn on during CW but 4 usec before the preamble. Just rename the appropriate file and use it in place of the Nordic file.

    Enjoy!
    ble_dtm_mod.c ble_dtm_mod_timer.c

Children
No Data
Related