21540 how to use api for spi to control tx power

hi support team,

i have looked into our devzone, but didn't see how to use spi to control 21540 tx power dynamiclly.

seems there is no demo or source code can explain how to do it.

i can see fem_nrf21540_gpio_spi_configure() in mpsl_fem_nrf21540_gpio.spi.c, but don't know how to change tx power dynamiclly.

and by the way i have seen this ticket: SPI bus need to be dedicated to nRF21540? , it says"Current nRF21540 SW solution does not support SPI control, it relies on GPIO control." , have we finished this software?

Regards,

William.

  • yes Paka,

    well, my purpose is to testing 21540 20db 110+mA current and 10db 30+mA current with 21540dk,so right now, i can't see the result corrent.

    what should i do to with following parameter?

    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=20
    #CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y
    #CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL=y
    #CONFIG_MPSL_FEM_POWER_MODEL=y
    CONFIG_BT_CTLR_TX_PWR_ANTENNA=20

    and after programing  the TXPOWER is 0, which means the 52840 0db internally.

    the current is 16mA. Anything wrong in my side?

    Regards,

    William.

  • So if you have 20dB gain and want 20dBm then the output power of the SoC radio will be 0dBm. When measuring the current, are you sure the FEM power is included in the measurements? Note that since the nRF21540 doesn't have bypass mode then if you have RF going to the antenna then you are using the PA (unless the signal is really, really weak, they it can be leakage).

    Note: the nRF21540 curren doesn't go through the P22/P23 on the nRF21540-DK, those will only measure the current used by the nRF52840.

Related