STM32CubeWL icon indicating copy to clipboard operation
STM32CubeWL copied to clipboard

SUBGRF_SetTxParams Pa config

Open dbanello opened this issue 1 year ago • 1 comments

I'm working on STM32CubeWL 1.3.0. I've seen that SUBGRF_SetTxParams function seems to set Pa config and power setting in according to Table 27. "PA optimal setting and operating mode of RM0461". But I think the implementation in STM32CubeWL 1.1.0 is more correct beacause it use power instead of max_power to select the right configuration of PA.

Version 1.3.0: `

if (paSelect == RFO_LP)
{
    max_power = RBI_GetRFOMaxPowerConfig(RBI_RFO_LP_MAXPOWER);
    if (power >  max_power)
    {
      power = max_power;
    }
    if (max_power == 14)
    {
        SUBGRF_SetPaConfig(0x04, 0x00, 0x01, 0x01);
        power = 0x0E - (max_power - power);
    }
    else if (max_power == 10)
    {
        SUBGRF_SetPaConfig(0x01, 0x00, 0x01, 0x01);
        power = 0x0D - (max_power - power);
    }
    else /*default 15dBm*/
    {
        SUBGRF_SetPaConfig(0x07, 0x00, 0x01, 0x01);
        power = 0x0E - (max_power - power);
    }
    if (power < -17)
    {
        power = -17;
    }
    SUBGRF_WriteRegister(REG_OCP, 0x18);   /* current max is 80 mA for the whole device*/
}

`

Version 1.1.0 `

if( paSelect == RFO_LP )
{
    if( power == 15 )
    {
        SUBGRF_SetPaConfig( 0x06, 0x00, 0x01, 0x01 );
    }
    else
    {
        SUBGRF_SetPaConfig( 0x04, 0x00, 0x01, 0x01 );
    }
    if( power >= 14 )
    {
        power = 14;
    }
    else if( power < -17 )
    {
        power = -17;
    }
    SUBGRF_WriteRegister( REG_OCP, 0x18 ); // current max is 80 mA for the whole device
}

`

Example In version 1.3.0 if the input power is 10dbm and max_power in LP is 15dbm the settings will be this: SUBGRF_SetPaConfig(0x07, 0x00, 0x01, 0x01); power = 0x0E - (max_power - power) = 0x0E - (15-10) = 14-5 = 9 These values are not what I'm expecting reading the RM0461

dbanello avatar Apr 18 '24 12:04 dbanello

ST Internal Reference: 179540

RJMSTM avatar Apr 19 '24 15:04 RJMSTM

Hello @dbanello,

We checked the SUBGRF_setPaConfig function and it seems to be correct. The calculation you made is correct. In fact in according to the table, this configuration SUBGRF_SetPaConfig(0x07, 0x00, 0x01, 0x01); and
power(Set_TxParams) = 0x0E - (max_power - power) = 0x0E - (15-10) = 14-5 =9 gives exactly +10 (Output power dBm).

Image

Regards,

RJMSTM avatar Jan 30 '25 10:01 RJMSTM