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

PA + LNA with BLE and Zigbee at the same time

Hi,

We have been working with a coordinator and a router device based on nRF52840 with nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b

Both devices are Zigbee 3.0 and implement Install Codes.

On the Coordinator we have Zigbee and BLE turned on at the same time on a Fanstel BT840X with integrated PA/LNA

We tried several things:

1.When running this code, BLE seems to work but Zigbee does not seem to send Link Status messages among others

ret_code_t pa_lna_init(uint32_t gpio_pa_pin, uint32_t gpio_lna_pin)
{
    ble_opt_t opt;
    uint32_t gpiote_ch = NULL;
    ret_code_t err_code;        

    nrf_gpio_cfg_output(APP_CPS_PIN);
    nrf_gpio_cfg_output(APP_CHL_PIN);
    nrf_gpio_pin_set(APP_CHL_PIN);	
    nrf_gpio_pin_clear(APP_CPS_PIN); //enable
    //nrf_gpio_pin_set(APP_CPS_PIN); //bypass
    nrf_gpio_cfg_output(APP_PA_PIN);
    nrf_gpio_pin_clear(APP_PA_PIN); //
    nrf_gpio_cfg_output(APP_LNA_PIN);
    nrf_gpio_pin_clear(APP_LNA_PIN); //

    memset(&opt, 0, sizeof(ble_opt_t));
    
    if (!nrf_drv_gpiote_is_init())
    {
      err_code = nrf_drv_gpiote_init();
      if(err_code != NRF_ERROR_INVALID_STATE)
          APP_ERROR_CHECK(err_code);
    }
    
    err_code = nrf_drv_ppi_init();
    if(err_code != NRF_ERROR_MODULE_ALREADY_INITIALIZED)
        APP_ERROR_CHECK(err_code);
    
    nrf_ppi_channel_t ppi_set_ch;
    nrf_ppi_channel_t ppi_clr_ch;
    
    err_code = nrf_drv_ppi_channel_alloc(&ppi_set_ch);
    APP_ERROR_CHECK(err_code);
    
    err_code = nrf_drv_ppi_channel_alloc(&ppi_clr_ch);
    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_out_config_t config = GPIOTE_CONFIG_OUT_TASK_TOGGLE(false);
    
    if((gpio_pa_pin == NULL) && (gpio_lna_pin == NULL))
    {
        err_code = NRF_ERROR_INVALID_PARAM;
        APP_ERROR_CHECK(err_code);
    }    

    if(gpio_pa_pin != NULL)
    {
        if(gpiote_ch == NULL)
        {
            // nrf_drv_gpiote_out_uninit(gpio_pa_pin);
            err_code = nrf_drv_gpiote_out_init(gpio_pa_pin, &config);
            APP_ERROR_CHECK(err_code);
            
            gpiote_ch = nrf_drv_gpiote_out_task_addr_get(gpio_pa_pin); 
        }
        
        // 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 tx  
    }
    
    if(gpio_lna_pin != NULL)
    {
        if(gpiote_ch == NULL)
        {
            // nrf_drv_gpiote_out_uninit(gpio_lna_pin);
            err_code = nrf_drv_gpiote_out_init(gpio_lna_pin, &config);
            APP_ERROR_CHECK(err_code);        
            
            gpiote_ch = nrf_drv_gpiote_out_task_addr_get(gpio_lna_pin); 
        }
        
        // 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 rx
    }

    // Common PA/LNA config
    opt.common_opt.pa_lna.gpiote_ch_id  = (gpiote_ch - NRF_GPIOTE_BASE) >> 2;   // GPIOTE channel used for radio pin toggling
    opt.common_opt.pa_lna.ppi_ch_id_clr = ppi_clr_ch;   // PPI channel used for radio pin clearing
    opt.common_opt.pa_lna.ppi_ch_id_set = ppi_set_ch;   // PPI channel used for radio pin setting
    
    err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &opt);
    // APP_ERROR_CHECK(err_code);    

    return err_code;
}

