Data Sheet
BMD-345 - Data sheet
UBX-19039908 - R07 RF front end – PA / LNA Page 20 of 36
Figure 3: Radio Packet Event Timing Diagram
Code to enable full dynamic mode using the PPI and GPIOTE peripherals:
#define RX_EN_PIN 37 //P1.06
#define TX_EN_PIN 37 //P1.05
#define MODE_PIN 36 //P1.04
#define A_SEL_PIN 34 //P1.02
typedef enum
{
PA_SHUTDOWN,
PA_TX,
PA_RX,
PA_BYPASS
} pa_modes_t;
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 shutdown mode, U.FL antenna
nrf_gpio_pin_clear(RX_EN_PIN);
nrf_gpio_pin_clear(TX_EN_PIN);
nrf_gpio_pin_clear(MODE_PIN);
nrf_gpio_pin_clear(A_SEL_PIN);
//Setup a PPI Channel for Radio Ready Event to enable PA / LNA
NRF_PPI->CH[1].EEP = (uint32_t)&NRF_RADIO->EVENTS_READY;
NRF_PPI->CH[1].TEP = (uint32_t)&NRF_GPIOTE->TASKS_SET[0];
//Setup PPI channel for Radio Disabled Event to disable PA / LNA
NRF_PPI->CH[2].EEP = (uint32_t)&NRF_RADIO->EVENTS_DISABLED;
NRF_PPI->CH[2].TEP = (uint32_t)&NRF_GPIOTE->TASKS_CLR[0];
//set radio power to max allowed (FCC)
NRF_RADIO->TXPOWER = RADIO_TXPOWER_TXPOWER_Neg8dBm;
//Note: FCC and ISED max power setting: -8 dBm
// CE (RED) max power setting: -16 dBm
}
void pa_lna_set_mode(pa_modes_t mode)
{
NRF_PPI->CHENCLR = 0x06; //disable PPI channels 1 and 2