Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

PA/LNA control configuration

Rank

Total Posts: 9

Joined 2015-06-29

PM

Hi,

I am use SDK12.0.0 and Softdevice :S332 V:2.0.0,

I am facing problem for PA/LNA Configuration.

My firmware BLE PA/LNA Work perfectly, but ANT PA/LNA not work perfectly.

My Firmware PA/LNA Configuration is below.

#define APP_PA_PIN 19
#define APP_AMP_PPI_CH_ID_SET 0
#define APP_AMP_PPI_CH_ID_CLR 1
#define APP_AMP_GPIOTE_CH_ID 0

uint32_t err_code,a;

static ble_opt_t pa_lna_opts = {
.common_opt = {
.pa_lna = {
.pa_cfg = {
.enable = 1,
.active_high = 1,
.gpio_pin = APP_PA_PIN
},

.ppi_ch_id_set = APP_AMP_PPI_CH_ID_SET,
.ppi_ch_id_clr = APP_AMP_PPI_CH_ID_CLR,
.gpiote_ch_id = APP_AMP_GPIOTE_CH_ID
}
}
};
NRF_GPIO->DIRSET |= (1 << APP_PA_PIN);
err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &pa;_lna_opts);
APP_ERROR_CHECK(err_code);

static ANT_PA_LNA_CONFIG pstAmpConfig;
sd_ant_config_pa_lna_get(&pstAmpConfig;);

pstAmpConfig.PA_CONFIG.bEnabled = 1;
pstAmpConfig.PA_CONFIG.bActiveState = 1;
pstAmpConfig.PA_CONFIG.ucGPIO = APP_PA_PIN;
pstAmpConfig.ucGPIOTECh = 1;
pstAmpConfig.ucPPIChDisable = 0;
pstAmpConfig.ucPPIChEnable = 1;

err_code = sd_ant_config_pa_lna_set(&pstAmpConfig;);

1. My configuration is ok or not?
2. Require to set for both (BLE and ANT) PA/LAN Configuration? I want to use BLE and ANT Simultaneously.
3. Possible to set same PPI Channel for both BLE and ANT PA/LNA Configuration?

Regards,
Himansu Donga

     
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi,

1) Your configuration looks to be correct. We attempted to recreate your setup but we couldn't recreate your issue.

2) Both BLE and ANT can be used concurrently without any issues.

3) The same PPI, GPIOTE and GPIO can be used for the PA for both BLE and ANT concurrently.

Could you further clarify your statement that the "ANT PA/LNA not work perfectly"?
Do you have any ANT channels open when you attempt to do the setup?

What err_code is returned when you call "sd_ant_config_pa_lna_set()"?

Best regards,
Harrison      
Rank

Total Posts: 1

Joined 2016-02-16

PM

On the same PPI Channel, can we configure and use it's fork? Does the ANT Stack in any way touch the FORK configuration at any point it will be using it?

Best regards,
Lloyd      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi Lloyd,

You can use the same PPI channel to configure and use the for the PA/LNA. The ANT stack does not touch it, but we cannot guarantee that for BLE.

Cheers,
Harrison      
Rank

Total Posts: 13

Joined 2017-04-12

PM

Hi Harrison,

I am using S340 (6.1.1) Softdevice & SDK 16 for nRF52840.

I want to use below PA LNA configuration and during configuration getting error 7 (NRF_ERROR_INVALID_PARAM). please suggestion what is wrong in parameter. I want to use BLE and ANT both concurrently.

// Module PA Pins
#define APP_PA_PIN NRF_GPIO_PIN_MAP(1,2)
#define APP_LNA_PIN NRF_GPIO_PIN_MAP(1,4)

uint32_t err_code;
sd_ant_config_pa_lna_get(&pstAmpConfig;);

pstAmpConfig.PA_CONFIG.bEnabled = 1;
pstAmpConfig.PA_CONFIG.bActiveState = 1;
pstAmpConfig.PA_CONFIG.ucGPIO = APP_PA_PIN;

pstAmpConfig.LNA_CONFIG.bEnabled = 1;
pstAmpConfig.LNA_CONFIG.bActiveState = 1;
pstAmpConfig.LNA_CONFIG.ucGPIO = APP_LNA_PIN;

