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

PA / LNA support in S140

Would you please provide an example of using PA/LNA with nRF52840 (Softdevice S140) on SDK 15.0 or higher?

Unfortunately, I could't manage the code you've provided for the other softdevice to work properly with S140:

https://devzone.nordicsemi.com/b/blog/posts/pa-lna-support-in-s132

As soon as I initial PA/LNA the softdevice stops working.

I'm wondering If you can provide a sample code like what you did before but this time on S140.

 Thanks

Parents
  • Hi Hamid, 

    I tested the PA/LNA code you referred to on a nRF52840 DK running the ble_app_blinky example and I did not see any issues. I called the pa_lna_assist function with the following parameters after conn_params_init in main()

    pa_lna_assist(NRF_GPIO_PIN_MAP(0,28),NRF_GPIO_PIN_MAP(0,29));

    Here is the function I copied from the DevZone post

    static void pa_lna_assist(uint32_t gpio_pa_pin, uint32_t gpio_lna_pin)
    {
        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_clr = ppi_clr_ch;            // PPI channel for pin clearing
        opt.common_opt.pa_lna.ppi_ch_id_set = ppi_set_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    = gpio_pa_pin;      // 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     = gpio_lna_pin;   // The GPIO pin to toggle
    
        err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &opt);
        APP_ERROR_CHECK(err_code);
    }

Reply
  • Hi Hamid, 

    I tested the PA/LNA code you referred to on a nRF52840 DK running the ble_app_blinky example and I did not see any issues. I called the pa_lna_assist function with the following parameters after conn_params_init in main()

    pa_lna_assist(NRF_GPIO_PIN_MAP(0,28),NRF_GPIO_PIN_MAP(0,29));

    Here is the function I copied from the DevZone post

    static void pa_lna_assist(uint32_t gpio_pa_pin, uint32_t gpio_lna_pin)
    {
        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_clr = ppi_clr_ch;            // PPI channel for pin clearing
        opt.common_opt.pa_lna.ppi_ch_id_set = ppi_set_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    = gpio_pa_pin;      // 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     = gpio_lna_pin;   // The GPIO pin to toggle
    
        err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &opt);
        APP_ERROR_CHECK(err_code);
    }

Children
Related