Data Sheet
BMD-345 - Data sheet
UBX-19039908 - R07 RF front end – PA / LNA Page 22 of 36
// The GPIO pin to toggle
opt.common_opt.pa_lna.lna_cfg.gpio_pin = gpio_lna_pin;
err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &opt);
APP_ERROR_CHECK(err_code);
}
//Insert the following code before calling scan_start() or advertising_start ()
/*------------------------------------------------------------------------*/
//Set PA / LNA Mode Pin: Low for Normal operation
nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(1,4));
nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(1,4));
//Set PA / LNA Select Pin: low for u.FL
nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(1,2));
nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(1,2));
//Setup PA / LNA TX and RX control pins with the SoftDevice
pa_lna_assist(NRF_GPIO_PIN_MAP(1,5),NRF_GPIO_PIN_MAP(1,6));
//Set TX power for scan responses
sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT, 0,
RADIO_TXPOWER_TXPOWER_Neg8dBm);
//Set TX power for advertisements
sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, 0,
RADIO_TXPOWER_TXPOWER_Neg8dBm);
//Tx power setting for connections inherit the scan or advertising power setting
/*-------------------------------------------------------------------------*/
Code block 2: Full dynamic method using Nordic Semiconductor SoftDevice
5.2.2 Static Method
The static method is a “simple set it and forget it” way to enable basic use of the PA / LNA, typically
when using a radio stack that doesn’t support a PA / LNA and there is no way to run application code
when the radio switches between transmitting and receiving, such as the Wirepas® SDK. It only
requires the ability to set GPIO once at startup. For full stack support, it only supports bypass mode.
Importantly, the GPIO need for PA / LNA control are on Port 1 of the nRF52840.
☞ If the radio will only transmit or receive (such as BLE broadcast or listener roles), the RFX2411 can
be configured statically in transmit or receive modes, through long term performance in these
modes isn’t tested.
Code to enable bypass mode:
#define RX_EN_PIN 38 //P1.06
#define TX_EN_PIN 37 //P1.05
#define PA_MODE_PIN 36 //P1.04
#define A_SEL_PIN 34 //P1.02
void pa_lna_init(void)
{
//configure PA / LNA pins as outputs
nrf_gpio_cfg_output(RX_EN_PIN);
nrf_gpio_cfg_output(TX_EN_PIN);
nrf_gpio_cfg_output(MODE_PIN);
nrf_gpio_cfg_output(A_SEL_PIN);
//set PA / LNA pins for bypass mode
nrf_gpio_pin_clear(RX_EN_PIN);
nrf_gpio_pin_clear(TX_EN_PIN);
nrf_gpio_pin_set(MODE_PIN);
nrf_gpio_pin_clear(A_SEL_PIN);
}
Code block 3: Static method to set bypass mode