pstAmpConfig.ucGPIOTECh = nGpioTeChannelNum;
pstAmpConfig.ucPPIChDisable = ppi_clr_ch; // 0 Value
pstAmpConfig.ucPPIChEnable = ppi_set_ch; // 1 Value

err_code = sd_ant_config_pa_lna_set(&pstAmpConfig;);


return err_code = 7

Note: When set PA LAN Pin as port0 than not getting any error.

Regards,
Himansu Donga
     
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi Himansu,

Currently the ANT stack only allows Port 0 to function with the PA/LNA functionality. The team will try to get this addressed in the next SoftDevice release.


Regards,

Harrison      
Rank

Total Posts: 13

Joined 2017-04-12

PM

Hi Harrison,


Thanks for the update. Any timeline when a new stack will be released with this support? Can I get any private fix to test this out?

For your information when use S340 stack BLE part support PORT1 pin use as PA/LNA configuration and it is working ok. Only ANT Function report error. As per soft device release mention PORT1 is supported for PA/LNA Configuration.

" GPIO port 1 pins (P1.00 to P1.15) can now be used for PA/LNA on the nRF52840 (DRGN-9995). "

Regards,
Himansu Donga      
Rank

Total Posts: 13

Joined 2017-04-12

PM

Thank ANTTeam,

New Stack S340 7.0.1 is supporte PORT 1 Pin for PA/LNA Configuration.

Regards,
Himansu      
Rank

Total Posts: 16

Joined 2020-10-16

PM

Hello I am using same softdevice, SDK and device and trying to use LNA/PA. My problem is that I'm not able to get reliable data when PA enabled. The data looks like this on ANTWareII software:
Received BROADCAST_DATA_0x4E
  
:: 4e00-01-01-00-00-00-00-00-00
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
Received BROADCAST_DATA_0x4E
  
:: 4e00-01-01-00-00-00-00-00-00
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02
EVENT_RX_FAIL_0x02
  
:: 4000-01-02 


I have attached the driver file to enable PA, we are successfully using the same driver for BLE to amplify power. The driver was provided by the manufacturer of BLE module (model#BT840XE). I'm not sure what LNA/PA chip is inside this module.

I have a few questions:

a) The above code posted by @Himansu and @DongaSciter, is this a generic code for any PA chip or a specific model? Which specific model if true.
b) A PA code working (we can measure physical range increase), shouldn't also work for ANT as well?


Driver file:
https://codeshare.io/5DKB6p      
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

Your code shows that only ble use of the pa_lna is configured (only sd_ble_opt_set is used). You will also need to set up ant with sd_ant_config_pa_lna_set as in the above example. As stated above "3) The same PPI, GPIOTE and GPIO can be used for the PA for both BLE and ANT concurrently." You can add code at ln 82 of your code file that converts the ble pa_lna structure to the ANT_PA_LNA_CONFIG structure and calls sd_ant_config_pa_lna_set.      

Signature

Ian Haigh

Rank

Total Posts: 16

Joined 2020-10-16

PM

Hello,
Thanks for reply. This code worked for me:
// PA/LNA Code for ANT:
    
uint32_t err_code sd_ant_config_pa_lna_get(&pstAmpConfig;);
    
APP_ERROR_CHECK(err_code);

    
pstAmpConfig.PA_CONFIG.bEnabled 1;
    
pstAmpConfig.PA_CONFIG.bActiveState 1;
    
pstAmpConfig.PA_CONFIG.ucGPIO APP_PA_PIN;

    
pstAmpConfig.LNA_CONFIG.bEnabled 1;
    
pstAmpConfig.LNA_CONFIG.bActiveState 1;
    
pstAmpConfig.LNA_CONFIG.ucGPIO APP_LNA_PIN;

    
nrf_ppi_channel_t ppi_set_ch;
    
nrf_ppi_channel_t ppi_clr_ch;

    
pstAmpConfig.ucGPIOTECh 1;//nGpioTeChannelNum;
    
pstAmpConfig.ucPPIChDisable 0;//ppi_clr_ch; // 0 Value
    
pstAmpConfig.ucPPIChEnable 1;//ppi_set_ch; // 1 Value

    
err_code sd_ant_config_pa_lna_set(&pstAmpConfig;);
    
APP_ERROR_CHECK(err_code);