2. When setting at sdk_config.h FEM_CONTROL_DEFAULT_ENABLE to 1 (and other FEM_CONTROL_DEFAULT_XXX for pins), BLE stops working...

So, we would like to know which is the right approach to get Zigbee and BLE working at the same time with PA/LNA

Regards,

Santiago

Parents
  • Hello,

    Are you sure pa_lna is related to this at all? Did everything work as expected before you enabled pa lna? Did the Zigbee work as expected? 

     

    2. When setting at sdk_config.h FEM_CONTROL_DEFAULT_ENABLE to 1 (and other FEM_CONTROL_DEFAULT_XXX for pins), BLE stops working...

     What do you mean by that? What happens when it stops working? Do you get an application/softdevice assert?

Reply
  • Hello,

    Are you sure pa_lna is related to this at all? Did everything work as expected before you enabled pa lna? Did the Zigbee work as expected? 

     

    2. When setting at sdk_config.h FEM_CONTROL_DEFAULT_ENABLE to 1 (and other FEM_CONTROL_DEFAULT_XXX for pins), BLE stops working...

     What do you mean by that? What happens when it stops working? Do you get an application/softdevice assert?

Children
  • Hi Edvin,

    Sorry for the late response.

    Yes, without enabling the PA/LNA everything works as expected.

    When FEM_CONTROL_DEFAULT_ENABLE is enabled, BLE connections are rejected from the NRF Toolbox App...

    No assert from App/SD

    Is there any proper example or recommendation for enabling PA/LNA on BLE and Zigbee at the same time?

    Regards,

    Santiago

     

  • Hello Santiago,

    What pins do you use for the PA/LNA? And are you sure that these pins are not used by anything else in your application?

  • in particular, do you use the pins P0.09 or P0.10?

    If not, do you use any of the pins used by e.g. the UART for logging?

  • Hi Edvin,

    No, pins P0.09 or P0.10 are unused.

    In option 1, when calling function pa_lna_init() we use:

    #define APP_PA_PIN      17
    #define APP_LNA_PIN     19
    #define APP_CHL_PIN     8
    #define APP_CPS_PIN     6
    In option 2, when setting at sdk_config.h FEM_CONTROL_DEFAULT_ENABLE 1 we use:
    // <o> FEM_CONTROL_DEFAULT_PA_PIN - Pin number, controlling Power Amplifier of the FEM module 
    #ifndef FEM_CONTROL_DEFAULT_PA_PIN
    #define FEM_CONTROL_DEFAULT_PA_PIN 17/*BIOBOT: PREV22*/
    #endif

    // <o> FEM_CONTROL_DEFAULT_LNA_PIN - Pin number, controlling Low Noise Amplifier of the FEM module 
    #ifndef FEM_CONTROL_DEFAULT_LNA_PIN
    #define FEM_CONTROL_DEFAULT_LNA_PIN 19
    #endif
    What about the other pin settings to enable BLE & Zigbee at the same time on Fanstel BT840X?
    FEM_CONTROL_DEFAULT_PDN_PIN
    FEM_CONTROL_DEFAULT_MODE_PIN
    FEM_CONTROL_DEFAULT_ANTSEL_PIN
    FEM_CONTROL_DEFAULT_MOSI_PIN
    FEM_CONTROL_DEFAULT_MISO_PIN
    FEM_CONTROL_DEFAULT_CLK_PIN
    FEM_CONTROL_DEFAULT_CSN_PIN
    Thanks for your kind support,
    Santiago
  • I see. Just to try to pinpoint where the issue, so I know who to reach out to.

    Can you please test to not use any of the pins P0.05 - P0.10, just to ensure that you don't have any conflicts with the pins that are used by the UART by default (5-8), and not the NFC pins (9-10). 

    Have you tried to analyze the FEM pins that you have connected to the front end module? Is there any data on the lines? If so, are these signals from the Zigbee or BLE? (try to disable one to check the other).

    BR,

    Edvin

Related